Skip to content

Maintenance: fix version bump in examples #1407

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

Closed
1 of 2 tasks
dreamorosi opened this issue Apr 11, 2023 · 4 comments · Fixed by #1434
Closed
1 of 2 tasks

Maintenance: fix version bump in examples #1407

dreamorosi opened this issue Apr 11, 2023 · 4 comments · Fixed by #1434
Assignees
Labels
completed This item is complete and has been merged/shipped internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)

Comments

@dreamorosi
Copy link
Contributor

Summary

Every time we make a release we want the examples present in the repository under examples/* to use the latest version of the Powertools utilities. This allows to keep the examples in sync with the current feature set.

Why is this needed?

We want to make sure that the examples that we offer are accurate and work with the latest release published on npm. Currently this requires a manual version bump after a release, which can be problematic.

Which area does this relate to?

Tests

Solution

TBD

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

@dreamorosi dreamorosi added triage This item has not been triaged by a maintainer, please wait internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) labels Apr 11, 2023
@dreamorosi dreamorosi added discussing The issue needs to be discussed, elaborated, or refined and removed triage This item has not been triaged by a maintainer, please wait labels Apr 11, 2023
@dreamorosi
Copy link
Contributor Author

Currently the examples are not part of the npm workspace but are part of the lerna one. This means that they are excluded from most of the workspace actions but still get versioned every time a release is made. This last bit is also the reason why the examples are out of sync and are always a version behind the published one.

Basically the version command of both examples installs the latest version of the utilities from npm. This however happens before the publish action has been performed.

To solve/go around the issue I'm thinking of two options:

  1. Make the examples part of the npm workspace
  2. Add a new step to the release process that increments the version

Between these two I'm leaning towards number 1.

Making the examples folders part of the npm workspace would remove the need to bump the version numbers altogether given that the dependencies would be linked. This would also mean that whenever there's a change to the libraries the examples should be updated as well (assuming it's a breaking change). Finally, using this method would also slightly simplify the setup process of the repo requiring a single npm ci.

@dreamorosi
Copy link
Contributor Author

After starting to work on this, I think we'll need to do both methods described above after all.

Including the packages in the workspace is needed as it consolidates the packages & configs and removes duplication, however we still need find a way to increase the version number in the examples (see example below) when a release happens.

Currently both examples/cdk and examples/sam have a package.json that references the utilities as devDependencies/dependencies. The version number there is fixed but should/could be bumped as a release happens.

@dreamorosi dreamorosi self-assigned this May 4, 2023
@dreamorosi dreamorosi added confirmed The scope is clear, ready for implementation and removed discussing The issue needs to be discussed, elaborated, or refined labels May 4, 2023
@dreamorosi dreamorosi moved this from Backlog to Working on it in AWS Lambda Powertools for TypeScript May 4, 2023
@dreamorosi
Copy link
Contributor Author

After additional investigation and after having moved both examples under the npm workspace, removing the current existing version command from their respective package.json files allows lerna to version & bump the dependencies in the examples 🎉

I'll push a PR soon.

@dreamorosi dreamorosi linked a pull request May 4, 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 May 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

⚠️ 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 May 4, 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 May 4, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in AWS Lambda Powertools for TypeScript May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant