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

feat: auto-refresh checksums #2573

Merged
merged 9 commits into from Dec 6, 2021
Merged

feat: auto-refresh checksums #2573

merged 9 commits into from Dec 6, 2021

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Oct 12, 2021

This allows checksums to be "refreshed" at will.

The idea is, for instance, if your signing config replaces the original binary, you could have a config like this:

signs:
# replaces the archives with signed ones
- cmd: something
  args: ["etc"]
  artifacts: archive
# refresh the checksums and sign with cosign
- cmd: cosign
  stdin: '{{ .Env.COSIGN_PWD }}'
  args: ["sign-blob", "-key=cosign.key", "-output=${signature}", "${artifact}"]
  artifacts: checksum

The pre-requisite is to sign the checksum as well to trigger the refresh. Maybe we can refresh it always in the end anyway?

So, this now actually refreshes the checksums once the sign pipe finishes... which means that the checksums should always be up to date.

closes #1802

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 12, 2021
@caarlos0 caarlos0 added this to In progress in Board Oct 12, 2021
@codecov
Copy link

codecov bot commented Oct 12, 2021

Codecov Report

Merging #2573 (67bb7f0) into main (f9687b4) will increase coverage by 0.05%.
The diff coverage is 95.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2573      +/-   ##
==========================================
+ Coverage   84.90%   84.95%   +0.05%     
==========================================
  Files         105      105              
  Lines        7901     7951      +50     
==========================================
+ Hits         6708     6755      +47     
- Misses        978      980       +2     
- Partials      215      216       +1     
Impacted Files Coverage Δ
internal/pipe/sign/sign.go 96.87% <72.72%> (-1.48%) ⬇️
internal/artifact/artifact.go 98.59% <100.00%> (+0.23%) ⬆️
internal/pipe/blob/upload.go 77.30% <100.00%> (-0.28%) ⬇️
internal/pipe/checksums/checksums.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9687b4...67bb7f0. Read the comment docs.

wagoodman added a commit to anchore/homebrew-syft that referenced this pull request Oct 17, 2021
wagoodman added a commit to anchore/homebrew-syft that referenced this pull request Oct 17, 2021
Workaround for goreleaser bug goreleaser/goreleaser#2573

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
luhring pushed a commit to anchore/homebrew-syft that referenced this pull request Oct 17, 2021
Workaround for goreleaser bug goreleaser/goreleaser#2573

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@vercel vercel bot temporarily deployed to Preview December 4, 2021 17:26 Inactive
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@vercel vercel bot temporarily deployed to Preview December 4, 2021 17:31 Inactive
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@vercel vercel bot temporarily deployed to Preview December 4, 2021 17:45 Inactive
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@vercel vercel bot temporarily deployed to Preview December 4, 2021 17:55 Inactive
@caarlos0 caarlos0 changed the title fix: refresh checksums feat: auto-refresh checksums Dec 4, 2021
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@vercel vercel bot temporarily deployed to Preview December 4, 2021 18:05 Inactive
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@vercel vercel bot temporarily deployed to Preview December 4, 2021 18:19 Inactive
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@vercel vercel bot temporarily deployed to Preview December 6, 2021 01:21 Inactive
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@vercel vercel bot temporarily deployed to Preview December 6, 2021 01:25 Inactive
@caarlos0 caarlos0 merged commit cbcdd41 into main Dec 6, 2021
@caarlos0 caarlos0 deleted the refresher branch December 6, 2021 01:42
@github-actions github-actions bot added this to the v1.2.0 milestone Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
No open projects
Board
In progress
Development

Successfully merging this pull request may close these issues.

Problems with signing artifacts in-place
1 participant