-
Notifications
You must be signed in to change notification settings - Fork 165
actions: run: Set postprocess working directory to artifact directory #433
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
base: main
Are you sure you want to change the base?
Conversation
|
Adding the reproducer (or variant thereof) as a test case would be great. |
be044e5 to
c71008f
Compare
c71008f to
c43257e
Compare
sjoerdsimons
left a comment
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.
We should really ensure this get exercised in at least one of the tests
|
@obbardc will you have to time to nudge this forward? the outstanding comments were quite small |
yes, I will be able to take a look at the beginning of March, along with my other outstanding PRs :-) |
c43257e to
c35d190
Compare
|
Not sure what test I can write for this. Other than a run action with postprocess confirming the artifact dir. Any ideas @sjoerdsimons @daissi ? |
I think that's it right? Just confirming the postprocess cwd matches what you'd expect ? e.g. by writing an artifact in an action and then checking you can access in a postprocessing step |
bb12b78 to
273b628
Compare
273b628 to
9bc87c5
Compare
|
@sjoerdsimons I've opened a new pull request, #617, to work on those changes. Once the pull request is ready, I'll request review from you. |
9bc87c5 to
e8a244b
Compare
|
@sjoerdsimons I've opened a new pull request, #618, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@sjoerdsimons I've opened a new pull request, #619, to work on those changes. Once the pull request is ready, I'll request review from you. |
7c878eb to
7d405ca
Compare
7d405ca to
0ac3a4e
Compare
0ac3a4e to
f4c7e4b
Compare
f4c7e4b to
1ea917f
Compare
jq is needed for some tests but is no longer installed since the container base image bump to trixie. Install jq. Signed-off-by: Christopher Obbard <[email protected]>
The partition UUIDs are not reproducible between runs; remove the UUIDs from the check such that any changes in the partition UUIDs don't cause the tests to fail. Signed-off-by: Christopher Obbard <[email protected]>
Currently Command.Dir is unsed; hook it up such that commands can have a working directory set. Signed-off-by: Christopher Obbard <[email protected]>
Currently any run action tagged as postprocess will be ran in the recipe directory. The artifacts are stored in this directory by default, unless --artifactdir is passed to Debos to change where the artifacts are stored. The run action documentation states: postprocess -- if set script or command is executed after all other commands and has access to the recipe directory ($RECIPEDIR) and the artifact directory ($ARTIFACTDIR). The working directory will be set to the artifact directory. But this is wrong; currently the working directory of postprocess commands is set to the recipe directory. Set the working directory to the artifact directory instead to allow postprocess commands to be ran in the correct location. Fixes: #345 Signed-off-by: Christopher Obbard <[email protected]>
1ea917f to
8993ee5
Compare
|
@sjoerdsimons added some fixes for the partitioning test; hope it's ok. Disabled auto merge so you can review before merging... Cheers! |
|
For some reason it fails as the image can't be found in artifactdir in CI (but of course it works locally). Added some test commits to check... hmm, in the CI run, |
Extend the partitioning test to enforce the expected working directory behaviour for postprocess actions. When a recipe is executed with an explicit --artifactdir, postprocess run actions should execute with: * cwd == $ARTIFACTDIR * $ARTIFACTDIR != $RECIPEDIR The test now checks all three conditions: * test.img exists in the current directory, * the working directory is $ARTIFACTDIR, * that $ARTIFACTDIR is different from $RECIPEDIR. This ensures correct isolation between recipe sources and build artifacts and catches regressions where postprocess commands incorrectly inherit the recipe directory as their working directory. Signed-off-by: Christopher Obbard <[email protected]>
3593662 to
fe0599f
Compare
OK, fixed it! |
Currently any run action tagged as postprocess will be ran in the recipe
directory. The artifacts are stored in this directory by default, unless
--artifactdir is passed to Debos to change where the artifacts are stored.
The run action documentation states:
postprocess -- if set script or command is executed after all other
commands and has access to the recipe directory ($RECIPEDIR) and the
artifact directory ($ARTIFACTDIR). The working directory will be set to
the artifact directory.
But this is wrong; currently the working directory of postprocess commands
is set to the recipe directory. Set the working directory to the artifact
directory instead to allow postprocess commands to be ran in the correct
location.
Fixes: #345
Closes: #617
Closes: #618
Closes: #619