Read allowlist templates from correct path#2597
Merged
cptanalatriste merged 1 commit intoalan-turing-institute:developfrom Apr 30, 2026
Merged
Read allowlist templates from correct path#2597cptanalatriste merged 1 commit intoalan-turing-institute:developfrom
cptanalatriste merged 1 commit intoalan-turing-institute:developfrom
Conversation
The allowlist templates were being read from a path relative to the CWD. This meant that they would be correctly output, but only if the command was run from inside the root of the data-save-haven working directory. This updates the code to read the files correctly from the resource directory irrespective of the CWD. Fixes alan-turing-institute#2533
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
5 tasks
cptanalatriste
approved these changes
Apr 29, 2026
Contributor
cptanalatriste
left a comment
There was a problem hiding this comment.
Looks good to me!
Contributor
Author
|
Thanks for looking at this @cptanalatriste. Is one review enough to have this merged? If so, I'm not authorised to merge myself, would you mind please merging it for me? |
13d97bf
into
alan-turing-institute:develop
10 checks passed
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.
✅ Checklist
Enable foobar integrationrather than515 foobar).develop.🚦 Depends on
N/A.
The allowlist templates were being read from a path relative to the CWD. This meant that they would be correctly output, but only if the command was run from inside the root of the data-save-haven working directory. This updates the code to read the files correctly from the resource directory irrespective of the CWD.
🌂 Related issues
Closes #2533
🔬 Tests
Tested by running the following commands:
Previously the second call to
dshwould generate an error, but after this change it no longer does. I've also added a new unit test to perform roughly the same check (changes directory, requests template, restores directory). The test fails with previous versions of the code but passes after the changes here.I specifically chose this issue while I'm awaiting access to the dev SRE, because it only relies on code running locally (and it was an easy fix while I get familiar with the code and processes).