Skip to content

Conversation

@AliSoftware
Copy link
Contributor

@AliSoftware AliSoftware commented Nov 15, 2025

What?

This PR adds bin/git-crypt helper which is a wrapper to call git-crypt via docker.

  • Since the files in this plugin's bin/ are added at the end of $PATH, this means that if git-crypt is pre-installed in the agent your job runs (e.g. if we ever include it in our Mac agents or custom AMIs), that pre-installed git-crypt will take priority over that helper provided by the ci-toolkit.
  • Only if git-crypt is not available elsewhere in the path will calling git-crypt be resolved to this helper at the end of the $PATH, which will wrap the call in docker run appropriately

Added git-crypt/* files and WIP

This PR also adds git-crypt/Dockerfile and its accompanying git-crypt/README.md to rebuild the docker image when necessary and document the process.

Currently this Dockerfile is used to docker build the docker image on demand every time, because that docker image hasn't been pushed to a registry yet.

🚧 In a future commit we shall make the CI build and push the docker image to our AWS ECR public registry (then update docker_image variable in the script to point to it), so that the image is not rebuild from scratch on every job.

TODO

  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary.

As well as Dockerfile to build the image

(In a future commit we shall make the CI push the docker image on our AWS ECR public registry and point to it instead of building it locally)
And fix path used in git filters to rely on $PATH resolution so that it works in both situations of being needed by git from inside and outside the container
@dangermattic
Copy link

1 Warning
⚠️ Please add an entry in the CHANGELOG.md file to describe the changes made by this PR
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

And remove `auto-unlock` magic command after all, because if we end up pre-installing `git-crypt` on our CI agents (Mac machines, custom AMIs…) and put it at the head of `$PATH` and would take priority (as the helpers from this Buildkite plugin are added at the tail of $PATH), we won't risk client repos that were previously calling `git-crypt auto-unlock` from that helper would suddenly fail.
Comment on lines +7 to +9
Indeed, while `git-crypt` is easy to install on macOS platforms via a simple `brew install git-crypt`, it is not always as easy to install on all other platforms:
- While some Linux distributions may have versions of `git-crypt` available via `yum install`/`dnf install`/`apk add`/…, they might not always have the latest version.
- Support for `git-crypt` on Windows platforms is at its infancy, less tested and harder to compile on that platform to begin with.
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation 👍

@AliSoftware AliSoftware changed the title Add git-crypt-unlock helper Add git-crypt wrapper Nov 17, 2025
@AliSoftware
Copy link
Contributor Author

I believe the test failure on CI is unrelated to this PR and might instead be related to our recent changes to those scripts, or how the test tries to source those scripts for testing (especially as ./bin is not in the $PATH when we run the function under test in a testing context).

@mokagio Care to take a look to fix that unrelated part (in a separate PR)?

@iangmaia iangmaia mentioned this pull request Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants