-
Notifications
You must be signed in to change notification settings - Fork 842
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
Update release versioning for snapshot releases #8389
Update release versioning for snapshot releases #8389
Conversation
…utions don't break
…is dependency versions to `workspace:*` so they always point to exact versions needed
…egistry.yarnpkg.com
…imestamp-based preid increments (`1.2.3-snapshot.<timestamp>`) and skip committing the version changes
@@ -32,7 +32,7 @@ | |||
"@babel/preset-env": "^7.21.5", | |||
"@babel/preset-react": "^7.18.6", | |||
"@babel/preset-typescript": "^7.21.5", | |||
"@elastic/eui-theme-common": "workspace:^", | |||
"@elastic/eui-theme-common": "workspace:*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed so that yarn replaces it during packing to an exact version instead of compatible with (^
) version
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@elastic/eui-theme-common", | |||
"version": "0.0.9", | |||
"version": "0.0.11", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last eui-theme-common version update was not committed. I must've forgotten to include it when doing it manually.
|
||
for (const workspace of workspaces) { | ||
logger.debug(`Calculating changes in ${workspace.name}`); | ||
|
||
const workspaceDir = path.join(rootWorkspaceDir, workspace.location); | ||
const currentVersion = await getWorkspacePackageVersion(workspaceDir); | ||
|
||
const { changelogMap, changelog, hasChanges, processedChangelogFiles } = | ||
await collateChangelogFiles(workspaceDir); | ||
if (options.type === 'snapshot') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be done better and moved to separate functions but we can clean it up later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM 👍
I tested the snapshot release locally and it worked like a charm 🪄
Preview staging links for this PR:
|
💚 Build Succeeded
cc @tkajtoch |
Summary
This PR improves the way snapshot releases (
yarn release snapshot
) are versioned. Previously, bothofficial
andsnapshot
releases used the regular changelog-based new version calculation. It wasn't correct since snapshot releases are meant for testing, and they should not use the same versioning scheme, even if suffixed with-snapshot
.The updated code builds and publishes packages with a timestamp-based versioning, for example:
99.4.0
->99.4.0-snapshot.1741123162416
1.2.3-borealis.0
->1.2.3-snapshot.1741123163100
With this change, the updated
package.json
versions will not be committed. Keep in mind, though, that the file is still edited, and will be marked as modified by git. There's no reset logic to get them back to the original state yet but it may be implemented in near future.QA
npm logout
andyarn npm logout
gh pr checkout <id>
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
and login as withyarn npm login
(enter the same user/password pair as previously, e.g.test/test
).yarnrc
to use the custom local verdaccio registryyarn
yarn workspace @elastic/eui-release-cli run build
(this will be automated soon)yarn release run snapshot --allow-custom --workspaces @elastic/eui-theme-common @elastic/eui-theme-borealis @elastic/eui
and follow its instructions<version>-snapshot.<timestamp>
versions on http://localhost:4873