Skip to content

refactor: get version dynamically #5753

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

Merged
merged 30 commits into from
Nov 8, 2022
Merged

refactor: get version dynamically #5753

merged 30 commits into from
Nov 8, 2022

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Nov 4, 2022

Description

This PR refactors the release process to dynamically get the release version from the workflow inputs. This means we don't have to open a PR into main that modifies the package.json. It also means we'll need to manually modify the CHANGELOG and the Helm chart after doing a release.

Todos

  • remove global VERSION
  • set anywhere we need it
  • standardize input to always include v and then strip when not needed
  • update release docs

Screenshot

image

Testing Plan

  • test build flow - published successfully to npm here, successful build CI here (todo link)
  • test release flow: run draft release manually, and double-check assets
  • test publish flow: copy changes to fork and test publish there. uses the correct input

@jsjoeio jsjoeio changed the title jsjoeio/release changes refactor: get version dynamically Nov 4, 2022
@jsjoeio jsjoeio self-assigned this Nov 4, 2022
@jsjoeio jsjoeio temporarily deployed to npm November 4, 2022 16:04 Inactive
@github-actions
Copy link

github-actions bot commented Nov 4, 2022

✨ code-server dev build published to npm for PR #5753!

  • Last publish status: success
  • Commit: 2b77611

To install in a local project, run:

npm install @coder/code-server-pr@5753

To install globally, run:

npm install -g @coder/code-server-pr@5753

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Merging #5753 (2b77611) into main (5a8bb2b) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5753   +/-   ##
=======================================
  Coverage   72.65%   72.65%           
=======================================
  Files          30       30           
  Lines        1682     1682           
  Branches      369      369           
=======================================
  Hits         1222     1222           
  Misses        397      397           
  Partials       63       63           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a8bb2b...2b77611. Read the comment docs.

@jsjoeio jsjoeio temporarily deployed to npm November 4, 2022 16:26 Inactive
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Nov 4, 2022

First test: draft workflow succeeds. And when you download an asset, it shows the package.json has been updated and the product.json:

image

image

However, the assets have the wrong version in their name 🤔

image

I'm not sure what the root cause of this problem is though.

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Nov 4, 2022

Okay figured out the issue. we get VERSION from the root package.json. Need to figure out a solution for this.

@jsjoeio jsjoeio temporarily deployed to npm November 4, 2022 20:39 Inactive
@jsjoeio jsjoeio temporarily deployed to npm November 4, 2022 21:40 Inactive
@jsjoeio jsjoeio temporarily deployed to npm November 4, 2022 21:46 Inactive
@jsjoeio jsjoeio temporarily deployed to npm November 4, 2022 21:58 Inactive
@jsjoeio jsjoeio temporarily deployed to npm November 4, 2022 22:11 Inactive
@jsjoeio jsjoeio temporarily deployed to npm November 4, 2022 22:27 Inactive
@code-asher
Copy link
Member

Should we also change the package.json version to be development or 0.0.0 or something like that?

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Nov 7, 2022

Should we also change the package.json version to be development or 0.0.0 or something like that?

Yeah, good call. I'll update it to 0.0.0

@jsjoeio jsjoeio temporarily deployed to npm November 7, 2022 19:40 Inactive
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Nov 7, 2022

Ready for another review 👀

@socket-security
Copy link

socket-security bot commented Nov 7, 2022

Socket Security Pull Request Report

👍 No new dependency issues detected in pull request

Pull request report summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script confusion ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues
Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore [email protected] [email protected]

⚠️ Please accept the latest app permissions to ensure bot commands work properly. Accept the new permissions here.

Powered by socket.dev

@jsjoeio jsjoeio temporarily deployed to npm November 7, 2022 19:44 Inactive
@jsjoeio jsjoeio temporarily deployed to npm November 7, 2022 19:52 Inactive
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Nov 7, 2022

e2e tests failing because it's using a cached version of Code. bumped cache key in secrets.

@jsjoeio jsjoeio temporarily deployed to npm November 7, 2022 20:18 Inactive
@jsjoeio jsjoeio temporarily deployed to npm November 7, 2022 20:54 Inactive
@@ -47,6 +47,7 @@ main() {
# as it is a submodule.
export VSCODE_DISTRO_COMMIT
VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD)
VERSION=$(jq -r .version ../../package.json)
Copy link
Member

Choose a reason for hiding this comment

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

We still need to delete this line otherwise the version we set in the workflow gets overridden!

@jsjoeio jsjoeio requested a review from code-asher November 8, 2022 20:38
@@ -73,6 +91,8 @@ jobs:
timeout-minutes: 10
env:
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
VERSION: ${{ github.event.inputs.version || github.ref_name }}
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this line since we set version in another step?

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 think so? Don't we need to set it in every step?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm double-checking..i see what you mean now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, you were right - nice catch. Removed!

@jsjoeio jsjoeio temporarily deployed to npm November 8, 2022 20:52 Inactive
@jsjoeio jsjoeio temporarily deployed to npm November 8, 2022 21:56 Inactive
@jsjoeio jsjoeio temporarily deployed to npm November 8, 2022 22:32 Inactive
@repo-ranger repo-ranger bot merged commit b978655 into main Nov 8, 2022
@repo-ranger repo-ranger bot deleted the jsjoeio/release-changes branch November 8, 2022 22:45
@jsjoeio jsjoeio modified the milestones: November 2022, 4.9.0 Dec 1, 2022
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.

2 participants