Skip to content

Clone specific software-layer-commit and implement CI to check merged status - #1353

Merged
bedroge merged 39 commits into
EESSI:mainfrom
casparvl:improve_software_layer_scripts_workflow
Aug 21, 2026
Merged

Clone specific software-layer-commit and implement CI to check merged status#1353
bedroge merged 39 commits into
EESSI:mainfrom
casparvl:improve_software_layer_scripts_workflow

Conversation

@casparvl

@casparvl casparvl commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator

This PR is an initial step in creating a workflow where we can use PRs to software-layer-scripts directly, 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:

  1. bot/build.sh now clones a particular commit, which is specified in bot/commit_sha
  2. CI job Verify software-layer-scripts / check_bot_build_checksum verifies the checksum of bot/build.sh against a reference hardcoded in the workflow file. This way, a malicious contributor would have to modify both bot/build.sh and the workflow file, which would (hopefully) stand out to a reviewer.
  3. CI job Verify software-layer-scripts / check_software_layer_scripts_commit which check that bot/commit_sha is a commit that is part of the upstream https://github.com/EESSI/software-layer-scripts , is on the main branch (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_sha already (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.

@casparvl

Copy link
Copy Markdown
Collaborator Author

Let's do a small test build to see if the new build.sh works, i.e. if it correctly clones the software-layer-scripts repo from a given commit.

@casparvl

Copy link
Copy Markdown
Collaborator Author

Perfect. CI run on 2cd6082 shows

Commit c0a3ff09a3a38737af5a922fdf581aa7b2dd6c88 is NOT merged into origin/main.
Error: Process completed with exit code 1.

as expected, since this commit is on a feature branch but is not merged. Then, using a merge commit as in 6d954c4 the CI now passes.

@casparvl

Copy link
Copy Markdown
Collaborator Author

TODO: I guess in this same PR we should still add a check that verifies that the SHA-checksum of bot/build.sh itself has remained unchanged (there should be no reason to change it, since the sha-checksum is external to this file).

@casparvl

Copy link
Copy Markdown
Collaborator Author

Perfect. As expected, after changing the bot/build.sh in f1fdcca and fixing a typo in the workflow in c4b1f9a I get:

Computed checksum: bb805939ae22f3ca2e6fc85d13613aeb9b3fc81974a2e1ef3bfc85a7f3ae8a0f
Reference checksum: 9d33368cac2e38e10147eeb0aafc321651ebaa5912387ecef97683570906773a
ERROR: Checksum mismatch! The file bot/build.sh has been modified.

Changing the bot/build.sh back to it's original version in 0494884 and having the CI run on a subsequent merge commit 72fbb29 I now get

Computed checksum: 9d33368cac2e38e10147eeb0aafc321651ebaa5912387ecef97683570906773a
Reference checksum: 9d33368cac2e38e10147eeb0aafc321651ebaa5912387ecef97683570906773a
Checksum for bot/build.sh matches the reference value

@casparvl

Copy link
Copy Markdown
Collaborator Author

Ok, as expected, both Verify software-layer-scripts / check-bot_build_checksum and Verify software-layer-scripts / check_software_layer_scripts_commit pass on bce9bbc

Let's test again by changing the sha checksum...

@casparvl

Copy link
Copy Markdown
Collaborator Author

Ok, on bee1d29 we again have the expected failure:

Commit c0a3ff09a3a38737af5a922fdf581aa7b2dd6c88 is NOT merged into origin/main.
Error: Process completed with exit code 1.

Let's change the sha checksum back, and now change something in bot/build.sh to test the other CI job.

…f this causes the associated CI job to fail
@casparvl

Copy link
Copy Markdown
Collaborator Author

Again, we get the expected failure:

Computed checksum: 93705d4ae3517d9dfcac79d4e7a113e62977d9187b1af9bd4797c03367a9cdfb
Reference checksum: 9d33368cac2e38e10147eeb0aafc321651ebaa5912387ecef97683570906773a
ERROR: Checksum mismatch! The file bot/build.sh has been modified.
Error: Process completed with exit code 1.

…against the latest commit on EESSI/software-layer-scripts's main branch, to see if it points to the latest commit
@casparvl casparvl added the force-ci-checks Force missing software CI checks for a PR label Aug 5, 2026
@casparvl

casparvl commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

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.

@casparvl

casparvl commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

Excellent, CI https://github.com/EESSI/software-layer/actions/runs/31018815032/job/92349881283?pr=1353 goes red immediately, reporting:

ERROR: bot/software_layer_scripts_commit does not match the latest commit on main of EESSI/software-layer-scripts.
Stored commit:  83169938a52e22849226308cf3010e496f267430
Latest commit:  62b8e332fb041a9ba598dbed3ed781a3416407c0
Please update bot/software_layer_scripts_commit to 62b8e332fb041a9ba598dbed3ed781a3416407c0 and push the change.
Error: Process completed with exit code 1.

Now, let's move to an unmerged commit, check that our other CI also goes red in that case.

@casparvl

casparvl commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

Perfect, the other CI also fails https://github.com/EESSI/software-layer/actions/runs/31019123923/job/92350942842?pr=1353 with:

Commit 89e670f2336a610827ef899ecad520af78b0a848 is NOT merged into origin/main.

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
Comment thread .github/workflows/check_software_layer_scripts_commit.yml
Caspar van Leeuwen added 4 commits August 10, 2026 17:49
…. 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 bedroge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few tiny typos/suggestions

Comment thread .github/workflows/check_software_layer_scripts_commit.yml Outdated
Comment thread bot/build.sh Outdated
Comment thread .github/workflows/test_software_layer_scripts.yml Outdated
Co-authored-by: Bob Dröge <b.e.droge@rug.nl>
bedroge pushed a commit that referenced this pull request Aug 12, 2026
…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
Comment thread .github/workflows/check_software_layer_scripts_commit.yml Outdated
Comment thread .github/workflows/test_software_layer_scripts.yml Outdated

@bedroge bedroge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@bedroge
bedroge dismissed boegel’s stale review August 21, 2026 11:06

Rephrased that sentence.

@bedroge
bedroge merged commit 1f9bf0a into EESSI:main Aug 21, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

force-ci-checks Force missing software CI checks for a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants