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

Refactors out common Checksum concept #399

Merged
merged 1 commit into from Sep 27, 2022
Merged

Refactors out common Checksum concept #399

merged 1 commit into from Sep 27, 2022

Conversation

ryanmoran
Copy link
Member

Summary

We have some common code for splitting and comparing checksums across cargo and postal. This factors those pieces out into a common place.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@sophiewigmore
Copy link
Member

I can't comment on it directly for some reason, but there is a linting error in postal/service.go to remove function determineChecksum

@sophiewigmore
Copy link
Member

Also, this seems like a reasonable change but I wanted to point out that introducing the new Checksum type will be breaking for jam, since it uses the cargo.ConfigMetadataDependency internally

cargo/checksum_test.go Outdated Show resolved Hide resolved
cargo/validated_reader.go Outdated Show resolved Hide resolved
Copy link

@fg-j fg-j left a comment

Choose a reason for hiding this comment

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

A couple nitpicks/clarifications. But overall, LGTM!

@ryanmoran
Copy link
Member Author

I can't comment on it directly for some reason, but there is a linting error in postal/service.go to remove function determineChecksum

Good catch. I meant to remove this.

@ryanmoran
Copy link
Member Author

Also, this seems like a reasonable change but I wanted to point out that introducing the new Checksum type will be breaking for jam, since it uses the cargo.ConfigMetadataDependency internally

Ok. I rolled back the changes that might have been breaking. We still use Checksum internally and users can cast their checksum string to a Checksum to use its helper methods, so I still think this results in a cleaner implementation.

@ryanmoran ryanmoran added the semver:minor A change requiring a minor version bump label Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants