fix(remote): deduplicate artifact names in remote-build success message - #1094
fix(remote): deduplicate artifact names in remote-build success message#1094kirtisingh05 wants to merge 7 commits into
Conversation
steinbro
left a comment
There was a problem hiding this comment.
This change would fix the visual quirk of duplicate filenames, but I'm concerned that it's masking a root cause. Why would historical builds be included in the data that's being fetched? Is the client downloading a bunch of paths to the same target unnecessarily? If so, are we sure that the resulting file left on disk is the most recent build?
Maybe @mr-cal knows if we need to adjust our Launchpad API calls to only fetch the artifact that resulted from this specific remote-build invocation..
|
Thanks for the review. you're right, this is masking the root cause rather than fixing it. The real issue is that |
mr-cal
left a comment
There was a problem hiding this comment.
Hi @kirtisingh05,
Thanks for the PR. I agree with @steinbro that filtering at the output is indeed masking a deeper problem and not the direction we should go. I've put some of my thoughts into the original issue into how this could be solved.
make lint && make test?docs/reference/changelog.rst)?Summary
When
remote-buildis run multiple times, Launchpad returns historicalbuilds with different URLs but the same output filenames. Since
artifact_downloadskeys on URL, duplicates slip through into.values(),causing the success message to list the same snap multiple times.
Fix
Deduplicate artifact names using a set comprehension before sorting:
Test
Added a regression test that mocks
fetch_artifactsto return duplicatefilenames and asserts each artifact appears only once in the success message.
Fixes #1093
Related: canonical/snapcraft#6230