Skip to content

Conversation

@ShadowCat567
Copy link
Contributor

@ShadowCat567 ShadowCat567 commented Sep 23, 2024

Problem

@aws-amplify/backend sometimes does not properly inherit the right kind of version bump from its dependencies.

Issue number, if available: #1693

Changes

  • refactored check_changeset_completeness.ts to be split into functions
  • added set of functions to check_changeset_completeness.ts that check whether backend should be inheriting a version bump and whether it is currently inheriting the right kind of version bump
    Corresponding docs PR, if applicable:

Validation

  • ran manual tests using different version bumps for backend and its dependencies
  • Test 1: backend: none, dependencies have version bump of minor
image
  • Test 2: backend: minor, dependencies are minor or none
image
  • Test 3: backend: patch, dependencies are minor or patch
image
  • Test 4: backend: patch, no dependency versions
image
  • Test 5: backend: minor, one dependency is major
image

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2024

⚠️ No Changeset found

Latest commit: 58f2e01

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines 5 to 6
// eslint-disable-next-line import/no-extraneous-dependencies
import { ReleasePlan } from '@changesets/types';
Copy link
Contributor

Choose a reason for hiding this comment

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

we should just add this package as dev dep.

Copy link
Contributor

@sobolk sobolk left a comment

Choose a reason for hiding this comment

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

Looks good.

}
}
}
const versionTypeConverter = (version: VersionType): VersionTypeEnum => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const versionTypeConverter = (version: VersionType): VersionTypeEnum => {
const convertVersionType = (version: VersionType): VersionTypeEnum => {

function name should be verb-ish.

Comment on lines 95 to 100
maxVersion(
backendAuthVersion,
backendDataVersion,
backendFunctionVersion,
backendStorageVersion
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
maxVersion(
backendAuthVersion,
backendDataVersion,
backendFunctionVersion,
backendStorageVersion
)
Math.max(
backendAuthVersion,
backendDataVersion,
backendFunctionVersion,
backendStorageVersion
)

would this just work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, the function is unnecessary

sobolk
sobolk previously approved these changes Sep 24, 2024
@ShadowCat567 ShadowCat567 marked this pull request as ready for review September 24, 2024 16:22
@ShadowCat567 ShadowCat567 requested review from a team as code owners September 24, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants