-
Notifications
You must be signed in to change notification settings - Fork 5
(#819) Github CI workflow to pin dependencies and populate release notes with dodal/nexgen version #1097
(#819) Github CI workflow to pin dependencies and populate release notes with dodal/nexgen version #1097
Conversation
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.
Logically I think this looks OK, but I have some thoughts:
- Could we have some unit tests for the functions in
pin_versions.py
- I think there are some easier ways to do a lot of the functions in this script. Eg use re.sub to remove git hashes from a line, without worrying about removing the whole line and remembering comments.
- Are we able to get the release notes to say whether or not dodal/nexgen have changed versions?
- Is there a way to combine this with the original workflow, so we can do both at once?
f56b6d3
to
14da16a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1097 +/- ##
=======================================
Coverage 92.88% 92.88%
=======================================
Files 65 65
Lines 3316 3316
=======================================
Hits 3080 3080
Misses 236 236 ☔ View full report in Codecov by Sentry. |
I've added some unit tests. They don't run from CI but can be run manually.
Whilst I probably could have used regular expressions to handle comments, I decided not to. Even with REs there would still be all this "remembering" of comments unless you want them stripped out of the output files. A lot of the parsing in here is fairly context-sensitive as only some of the lines in setup.cfg need to be processed, so the main processing loop doesn't use REs. If the file structure wasn't section-based I probably would have done something in Also, it turned out that as it needs to be processed twice, (once to unpin, once to pin) better to factor it out into lots of small methods.
Maybe, but suspect that would be more fiddly - as we'd need to check out the setup.cfg from the last tagged version, parse it and extract the versions. Also the workflow would need an extra input or we'd have to assume the version format.
Maybe but it isn't clear from the github documentation - the github |
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.
OK, I think this seems sensible. As we discussed, it would eventually be nice to include this in the same workflow as the hyperion release, but we can leave it like this for now, since then it remains optional + we can make sure it works properly. If adding the tests to CI is too fiddly then I guess it doesn't matter too much, probably not worth spending ages trying to figure that out. I will approve once we've figured out the failing unit tests
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.
Looks good, potential for some follow up issues (tests in CI, combining workflows, linking release notes for other dependencies)
…Source/819_add_dodal_and_nexgen_version_to_release_notes (DiamondLightSource/hyperion#819) Initial attempt at github workflow to pin versions
Fixes #819
This workflow does the following:
pins all our direct dependencies in
setup.cfg
underinstall_requires
by:pip freeze
to extract the latest package versions, and attaches these to all the dependenciesAs doing an ordinary GH release requires you to specify a git commit ref beforehand, I've implemented this as a separate workflow which you should run before doing the GH release, that accepts the tagname, then you do a GH release as normal using this tag
It needs the GH workflow token to have permissions to do a push to main branch
Indirect dependencies aren't pinned
I've tested it as far as I can locally - using
act
as described here https://github.com/DiamondLightSource/hyperion/wiki/Running-github-workflows-locally