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: add support for checksum generation for extra files #2406

Merged

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Aug 17, 2021

Closes #1898

If applied, this commit will

  • add support for adding select files to the checksums file, similar to release extra_files

Why is this change being made?

Output of checksums tests:

ok  	github.com/goreleaser/goreleaser/internal/pipe/checksums	1.464s

@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 17, 2021
@vercel
Copy link

vercel bot commented Aug 17, 2021

@anGie44 is attempting to deploy a commit to the goreleaser Team on Vercel.

A member of the Team first needs to authorize it.

@anGie44 anGie44 changed the title add support for checksum generation for extra files feat: add support for checksum generation for extra files Aug 17, 2021
@anGie44 anGie44 force-pushed the f-checksum-generation-extra-files branch from d22c93c to 8516691 Compare August 17, 2021 00:29
@caarlos0
Copy link
Member

thanks!

@codecov
Copy link

codecov bot commented Aug 21, 2021

Codecov Report

Merging #2406 (aee046c) into master (f3f77c7) will decrease coverage by 0.06%.
The diff coverage is 53.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2406      +/-   ##
==========================================
- Coverage   82.89%   82.83%   -0.07%     
==========================================
  Files          83       83              
  Lines        6105     6118      +13     
==========================================
+ Hits         5061     5068       +7     
- Misses        892      896       +4     
- Partials      152      154       +2     
Impacted Files Coverage Δ
pkg/config/config.go 90.72% <ø> (ø)
internal/pipe/checksums/checksums.go 93.10% <53.84%> (-6.90%) ⬇️

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 f3f77c7...aee046c. Read the comment docs.

@caarlos0 caarlos0 added this to In progress in Board via automation Aug 23, 2021
Comment on lines +65 to +67
if _, err := os.Stat(path); os.IsNotExist(err) {
return fmt.Errorf("failed to checksum %s: %w", name, err)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check is not needed I think, the extrafiles.Find would guarantee the file exists...

Copy link
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a couple of comments, looks good to me overall, thanks for the pr and sorry for the late review...

@@ -55,6 +56,22 @@ func (Pipe) Run(ctx *context.Context) (err error) {
return nil
}

extraFiles, err := extrafiles.Find(ctx.Config.Checksum.ExtraFiles)
if err != nil {
return err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a test trying to add a path that don't exist so we cover this branch too?

@caarlos0 caarlos0 merged commit 9667216 into goreleaser:master Sep 2, 2021
Board automation moved this from In progress to Done Sep 2, 2021
@caarlos0
Copy link
Member

caarlos0 commented Sep 2, 2021

will fix comments in another commit

@caarlos0
Copy link
Member

caarlos0 commented Sep 2, 2021

thanks again for the PR :)

@anGie44
Copy link
Contributor Author

anGie44 commented Sep 6, 2021

Awesome, thanks @caarlos0 for following up on this work!

@anGie44 anGie44 deleted the f-checksum-generation-extra-files branch September 6, 2021 19:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
No open projects
Board
Done
Development

Successfully merging this pull request may close these issues.

Checksum generation for release extra files
2 participants