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

chore(examples): fix version bumping of examples #498

Merged
merged 2 commits into from
Jan 24, 2022
Merged

chore(examples): fix version bumping of examples #498

merged 2 commits into from
Jan 24, 2022

Conversation

flochaz
Copy link
Contributor

@flochaz flochaz commented Jan 21, 2022

Description of your changes

Currently when a version are bumped, examples cdk package got his dependencies bumped as well to match latest package that are going to be released.

  1. This can't be control due to this How to prevent Lerna from automatically updating dependencies versions? lerna/lerna#2326 bug.
  2. Bumping dependencies can make example code buggy since it won't be updated to go around potential breaking changes ...

This PR leverage versionning life cycle to force versioning of deps and workaround lerna/lerna#2326 .

NB: Examples will always be behind if we don't update manually the dependencies.

Alternative

Remove examples/cdk from lerna.json and add lint, build and test specific scripts to either root package.json or in github actions and husky scripts ...

How to verify this change

  1. Bump version npx lerna version --force-publish=\* --no-git-tag-version --no-push --conventional-commits
  2. Check that examples package.json and lock for no change on deps

Build is passing https://github.com/awslabs/aws-lambda-powertools-typescript/runs/4898015010 so package-lock.json is fixed.

Next bump then run e2e tests will demonstrate the fix

Related issues, RFCs

#494

PR status

Is this ready for review?: YES
Is it a breaking change?: NO

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • The code coverage hasn't decreased
  • I have added tests that prove my change is effective and works
  • New and existing unit tests pass locally and in Github Actions
  • Any dependent changes have been merged and published in downstream module
  • The PR title follows the conventional commit semantics

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@flochaz flochaz changed the title chore(example): fix version bumping of examples chore(examples): fix version bumping of examples Jan 21, 2022
@github-actions github-actions bot added the internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) label Jan 21, 2022
@flochaz flochaz requested a review from dreamorosi January 21, 2022 15:05
@flochaz flochaz marked this pull request as draft January 21, 2022 15:33
@flochaz flochaz self-assigned this Jan 21, 2022
@flochaz flochaz marked this pull request as ready for review January 21, 2022 15:53
@flochaz flochaz requested a review from dreamorosi January 21, 2022 15:54
Copy link
Contributor

@ijemmy ijemmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flochaz

Feel really awkward about this. But I also can't think of a better fix and want to put my thoughts before approval.

^0.4.0 and 0.4.0

My main concern is that we now have ^0.4.0 (with caret) and will be override with 0.4.0 only when running lerna. The effect are:

  1. If we release 0.4.1, this version will be reverted back to 0.4.0 in lerna run. Any patching we did won't be applied here. We need to remember to update this every time we bump a patch version.
  2. Most contributors will not know that version target is run automatically by lerna.

Should we keeping example up-to-date through checklist?

Users who try this example with npm install will use the latest patched version. This is good. However, users may copy the code from example into their project with the latest version of library.

  • If the latest is just patching (0.4.1) or minor (0.5.0), it should be fine as it is backward compatible.
  • If the latest is major (1.0.x), the example can break.

To avoid this, we have to either add an updating example as part of Definition of Done checklist. This is manual now.

The alternative (leaving it as it is) is worse option

Alternatively, we can leave it as it is. We risk having broken examples for users. The users may or may not report back to us. So we might have broken examples for a very long time before any detection.

Choosing between two choice, I prefer to have this change in than leaving it as it is.

Copy link
Contributor

@ijemmy ijemmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is blocking merge. Let's go with this for now. Will discuss with the team on adding a checklist in PR so that we don't miss updating this.

@flochaz flochaz merged commit 53cabd1 into main Jan 24, 2022
@flochaz flochaz deleted the fix/release branch January 24, 2022 13:15
saragerion added a commit that referenced this pull request Jan 25, 2022
* build(all): add concurrency to github actions

* fix(build): revert group name for release

* chore(examples): fix version bumping of examples (#498)

* force fix version of deps for examples

* add package.json to bump commit

* build(deps): bump aws-sdk from 2.1056.0 to 2.1062.0 (#506)

Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1056.0 to 2.1062.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.1056.0...v2.1062.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @aws-sdk/client-sts from 3.46.0 to 3.48.0 (#505)

Bumps [@aws-sdk/client-sts](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-sts) from 3.46.0 to 3.48.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-sts/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.48.0/clients/client-sts)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-sts"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump typescript from 4.5.4 to 4.5.5 (#507)

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.4 to 4.5.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v4.5.4...v4.5.5)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/node from 17.0.8 to 17.0.10 (#488)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.8 to 17.0.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(logger|metrics): properly return decorated class (#489)

* fix: logger to return decorated class

* fix: metrics to return decorated class

* chore: remove leftover files from logger

* feat: Add codespaces/gitpod support (#485)

* feat: initial codespaces support

* chore: example commit to disable a plugin

* fix: rather use lerna-ci

* fix: forgot to remove "cd "to examples

* feat: Add gitpod support

* chore: move to node 14 for both gitpod and codespaces

* fix: gitpod specific way

* chore: use nvmrc to ease shared config

* docs: comment out docs for gitpod

* fix: force npm to be 8

* feat: finalize extensions

* chore: remove ones that don't work

* fix: container typo

* build(all): add concurrency to github actions

* fix(build): revert group name for release

Co-authored-by: Florian Chazal <florianchazal@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrea Amorosi <dreamorosi@gmail.com>
Co-authored-by: Michael Brewer <michael.brewer@gyft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants