Skip to content

ci: Harden CI, signed-commit on maintainers, non-regression on next, workspace inheritance#2999

Merged
huitseeker merged 9 commits into
nextfrom
huitseeker/ci/harden-ci
Apr 17, 2026
Merged

ci: Harden CI, signed-commit on maintainers, non-regression on next, workspace inheritance#2999
huitseeker merged 9 commits into
nextfrom
huitseeker/ci/harden-ci

Conversation

@huitseeker
Copy link
Copy Markdown
Collaborator

@huitseeker huitseeker commented Apr 13, 2026

Tightens the repo’s GitHub Actions setup and keeps current workflow behavior the same (mostly).

  • The Blake3 non-regression workflow now runs on pushes to next as well as main.
  • The CI hardening pins external actions and reusable workflows to commit SHAs, sets persist-credentials: false on checkout steps, and narrows write permissions to the jobs that need them.
  • A new zizmor workflow checks GitHub Actions changes. It is configured to allow the two pull_request_target workflows that need to comment on PRs.
  • a new cargo-workspace-inheritance-check ensures versioning doesn't drift between crates and workspace.
  • The workspace release action now installs cargo-msrv at a fixed version with --locked.
  • The signed-commit check now applies only to PR authors who already have write-level access to the repo.
  • Removes the duplicated changelog check.

@huitseeker huitseeker added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Apr 13, 2026
@huitseeker huitseeker changed the title Harden CI workflows, run and run Blake3 non-regression on next Harden CI workflows, run signed-commit on maintainers, and run Blake3 non-regression on next Apr 13, 2026
@huitseeker huitseeker changed the title Harden CI workflows, run signed-commit on maintainers, and run Blake3 non-regression on next Harden CI workflows, run signed-commit on maintainers, run Blake3 non-regression on next Apr 13, 2026
@huitseeker huitseeker force-pushed the huitseeker/ci/harden-ci branch from 3aff3f5 to d19e65c Compare April 13, 2026 21:08
@huitseeker huitseeker changed the title Harden CI workflows, run signed-commit on maintainers, run Blake3 non-regression on next ci: Harden CI workflows, run signed-commit on maintainers, run Blake3 non-regression on next Apr 13, 2026
@huitseeker huitseeker changed the title ci: Harden CI workflows, run signed-commit on maintainers, run Blake3 non-regression on next ci: Harden CI, signed-commit on maintainers, non-regression on next, workspace inheritance Apr 14, 2026
@huitseeker huitseeker force-pushed the huitseeker/ci/harden-ci branch 4 times, most recently from 43dca03 to 838e2ad Compare April 15, 2026 10:58
Comment thread Cargo.toml Outdated
predicates = "3.1"
pretty_assertions = { version = "1.4", default-features = false }
proc-macro2 = "1.0"
pubgrub = "0.3"
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.

It sort of looks like this got overly aggressive about promoting deps to workspace level - I'd only promote when there are multiple crates in the workspace with the same dependency, but this seems to promote if even one crate has a dependency, e.g. pubgrub

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Does something bad happen if all versioning info is managed in the workspace's Cargo.toml?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We do something similar in the node to prevent the dependency from "escaping".

For example, we create some wrapper crate and it and only it should ever have the wrapped dependency. Having it be in the workspace root de facto marks it as being available for use at large.

Copy link
Copy Markdown
Collaborator Author

@huitseeker huitseeker Apr 16, 2026

Choose a reason for hiding this comment

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

Having it be in the workspace root de facto marks it as being available for use at large.

I misunderstand what you're suggesting. There's no hard mechanism that I know of that a dependency being in a workspace root makes it "available", you still need to write down the dependency at the crate in a source change. Its version is the only thing which arguably has a specification shorthand.

You both seem that to culturally indicate a minimalistic convention for the inheritance check, i.e. you should be a workspace dependency if and only if used by >1 crate (IOW a --promotion-threshold 2 in the tool). I'd rather not bother with the "only if" but I care about the "if" being done, so I'll implement your additional restriction, LMK if I didn't get it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

you still need to write down the dependency in a source change.

Yes, I'm just noting how we've informally used it to indicate a "global" vs "local" dependency. Its not enforceable or enforced in any way.

However, it is easier to overlook a dep_xxx = { workspace = true } addition than the dep_xxx = "a.b.c", or if adding it triggers CI to suggest making the (now) shared dep as a workspace dep. Its simply used as a marker.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't need an absolute >1 requirement, I'm just saying sometimes we do currently isolate a dependency to a single crate for specific reasons that are not enforceable except as a convention of sorts.

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.

For me it is about making it clear whether a dependency is actually used by the whole workspace, or just by a specific crate - when everything is at the workspace level, it is a lot less clear.

@huitseeker huitseeker requested review from Mirko-von-Leipzig and mmagician and removed request for bobbinth April 16, 2026 08:05
Comment on lines +22 to +24
- name: Resolve author permission
id: perm
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd maybe comment why we need this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Because it's a gigantic PITA to trigger this signed-commits check only on maintainers (as decided in the last all-hands meeting): Github's roles are overly broad since the majority of us do not get our repo permissions through a role on the repo, but through a team permission derived from the org instead. This probe fetches the write permissions that the PR's author has on the repo, ignoring the repo-wide role entirely, and reliably detecting who should be bugged about signing their commits..

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I do agree; I mean in the yml itself so one knows why we're doing this "weird thing"

@huitseeker huitseeker force-pushed the huitseeker/ci/harden-ci branch from 1f162d7 to 88e65bd Compare April 16, 2026 12:38
@huitseeker
Copy link
Copy Markdown
Collaborator Author

re: CI failure, go stamp 0xMiden/.github#14 :)

@huitseeker huitseeker force-pushed the huitseeker/ci/harden-ci branch from 88e65bd to be7ec48 Compare April 16, 2026 15:56
Copy link
Copy Markdown
Contributor

@Al-Kindi-0 Al-Kindi-0 left a comment

Choose a reason for hiding this comment

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

LGTM

@huitseeker huitseeker force-pushed the huitseeker/ci/harden-ci branch from be7ec48 to 39136c1 Compare April 17, 2026 08:14
@huitseeker huitseeker force-pushed the huitseeker/ci/harden-ci branch from aec8733 to 8832c54 Compare April 17, 2026 08:20
@huitseeker huitseeker merged commit 94a7957 into next Apr 17, 2026
23 checks passed
@huitseeker huitseeker deleted the huitseeker/ci/harden-ci branch April 17, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants