Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance: publish layers & increment version during main release process #1124

Closed
dreamorosi opened this issue Oct 18, 2022 · 5 comments · Fixed by #1324 or #1333
Closed

Maintenance: publish layers & increment version during main release process #1124

dreamorosi opened this issue Oct 18, 2022 · 5 comments · Fixed by #1324 or #1333
Assignees
Labels
automation This item relates to automation completed This item is complete and has been merged/shipped
Milestone

Comments

@dreamorosi
Copy link
Contributor

Bug description

At the moment the release process for the utilities and layers loosely works as follows:

graph LR
    A[Make Release] --> B(Version)
    B --> C(Publish)
    C -->|Triggers| D[Publish Layers]
    D --> E(Layer Published)
    E -->|Manual commit| H(Update layer version in docs)
    C -->|Manual trigger| F[GitHub Release]
    F --> G(Docs Published using tag)
    G -->|Tag from here| C
Loading

Looking at the diagram above we can observe that the Layer publishing workflow and the release one diverge from the publishing one. This is a problem because the following happens:

  • During versioning & publishing (1st workflow) we increment the packages version & push a tag (i.e. v.1.3.0)
  • Subsequently, the layers are published (2nd workflow) and we manually have to increment the Layer version (i.e. `3) in the docs
  • Finally, we make a release using the GitHub UI (3rd workflow) which uses the tag created at step 1

This means that by the time we make the GitHub release and release the docs, the tag that was created at step 1 is outdated and that the commit that updates the Layer version in the docs won't be taken in account.

This is what happened in the last release (v1.3.0) which should correspond to Layer version 3 but instead shows version 2 (from before the process above) that corresponds to v1.2.1 of the library.

Expected Behavior

The tag that is used to release a version & publish docs should already include the commit that updates the Layer version in the docs.

Current Behavior

Layer version in the docs is not synced with latest & with release version.

Possible Solution

There are three options that I could think of.

Option 1

Publish workflow optimistically increments by one the Layer version in the docs at some point BEFORE versioning.

graph LR
    A[Make Release] --> B(Version)
    B --> L(Opimistically update docs with new version)
    L --> M(Push new tag)
    M --> C(Publish)
    C -->|Triggers| K[Publish layers]
    K --> E(Layer Published)
    C -->|Manual trigger| F[GitHub Release]
    F --> G(Docs Published using tag)
    G -->|Tag from here| C
Loading

In this scenario the layers are published at the same step as now, but the Make Release workflow optimistically bumps the layer version in the docs before making the release. This way the commit that increments the layer version in the docs will have been made before the tag is pushed.

This option is the simpler to implement and hinges on the fact that Layers are always and exclusively published as part of a full release train.

Option 2

Layers + docs update are published AFTER versioning has happened BUT BEFORE the tags is pushed.

graph LR
    A[Make Release] --> B(Version)
    B --> K[Publish layers]
    K --> L(Update docs with new version)
    L --> M(Push new tag)
    M --> C(Publish)
    C -->|Manual trigger| F[GitHub Release]
    F --> G(Docs Published using tag)
    G -->|Tag from here| C
Loading

In this scenario, the Publish Layers action is triggered as intermediate step between npm run version & npm run publish (here). This way the layer publishing process

This option will require us to run the commands currently run in the postversion command in each package.json file (git push && git push --tags) after the docs have already been updated with the new Layers version.

This will work as long as the Publish Layers workflow is able to use the same context as the Make Release one & be able to see the that the version in the package.json files has been bumped.

Option 3

Leave all workflow as they are and manually update the version in the docs BEFORE starting the release process.

This step requires no changes in the pipelines but revolves around us maintainers following the process & making no errors.

If we are to follow this, we'll have to document the release SOP and make sure it's followed.

Steps to Reproduce

See above.

Environment

  • Powertools version used: N/A
  • Packaging format (Layers, npm): N/A
  • AWS Lambda function runtime: N/A
  • Debugging logs: N/A

Related issues, RFCs

#826

@dreamorosi dreamorosi added bug Something isn't working triage This item has not been triaged by a maintainer, please wait labels Oct 18, 2022
@dreamorosi dreamorosi added this to the Lambda layer milestone Oct 18, 2022
@heitorlessa
Copy link
Contributor

Chat with @rubenfonseca as he's just finished integrating our release with Layer version bump in the docs + ARM64 too, since we're now making ~168 Layer deployments per release

@flochaz
Copy link
Contributor

flochaz commented Oct 18, 2022

Need to check what has been done on python side (aws-powertools/powertools-lambda-python#1610) but thinking of this , the script could use https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#listLayerVersions-property API in the github action to bump based on true version published

@flochaz flochaz self-assigned this Oct 18, 2022
@dreamorosi dreamorosi added automation This item relates to automation confirmed The scope is clear, ready for implementation and removed bug Something isn't working triage This item has not been triaged by a maintainer, please wait labels Nov 13, 2022
@dreamorosi dreamorosi changed the title Bug (layers): publish layers & increment version during main release process Maintenance: publish layers & increment version during main release process Nov 14, 2022
@dreamorosi dreamorosi moved this from Backlog to Working on it in AWS Lambda Powertools for TypeScript Feb 8, 2023
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in AWS Lambda Powertools for TypeScript Feb 25, 2023
@github-actions

This comment was marked as outdated.

@dreamorosi
Copy link
Contributor Author

Seems that one of the workflows introduced in the PR that closed this issue has a circular dependency: https://github.com/awslabs/aws-lambda-powertools-typescript/actions/runs/4271035677

@dreamorosi dreamorosi reopened this Feb 25, 2023
@dreamorosi dreamorosi moved this from Coming soon to Working on it in AWS Lambda Powertools for TypeScript Feb 25, 2023
@dreamorosi dreamorosi linked a pull request Feb 26, 2023 that will close this issue
13 tasks
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in AWS Lambda Powertools for TypeScript Feb 26, 2023
@github-actions
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added the pending-release This item has been merged and will be released soon label Feb 26, 2023
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon confirmed The scope is clear, ready for implementation labels Feb 26, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in AWS Lambda Powertools for TypeScript Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation This item relates to automation completed This item is complete and has been merged/shipped
Projects
None yet
4 participants