New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildkite: allow configuration and actual use of agent-specific hooks #32387
buildkite: allow configuration and actual use of agent-specific hooks #32387
Conversation
cc @domenkozar |
@@ -31,6 +31,14 @@ in | |||
''; | |||
}; | |||
|
|||
hooks-path = mkOption { | |||
type = types.str; | |||
default = "${pkgs.buildkite-agent}/share/hooks"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs also defaultText = "${pkgs.buildkite-agent}/share/hooks";
otherwise manual will depend on buildkite-agent package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
build-path="/var/lib/buildkite-agent/builds" | ||
bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh" | ||
EOF | ||
|
||
chmod +x ${cfg.hooks-path}/* 2>/dev/null || true # Guard against read-only paths. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes no sense, since cfg.hooks-path
is a read-only nix store path. Whoever provides the path should make sure scripts are executable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default does indeed point to a read-only store path -- but a different value might be used -- one pointing to a non-read-only location.
I've set the default to match the old value, although I agree that the old value doesn't make a lot of sense.
Do you have a better idea for the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deepfire the default is OK, but whoever provides the path should make sure it has correct permissions. The service should just consume it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -31,6 +31,14 @@ in | |||
''; | |||
}; | |||
|
|||
hooks-path = mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NixOS options are camelCase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you can see, the immediately following option is called meta-data
.
I erred on the side of following the particular author's naming convention.
Should it be ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta-data
should also be renamed, but that's out of scope for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenkozar, done
@jtojnar why was this closed? |
Sorry, accidentaly deleted |
72ca6d2
to
0f6f501
Compare
0f6f501
to
89d9ff6
Compare
@@ -31,6 +31,15 @@ in | |||
''; | |||
}; | |||
|
|||
hooksPath = mkOption { | |||
type = types.str; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be types.path
… hitting the store)
Merging as it doesn't change the default, but just makes it configurable. |
Motivation for this change
Allow actually using the agent hooks. As of now, the directory containing them is hard-configured to point to a fixed location in the Nix store, which is read-only.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)