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

artifacts: use git commit sha in name #17078

Merged
merged 1 commit into from Nov 5, 2021

Conversation

Habbie
Copy link
Contributor

@Habbie Habbie commented Nov 5, 2021

I removed the PR template because this is not a package update. This PR adds the commit hash to the artifact filenames (the packages and logs collections), so that downloads of those artifacts can be tracked back to the builds that generated them.

If you like this, here's an additional proposal: I add a small metadata file to each artifact collection, so that, once unpacked, a user can also see what branch, PR number, etc. generated this artifact.

Thoughts?

@BKPepe BKPepe requested a review from aparcar November 5, 2021 15:24
Signed-off-by: Peter van Dijk <peter.van.dijk@powerdns.com>
@aparcar
Copy link
Member

aparcar commented Nov 5, 2021

Sounds good to me, thanks!

@aparcar aparcar merged commit bbf9837 into openwrt:master Nov 5, 2021
@Habbie Habbie deleted the artifact-hashes branch November 5, 2021 19:42
@aparcar
Copy link
Member

aparcar commented Nov 6, 2021

Thinking about it again the Pull Request number could be more useful since the sha is nowhere really referenced, is it?

@Habbie
Copy link
Contributor Author

Habbie commented Nov 6, 2021

Yes, it's not the most useful - it is in fact the SHA of the merge commit so you need to go to GitHub to figure out what point in master and what point in a PRs evolution come together here.

A PR number, however, is not unique - people might push additional commits after seeing what comes out, rebase because something has been fixed on master, etc.. That's why I picked the merge commit SHA, it is the only thing that is perfectly unique and (somewhat indirectly) holds all the information, it's just not super convenient to use.

(Also, PR numbers might not be unique if people have private forks of openwrt/packages that they do work against.)

I experimented a bit with Python-pkginfo, which grabs PKG-INFO from inside a zip and conveniently exposes the contents - as simple as pkginfo x86_64-97fc916987c134295163039b6b0cf439c52f5fb2-packages.zip.

With that, my current suggestion would be that I PR support for putting that metadata in, and we keep the SHA naming, because it is unique.

Your thoughts are welcome, of course.

@Habbie
Copy link
Contributor Author

Habbie commented Nov 6, 2021

I pondered some more, and I do agree that making the collections easy to find per PR number makes sense. How about x86_64-PR17078-g97fc916-packages.zip? (g for "git hash", which I don't think has to be full size.)

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.

None yet

2 participants