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

Copied in tls lib from ct-go and removed project dependency #2744

Merged
merged 2 commits into from
May 27, 2022

Conversation

mhutchinson
Copy link
Contributor

This fixes #2733

More changes than I'd like to go.{mod,sum} as a result of go mod tidy.

This fixes google#2733

More changes than I'd like to go.{mod,sum} as a result of `go mod tidy`.
@mhutchinson mhutchinson requested a review from a team as a code owner May 26, 2022 14:30
@mhutchinson mhutchinson merged commit 1364052 into google:master May 27, 2022
@mhutchinson mhutchinson deleted the ct-go-going-going-gone branch May 27, 2022 08:09
@pav-kv
Copy link
Contributor

pav-kv commented May 27, 2022

This code had tests, should they be added too?

@mhutchinson
Copy link
Contributor Author

This code had tests, should they be added too?

IMO it's wasted cycles running tests for code that must remain a direct copy of the tested code. There is no case where this code should not be a direct copy of the version in ct-go.

I did originally copy them across and backed out of it when I found the test referenced a greater surface area in the original repo. This meant either copying more stuff across to make the tests build, or else modifying the test file to remove cases that referenced this extra surface. Either route seemed like it was making the problem worse.

Copy link
Contributor

@pav-kv pav-kv left a comment

Choose a reason for hiding this comment

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

Tests are part of this code. Plus, having tests is a safety measure, in case the intent to have this code in sync is not fulfilled. I would argue that passing tests is one of the most worthwhile things to spend cycles on :D Far more cycles are spent on wrapping things in Docker and shipping them to some Cloud places.

Of the options that you mentioned, I would perhaps go with the refactoring approach. For example, those tests that require a larger surface could be factored out so that they wouldn't need to be copied.

An example of tests splitting: range_test.go and range_internal_test.go. This was done for a different reason though: avoiding circular dependencies.

Comment on lines -418 to -419
github.com/google/trillian v1.3.14-0.20210409160123-c5ea3abd4a41/go.mod h1:1dPv0CUjNQVFEDuAUFhZql16pw/VlPgaX8qj+g5pVzQ=
github.com/google/trillian v1.3.14-0.20210511103300-67b5f349eefa/go.mod h1:s4jO3Ai4NSvxucdvqUHON0bCqJyoya32eNw6XJwsmNc=
Copy link
Contributor

Choose a reason for hiding this comment

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

Win!

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.

Drop dependency from certificate-transparency-go
3 participants