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

ci: add deprecate release workflow #2532

Merged
merged 26 commits into from May 17, 2024
Merged

ci: add deprecate release workflow #2532

merged 26 commits into from May 17, 2024

Conversation

dpilch
Copy link
Contributor

@dpilch dpilch commented May 7, 2024

Description of changes

Usage

yarn trigger-deprecate-release <deprecation-message> <release-commit-hash> <no-dry-run>
  • deprecation-message (required): message used on npm deprecate
  • release-commit-hash (required): Release commit hash the version to deprecate https://docs.npmjs.com/cli/v8/commands/npm-deprecate
  • no-dry-run: When false the deprecation workflow will run against the verdaccio local registry (defaults to false)

Example:

yarn trigger-deprecate-release "contains regression" 143a2665877e3d55592e38e33f7b6bb55df90b51 false

This will deprecate all packages that were bumped in 143a266. If the deprecated version is also the latest, the workflow will also set the latest tag for all of these packages to the previous version.

50 | Moving dist tag "latest" to release tag @aws-amplify/amplify-category-api@5.11.2
51 | +latest: @aws-amplify/amplify-category-api@5.11.2
52 | Done!
53 |  
54 | Moving dist tag "latest" to release tag @aws-amplify/data-construct@1.8.0
55 | +latest: @aws-amplify/data-construct@1.8.0
56 | Done!
57 |  
58 | Moving dist tag "latest" to release tag @aws-amplify/graphql-api-construct@1.9.0
59 | +latest: @aws-amplify/graphql-api-construct@1.9.0
60 | Done!
61 |  
62 | Moving dist tag "latest" to release tag @aws-amplify/graphql-auth-transformer@3.5.0
63 | +latest: @aws-amplify/graphql-auth-transformer@3.5.0
64 | Done!
65 |  
66 | Moving dist tag "latest" to release tag @aws-amplify/graphql-default-value-transformer@2.3.4
67 | +latest: @aws-amplify/graphql-default-value-transformer@2.3.4
68 | Done!
69 |  
70 | Moving dist tag "latest" to release tag @aws-amplify/graphql-index-transformer@2.4.0
71 | +latest: @aws-amplify/graphql-index-transformer@2.4.0
72 | Done!
73 |  
74 | Moving dist tag "latest" to release tag @aws-amplify/graphql-maps-to-transformer@3.4.12
75 | +latest: @aws-amplify/graphql-maps-to-transformer@3.4.12
76 | Done!
77 |  
78 | Moving dist tag "latest" to release tag @aws-amplify/graphql-model-transformer@2.9.0
79 | +latest: @aws-amplify/graphql-model-transformer@2.9.0
80 | Done!
81 |  
82 | Moving dist tag "latest" to release tag @aws-amplify/graphql-relational-transformer@2.5.0
83 | +latest: @aws-amplify/graphql-relational-transformer@2.5.0
84 | Done!
85 |  
86 | Moving dist tag "latest" to release tag @aws-amplify/graphql-schema-generator@0.8.3
87 | +latest: @aws-amplify/graphql-schema-generator@0.8.3
88 | Done!
89 |  
90 | Moving dist tag "latest" to release tag @aws-amplify/graphql-schema-test-library@2.2.27
91 | +latest: @aws-amplify/graphql-schema-test-library@2.2.27
92 | Done!
93 |  
94 | Moving dist tag "latest" to release tag @aws-amplify/graphql-searchable-transformer@2.7.0
95 | +latest: @aws-amplify/graphql-searchable-transformer@2.7.0
96 | Done!
97 |  
98 | Moving dist tag "latest" to release tag @aws-amplify/graphql-sql-transformer@0.3.0
99 | +latest: @aws-amplify/graphql-sql-transformer@0.3.0
100 | Done!
101 |  
102 | Moving dist tag "latest" to release tag @aws-amplify/graphql-transformer@1.5.2
103 | +latest: @aws-amplify/graphql-transformer@1.5.2
104 | Done!
105 |  
106 | Deprecating package version @aws-amplify/amplify-category-api@5.11.3
107 | Done!
108 |  
109 | Deprecating package version @aws-amplify/data-construct@1.8.1
110 | Done!
111 |  
112 | Deprecating package version @aws-amplify/graphql-api-construct@1.9.1
113 | Done!
114 |  
115 | Deprecating package version @aws-amplify/graphql-auth-transformer@3.5.1
116 | Done!
117 |  
118 | Deprecating package version @aws-amplify/graphql-default-value-transformer@2.3.5
119 | Done!
120 |  
121 | Deprecating package version @aws-amplify/graphql-index-transformer@2.4.1
122 | Done!
123 |  
124 | Deprecating package version @aws-amplify/graphql-maps-to-transformer@3.4.13
125 | Done!
126 |  
127 | Deprecating package version @aws-amplify/graphql-model-transformer@2.9.1
128 | Done!
129 |  
130 | Deprecating package version @aws-amplify/graphql-relational-transformer@2.5.1
131 | Done!
132 |  
133 | Deprecating package version @aws-amplify/graphql-schema-generator@0.8.4
134 | Done!
135 |  
136 | Deprecating package version @aws-amplify/graphql-schema-test-library@2.2.28
137 | Done!
138 |  
139 | Deprecating package version @aws-amplify/graphql-searchable-transformer@2.7.1
140 | Done!
141 |  
142 | Deprecating package version @aws-amplify/graphql-sql-transformer@0.3.1
143 | Done!
144 |  
145 | Deprecating package version @aws-amplify/graphql-transformer@1.5.3
146 | Done!
CDK / CloudFormation Parameters Changed

N/A

Issue #, if available

N/A

Description of how you validated changes

I ran the workflow against the CodeBuild project in my personal account. I only tested against the verdaccio local registry so the production deprecation is not fully tested.

Checklist

  • PR description included

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

@dpilch dpilch changed the title Deprecate release workflow ci: add deprecate release workflow May 7, 2024
@dpilch dpilch marked this pull request as ready for review May 7, 2024 18:55
@dpilch dpilch requested review from a team as code owners May 7, 2024 18:55
*/
getTagsAtCommit = async (commitHash: string) => {
// filter out packages not published to npm
const privatePackages = [
Copy link
Member

Choose a reason for hiding this comment

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

Not a blocker, but how can we keep this list in sync? How do we remember in the future to edit this list if we add a private package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've created a postinstall command to generate the list of private packages so now it should always be in sync.

* Note that this does not mean just looking up the previous release tags.
* It may be the case that package-A was released in release-5 but the previous release of package-A happened in release-2.
* This method will walk through past release tags until it finds the previous version of all of the input package versions
* If a previous version of some package cannot be found, an error is thrown.
Copy link
Member

Choose a reason for hiding this comment

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

DOes this mean that we are unable to roll back releases that contain the first public publication of a package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll see if there is a way to resolve this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed this to just print a warning message when a previous release is not found.

shared-scripts.sh Show resolved Hide resolved
@dpilch dpilch merged commit 9b02e35 into main May 17, 2024
6 checks passed
@dpilch dpilch deleted the deprecate-release branch May 17, 2024 18:48
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.

None yet

3 participants