Skip to content

Hash verification steps added #102

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

Merged
merged 8 commits into from
Aug 31, 2021

Conversation

offa
Copy link
Contributor

@offa offa commented Jun 15, 2021

Adds steps for file hash verification, which fail the build if the expected hash doesn't match the actual one.

Example

sha256Verify(file: 'f.txt', hash: 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')

To Do

  • Step naming ok?
  • Best suited exception type thrown on hash mismatch (Exception at the moment)?

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

fixed sha1Verify
@rsandell
Copy link
Member

It looks good. I leave it to you to decide if you want to use the AbortException instead, which I believe is a better choice.
Regarding the name, I'm ok as it is, maybe naming it the other way around would sound better, e.g. verifySha256. WDYT?

@offa
Copy link
Contributor Author

offa commented Aug 27, 2021

Regarding the name, I'm ok as it is, maybe naming it the other way around would sound better, e.g. verifySha256. WDYT?

I'm fine with both. But since verifySha… sounds more natural, it's a better choice I guess. 👍

@offa
Copy link
Contributor Author

offa commented Aug 27, 2021

PR updated and merged with master.

@rsandell rsandell merged commit d4d0bbc into jenkinsci:master Aug 31, 2021
@offa offa deleted the hash_verification_steps branch August 31, 2021 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants