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 22 commits intoEESSI:mainfrom
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:
|
|
Discussed in support meeting. One issue came up - though it doesn't affect this specific PR, nor the CI checks in it. The issue is related to how we might use the commit_sha introduced in this PR to make the bot refuse to deploy. The rationale is: if a bot has tarballs with a
I'm not yet sure how to avoid this. It is not possible to retain Note that I don't think we should hold off the current PR: it's a first step that'll provide us with the ability to build in |
|
Ok, just did a brainstorm with @bedroge . What we want is this:
To get to this stage, we need the following:
|
|
I wonder what kind of problem this PR is trying to solve (didn't find some kind of problem description or issue related to this PR):
To me the changes suggested are substantial (not so much in this PR itself, but particularly for bot commands). I would be reluctant to do these changes (now) if they address a mostly convenience type of issue. Besides all the necessary changes in software-layer-scripts and eessi-bot-software-layer, would this PR mean that one has to change the commit_sha every time software-layer-scripts contents change? |
|
All of the above ;-)
Yes. If you need a newer version of |
| # This workflow verifies that the correct version of software-layer-scripts is used. | ||
| # | ||
| # First, check_bot_build_checksums checks if the bot/build.sh code that clones software-layer-scripts is untouched, | ||
| # as this normally shouldn't change (a change could mean a contributor is trying to inject something |
There was a problem hiding this comment.
This should be toned down, changing the bot/build.sh script doesn't necessarily imply that something malicious is going on.
It's weird/unusual, sure, but let's not brand every possible change to bot/build.sh script as malicious up front
There was a problem hiding this comment.
It's especially ironic that this very PR is also making changes to bot/build.sh ;-)
| with: | ||
| fetch-depth: 1 # We only need the current revision to read bot/commit_sha | ||
| - name: Checkout software-layer-scripts (full history) | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
This should also use specific commit, as above
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: EESSI/software-layer-scripts | ||
| path: upstream-scripts |
There was a problem hiding this comment.
Why make it difficult, just call this EESSI-software-layer-scripts ?
| TOPDIR=$(dirname $(realpath $0)) | ||
|
|
||
| # Clone a the commit from software-layer-script that corresponds to `bot/commit_sha` | ||
| commit_sha=$(cat ${TOPDIR}/commit_sha) |
There was a problem hiding this comment.
Please rename this file so it's clear from the filename what this refers to:
| commit_sha=$(cat ${TOPDIR}/commit_sha) | |
| software_layer_scripts_commit=$(cat ${TOPDIR}/software_layer_scripts_commit) |
This is the critical point for me: as long as the approach we're taking here doesn't affect most contributors, it's OK imho. And I would say that's indeed the case here: only if you need updated hooks (or other scripts), you need to take action. I like the approach being proposed here, as it removes a great deal of uncertainty: no more guessing which commit of the scripts was used, it's crystal clear. I wouldn't hurt to make We should also update our docs to reflect these changes, with a specific subsection that outlines the procedure if changes to hooks are required. |
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.