Skip to content
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

Rules now read from AGENIX_RULES/agenix-rules.nix #210

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

giorgiga
Copy link

As discussed in #204, this switches from $RULES/secrets.nix to $AGENIX_RULES/agenix-rules.nix.

@giorgiga
Copy link
Author

giorgiga commented Oct 14, 2023

I didn't add integration tests or update the existing ones, because I don't fully understand how they work... @ryantm, can you provide some guidance?

I run the tests interactively and saw that /tmp is setup with secrets and a rules file, but grep -r secrets.nix test/ prints nothing and I don't get how the test environment is setup.

(also, I just realised I've missed a bunch of references to secrets.nix - will fix that later) done

@giorgiga
Copy link
Author

giorgiga commented Oct 15, 2023

It just occurred to me that I didn't mention I introduced another change besides changing RULES to AGENIX_RULES and secrets.nix to agenix-rules.nix: instead of just looking for agenix-rules.nix in the current directory, with this PR agenix also looks for the rules file in parents directories.

This is is implemented using readlink -f, which works with GNU readlink, busybox and whatever readlink macos currently uses, but does not work in macos prior to 12.3 (Monterey, released in 2021) and could possibly still not work in some BSD (I don't have BSDs at hand to check - I did find -f in the openBSD manpage for readlink however).

...and of course dirname "$cwd" is more straightforward and less problematic (ie: better™) than readlink -f "$cwd/.."... IDK why it didn't occur to me at the time :) I'm udating the PR again

@giorgiga
Copy link
Author

@ryantm this PR is intended to be ready for review - please instruct me if I'm missing something (let me be clear: it's no problem if the PR just stuck in the review queue and I don't intend to be pressuring anyone, I just wanna make sure I've submitted this properly)

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.

None yet

1 participant