-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add a script for automating releases #647
Conversation
I just spotted that we already have a |
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.
I haven't reviewed the script in detail. I'm sure it works.
I suggest that we add CLI options for all new versions to support future patch releases, preview releases, and any unforseen scenario
scripts/release.py
Outdated
existing_vscode_version = pyproject_toml["project"]["version"] | ||
|
||
major, minor, micro = Version(existing_vscode_version).release | ||
new_vscode_version = Version(f"{major}.{minor + 2}.{micro}") |
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.
Hmm, how would we do a patch release or release a preview version (which we've done a few times in the past)?
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.
My idea of this script was to cover the common workflow rather than all possible workflows. I can add a CLI flag for this if you want, but I worry that the complexity it will add to the script won't be worth the time it will save us
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 problem I see is that this PR removes the documentation on how to do a release manually when not using the script. To me, that means it's now the only way of doing a release.
That's why I think we should either revert the documentation changes or extend the script. I'm worried about reverting the documentation because it probably will get outdated with future changes to this script which then is even worse: You end up with incomplete/incorrect instructions
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.
I see. Okay, I'll add the CLI flags.
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.
I added more flags in 37b2935, and tested them using uv run --python=3.7 scripts/release.py --new-version=2024.600.0 --new-ruff=0.6.0
. It did everything I expected it to.
Also, it didn't end up being much more code at all, so I think it was worth it -- thanks for persuading me!
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.
Thanks for adding it and thanks for automating the steps!
else: | ||
changelog_entry_middle = "" | ||
|
||
changelog_entry = textwrap.dedent(f"""\ |
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.
Why do you need the \
.
Isn't it nice how Ruff wraps the multiline string? :)
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.
It's a very common practice when using textwrap.dedent()
in combination with triple-quoted strings, or it's easy to end up with a dedented string where the first line has odd indentation https://grep.app/search?q=textwrap.dedent%28%22%22%22%5C&filter[lang][0]=Python
Isn't it nice how Ruff wraps the multiline string? :)
I'm... actually not a massive fan of that formatting choice 🙈 but I don't care enough to argue about it 😆
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.
I brought it up because it's a ruff specific style :)
abe19be
to
deb89c2
Compare
deb89c2
to
37b2935
Compare
Thanks for the review! |
Summary
This adds a script to automate the changes to various different files that need to be made in order to cut a new
ruff-vscode
release. This is one of the many things you need to do as part of the Ruff minor release process, which I'd like to make less time-consuming.The script does the following things:
pyproject.toml
andpackage.json
ruff
andruff-lsp
dependency pins this project has inpyproject.toml
to the latest versionsTest Plan
I checked out 51bc650 and ran
uv run --python=3.7 release.py
. The changes the script made were almost identical to 6ac401c (the latest commit we had preparing a new release).I also ran the following command to make sure the script type-checked with strict settings: