Repository navigation
CCM-24467: Implement Mise and Prek - #174
Open
jamesthompson26-nhs wants to merge 3 commits into
Open
jamesthompson26-nhs wants to merge 3 commits into
jamesthompson26-nhs wants to merge 3 commits into
Conversation
aidenvaines-cgi
approved these changes
Oct 23, 2026
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
CCM-24467: Replace asdf with mise and pre-commit with prek.
mise.tomlpinning the CLI tools previously in.tool-versions;pre-commitis replaced byprek.mise.lockwith checksums for 73 platform entries. Installs run withMISE_LOCKED=1so they are verified against it.mise.toml: asdf and vfox plugins are disabled, andminimum_release_age = "7d"ignores newly published releases..docker-versions;docker.lib.shreads this file instead of.tool-versions..tool-versionsis deleted.asdf-vm/actions/setupwithjdx/mise-actionv4.3.0 (pinned to a SHA). Version outputs incicd-1-pull-request.yamlandcicd-3-deploy.yamlare read frommise.toml, andstage-2-test.yamlpassesnode-versionexplicitly.make githooks-confignow runsprek install --force, so existing clones replace the oldpre-commitgit hook.init.mk,terraform.mk,terraform.sh,style.sh,postcreatecommand.sh, the README,AGENTS.md, the sync/ignore configs and the Vale accept list to use mise and prek.MISE_LOCKED=1 mise installandmise exec -- prek run --config scripts/config/pre-commit.yamlpass. CI workflow changes have not been run.Local setup for developers
Install mise using the instructions for your operating system. On macOS with Homebrew:
Keep asdf installed while you work in repositories that have not migrated. For zsh, add mise activation to
~/.zshrc:Restart the terminal, change to this repository, then configure the pinned tools and git hooks:
The repository’s
mise.tomldefines tool versions, andmise.lockrecords download URLs and checksums. Themake configinstall uses locked mode to verify tools against that lockfile.To switch between version managers in a zsh session, you can add this optional function to
~/.zshrc:Run the configured hooks manually at any time with:
After changing to a repository, run
activate misefor a migrated repo oractivate asdffor a legacy repo. Confirm which tool is selected withwhich nodeornode --version. The function only affects the current terminal and is not installed by this repository.The devcontainer setup installs a pinned mise release and runs
make configautomatically.brew uninstall asdforrm -rf ~/.asdf), and uninstall the Pythonpre-commitpackage if you installed it separately.If a tool is not found outside the repo, run it through mise with
mise exec -- <command>.When updating a tool version, change it in
mise.tomland runmise lockto refreshmise.lock; commit both files.Context
asdf plugins run arbitrary code and do not verify what they download, which exposes us to transitive dependency supply-chain attacks. mise provides lockfile checksums, a release age cooldown and no plugin execution.
lint-terraformpin stays at 6.0.5 and must be bumped to 7.0.0 once the nhs-notify-shared-modules PR is released. Until then that job will not work correctly, as the old action still runs asdf.postcreatecommand.sh"installs a pinned mise release verified by SHA-256 checksum".pythonpin is kept for the sharedpython_versionworkflow input, although the template has no Python code.mise.toml,mise.lockand the workflows together on sync, and developers will need to follow the local setup steps above.Dependency on nhs-notify-shared-modules
This PR depends on NHSDigital/nhs-notify-shared-modules#342, which migrates the shared-modules
lint-terraformaction, hooks and scripts from asdf to mise. Until it is released, thelint-terraformjob in this PR will not work correctly, aslint-terraform@6.0.5still runs asdf.Steps required before this PR can merge:
mise.tomlandmise.lock.NHSDigital/nhs-notify-shared-modules/...@6.0.5pin in.githubto7.0.0.revinscripts/config/pre-commit.yamlfrom6.0.0to7.0.0. The 7.0.0 hooks read Docker image versions from.docker-versions; the older hooks look for the deleted.tool-versions.To test before the release exists, temporarily pin
lint-terraformto the commit SHA of the shared-modules PR branch, then revert it to7.0.0before merging.Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.