Clone specific software-layer-commit and implement CI to check merged status - #1353
Clone specific software-layer-commit and implement CI to check merged status#1353casparvl wants to merge 38 commits into
Conversation
|
Let's do a small test build to see if the new |
|
TODO: I guess in this same PR we should still add a check that verifies that the SHA-checksum of |
…casparvl/software-layer into improve_software_layer_scripts_workflow
|
Perfect. As expected, after changing the
Changing the
|
|
Ok, as expected, both Let's test again by changing the sha checksum... |
|
Ok, on bee1d29 we again have the expected failure:
Let's change the sha checksum back, and now change something in |
…f this causes the associated CI job to fail
|
Again, we get the expected failure:
|
|
Made a PR for the bot to report the commit SHA of the |
|
TODO:
This means that if a PR changed One caveat: if someone forks, and doesn't sync with main, builds will happen with a somewhat older version of Note that even after the above TODO item is tackled, it is still the reviewers that are responsible for checking that they only set a deploy label after the CI "Verify software-layer-scripts / check_software_layer_scripts_commit" passes, as this ensures that the builds are done from a merged |
|
I thought about it some more, and maybe we can do better.
======= Create trigger on repo A (software-layer):
You’ll use these in repo B to start a pipeline in repo A. CI on repo B (software-layer-scripts): CI on repo A (software-layer) ======= The downside is that this requires tokens that have direct write access to your main branch. It should be possible to do this in a controlled way in the GH CI space (masked & protected tokens), but if that makes us uncomfortable, the alternative would be:
That solution only requires write tokens on feature branches. |
|
Some more interaction with my AI tells me that I need to use |
|
Ok, to avoid stalling this over discussion, let's phase the approach: First I'll implement:
This should be totally safe, and only requires the 2nd GH action to have write access to a dedicated feature branch which I'll call |
…against the latest commit on EESSI/software-layer-scripts's main branch, to see if it points to the latest commit
|
Perfect, https://github.com/EESSI/software-layer/actions/runs/31018598477/job/92349130424?pr=1353 goes green immediately (and takes only 6s to run). Let me change the checksum to an older merge commit. |
|
Excellent, CI https://github.com/EESSI/software-layer/actions/runs/31018815032/job/92349881283?pr=1353 goes red immediately, reporting: Now, let's move to an unmerged commit, check that our other CI also goes red in that case. |
|
Perfect, the other CI also fails https://github.com/EESSI/software-layer/actions/runs/31019123923/job/92350942842?pr=1353 with: Exactly as itended. This CI always runs, and provides reviewers with a red flag that this thing is NOT ready to deploy, as it's not pointing to a merge commit. |
…supported CPU targets for that EESSI version. If there is a checksum, it'll verify that all checksums are the same for all tarballs
…mplement this in a seperate PR EESSI#1564
…. We don't want to bother contributors who don't know about this file that they have to update stuff - for that we will create a seperate GH Action to automtically create PRs that update this. With this CI, we only ensure that contributors that DO change the commit, ensure that we don't merge an older commit into our software-layer/main branch (even if they built from an older one, which is totally fine)
bedroge
left a comment
There was a problem hiding this comment.
Few tiny typos/suggestions
Co-authored-by: Bob Dröge <b.e.droge@rug.nl>
…oftware_layer_scripts_commit file in place and a GH action to update it automatically. This file is, for now, unused, but it allows us to already test the auto-updating
This PR is an initial step in creating a workflow where we can use PRs to
software-layer-scriptsdirectly, and then once they are merged, just update the SHA checksum to a (Github-signed) merge commit, rebuild, and be done :)Edit: better description...
This PR contains three changes:
bot/build.shnow clones a particular commit, which is specified inbot/commit_shaVerify software-layer-scripts / check_bot_build_checksumverifies the checksum ofbot/build.shagainst a reference hardcoded in the workflow file. This way, a malicious contributor would have to modify bothbot/build.shand the workflow file, which would (hopefully) stand out to a reviewer.Verify software-layer-scripts / check_software_layer_scripts_commitwhich check thatbot/commit_shais a commit that is part of the upstream https://github.com/EESSI/software-layer-scripts , is on themainbranch (i.e. has been merged), is a merge commit, and is signed with the public Github GPG for the web interface.We might need to update the
commit_shaalready (not sure if there have been more merges to software-layer-scripts since I started this) before we merge this to make sure this PR doesn't actually revert us to using an older version.