-
Notifications
You must be signed in to change notification settings - Fork 20
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
[CERTTF-424] feat: support a reference directory for attachments #374
Conversation
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 looks fine to me, and I'm +1 on it but just one question...
Was attachments-relative-to-job-file specifically requested in addition to attachments-relative-to? It feels a bit overkill to have both. I mean... I get it, but I also feel like it's not that hard for the submitter to specify the dir where the attachments are if they are also already specifying the same dir in the path to the job file. Curious what your thoughts are about that and how critical it seemed to have both? I know you talked to Max about though, so perhaps there's something that I'm not considering.
The request by @Hook25 was specifically for something like I wouldn't say it's critical to have both but it feels like a shame to specify two arguments (the reference path and the job file) that would be almost identical if the job file is in the reference path. |
I don't think its critical to have both but setting them in CI is not super handy (quite the opposite actually) so to have a simple boolean it is way better for me. Also, I suggested this as the attachment mechansim attaching from the cwd is counterintuitive to me. I expected it (and I still think it should) be relative to the job file by default, as that is what most tools do when they get an input recipe |
I think that's a fair point that I hadn't considered appropriately before. Indeed, examples like HTML or LaTeX files interpret relative paths as relative to the location of the input file. @plars would you object to removing the |
I was kind of assuming it would be something like:
I suspect you're right that in practice, attachments will probably be in the same location as the job file most of the time. However I'm reluctant to change it from defaulting to CWD because:
If something like the above snippet doesn't work for just keeping |
@plars that's exactly how I approached it when I made the initial choice to use the CWD but I believe I was wrong (and that's the reason why I am insisting we should revert that choice and change the default behaviour). I believe this is not an issue of where a CLI program manipulates its own files, in which case using the CWD would indeed be the convention. This is a case of how relative links in the input file are interpreted. The best example of a similar example I can think of is HTML. Regardless of the browser you are using or the CWD, relative references in an HTML file are always interpreted in relation to the HTML file. And that makes a lot of sense for a myriad reasons there is no point in repeating. We need the additional flexibility here, i.e. we need the |
…b file Which makes the `--attachments-relative-to-job-file` argument redundant
aedefa4
to
771efb9
Compare
This has stagnated for a while so I thought I'd take the executive decision to:
|
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.
Looks good, thanks for the updates to the docs and the tests too! If "Mr Hook25" (@Hook25) is good with it, then let's merge it! :)
Description
At the moment, when Testflinger attachments are not specified through absolute path names (in the
local
field) they are interpreted relevant to the current working directory. This is quite restrictive and becomes an inconvenience especially when Testflinger jobs and their attachments are created in Github workflows and submitted through the Testflinger submit Github action.This PR:
--attachments-relative-to
command-line argument to the Testflinger CLI, for specifying the directory that relative attachment path names will be resolved against.submit
Github action, corresponding to the new command-line argumentResolved issues
Resolves CERTTF-424.
Tests
Changes to the Github
submit
action can only be tested once the updated Testflinger CLI snap has been deployed.