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

i/ppa: Improve/Fix GPG tmp directory #258

Merged
merged 4 commits into from
Nov 13, 2024
Merged

i/ppa: Improve/Fix GPG tmp directory #258

merged 4 commits into from
Nov 13, 2024

Conversation

upils
Copy link
Collaborator

@upils upils commented Oct 17, 2024

Rework createTmpGPGDir so the temp dir provided to GPG is in the OS-chosen temp directory. This should very likely always be a short directory and so should not be an issue for the socket name used to communicate with dirmngr.

Also stop using deprecated --secret-keyring on gpg.

Closes: LP: #2057885
Fixes: FR-7372

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.68%. Comparing base (bb3a3fe) to head (4202894).
Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #258      +/-   ##
==========================================
- Coverage   93.96%   93.68%   -0.28%     
==========================================
  Files          18       18              
  Lines        3429     4371     +942     
==========================================
+ Hits         3222     4095     +873     
- Misses        133      205      +72     
+ Partials       74       71       -3     
Flag Coverage Δ
unittests 93.68% <100.00%> (-0.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@upils
Copy link
Collaborator Author

upils commented Oct 17, 2024

@AristoChen Feel free to take a look and even try it if you can.

@AristoChen
Copy link
Contributor

Thanks for letting me know! I will find some time to test, and may I know where can I download the snap built by the github CI?

@upils
Copy link
Collaborator Author

upils commented Oct 17, 2024

It's built in the "Tests" workflow. The current last run is https://github.com/canonical/ubuntu-image/actions/runs/11382537094

@AristoChen
Copy link
Contributor

tested with a path /home/vagrant/aristo/leuven/looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooon-dir/iot-image-builds, and I think the issue is fixed, thanks!

@AristoChen
Copy link
Contributor

Hi @upils

May I know when will you merge this PR? thanks!

Rework createTmpGPGDir so the temp dir provided to GPG is in the OS-chosen temp directory. This should very likely always be a short directory and so should not be an issue for the socket name used to communicate with dirmngr.

Also make sure we "hook" the call to os.MkdirTemp in tests so the temp dir is in fact created in the temp directory dedicated to the test (and cleaned up at the end). This *may* break if tests are run from of deep directory.

Fixes: LP: #2057885
Signed-off-by: Paul Mars <[email protected]>
Signed-off-by: Paul Mars <[email protected]>
Signed-off-by: Paul Mars <[email protected]>
@upils upils merged commit 88a371d into main Nov 13, 2024
17 of 21 checks passed
@upils upils deleted the tmp-gpg-dir branch November 13, 2024 10:39
@upils
Copy link
Collaborator Author

upils commented Nov 13, 2024

@AristoChen This is now merged. In a couple of hours you should be able to use the snap from latest/edge with the fix.

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.

2 participants