-
Notifications
You must be signed in to change notification settings - Fork 187
feat(release): Creating release scripts for internal and chore release #20286
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
base: edge
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## edge #20286 +/- ##
===========================================
+ Coverage 25.58% 57.10% +31.52%
===========================================
Files 3640 3660 +20
Lines 303120 306159 +3039
Branches 42327 43189 +862
===========================================
+ Hits 77552 174832 +97280
+ Misses 225544 131107 -94437
- Partials 24 220 +196
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
sfoster1
left a comment
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.
Couple improvements in style and the way we use git, looks like a solid script though
scripts/app-release/chore-release.py
Outdated
| Clone opentrons repo to a temp dir, list all remote chore_release-* branches, | ||
| and return the one with the highest X.Y.Z version. | ||
| """ | ||
| from tempfile import TemporaryDirectory |
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.
avoid inline imports unless they're needed for specific reasons
scripts/app-release/chore-release.py
Outdated
| with TemporaryDirectory() as tmpdir: | ||
| tmp_path = Path(tmpdir) | ||
| run_command( | ||
| ["git", "clone", "--origin", "origin", clone_url, "tmp-opentrons"], |
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.
| ["git", "clone", "--origin", "origin", clone_url, "tmp-opentrons"], | |
| ["git", "clone", clone_url, "tmp-opentrons"], |
uses the default origin name anyway
scripts/app-release/chore-release.py
Outdated
| tmp_path = Path(tmpdir) | ||
| run_command( | ||
| ["git", "clone", "--origin", "origin", clone_url, "tmp-opentrons"], | ||
| cwd=tmp_path, |
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.
rather than using the subprocess cwd argument, let's use the git -C argument:
-C <path>
Run as if git was started in <path> instead of the current working directory. When
multiple -C options are given, each subsequent non-absolute -C <path> is interpreted
relative to the preceding -C <path>. If <path> is present but empty, e.g. -C "", then
the current working directory is left unchanged.
This option affects options that expect path name like --git-dir and --work-tree in
that their interpretations of the path names would be made relative to the working
directory caused by the -C option. For example the following invocations are
equivalent:
git --git-dir=a.git --work-tree=b -C c status
git --git-dir=c/a.git --work-tree=c/b status
scripts/app-release/chore-release.py
Outdated
| ) | ||
| repo_path = tmp_path / "tmp-opentrons" | ||
|
|
||
| branches_raw = run_command( |
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.
you can do this task ("find the highest-versioned chore_release-* branch") with the command git ls-remote, which can be given a url and then doesn't need to be run from a repo, i.e. git ls-remote https://github.com/opentrons/opentrons.git can be run from anywhere. This can't do its own filtering, but you're in a python script anyway so python can do it. That avoids a full clone here.
scripts/app-release/chore-release.py
Outdated
| print("=" * 60) | ||
|
|
||
| run_command( | ||
| ["git", "clone", "--origin", "origin", repo["clone_url"], str(target_dir)] |
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.
don't need --origin origin, that's default. also, since we now know the branch we want, we can add "-b", branch_name and "--shallow" to make the clone process much much faster
| parser = argparse.ArgumentParser( | ||
| description="Automated multi-repo alpha release tagging script." | ||
| ) | ||
| parser.add_argument( |
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.
let's set the working directory (CLEAN_DIR) with an argument so you can override it if you want, and then pass it around as a parameter rather than keeping it as a global
feat: Add
chore-releaseandinternal-releasescripts for automated taggingThis PR introduces two new Python scripts to automate our release tagging process across multiple repositories:
chore-release:ot3-firmware,buildroot,oe-core, andopentronsfor alpha releases.chore_release-X.Y.Zbranch from theopentronsrepository and prompts for user confirmation.--dry-runoption to simulate tagging without making actual changes.internal-release:ot3-firmware,buildroot,oe-core, andopentronsfor internal releases.edgeforopentrons,mainforot3-firmwareandoe-core,opentrons-developforbuildroot).8.8.0) which is converted to an internal version (e.g.,2.8.0).opentronsrepository's existing tags for the given version.internal@v23,internal@2.8.0-alpha.0, andot3@2.8.0-alpha.0.--dry-runoption that efficiently fetches only remote tags (without cloning) to show proposed tags.These scripts aim to streamline our release workflow, reduce manual errors, and ensure consistent tagging across our repositories