Skip to content

Comments

BUGFIX(versioned module directory detection): differentiate between networking issues and missing go.mod#327

Open
inteon wants to merge 2 commits intogoogle:masterfrom
inteon:bugfix_versioned_module_directory
Open

BUGFIX(versioned module directory detection): differentiate between networking issues and missing go.mod#327
inteon wants to merge 2 commits intogoogle:masterfrom
inteon:bugfix_versioned_module_directory

Conversation

@inteon
Copy link
Contributor

@inteon inteon commented May 4, 2025

go-licenses report in sometimes returns a different output:

-github.com/evanphx/json-patch/v5,https://github.com/evanphx/json-patch/blob/v5.9.11/v5/LICENSE,BSD-3-Clause
+github.com/evanphx/json-patch/v5,https://github.com/evanphx/json-patch/blob/v5.9.11/LICENSE,BSD-3-Clause

This was caused by a networking issue/ unstable connection that causes the go.mod retrieval to fail, resulting in the versioned module directory detection logic thinking the go.mod file does not exist.

This PR updates the logic to differentiate between networking errors and errors due to a missing go.mod.
If we encounter a networking issue, we stop go-licenses, such that the user does not unknowingly gets an invalid/ non-reproducible output.

XRef: cert-manager/cert-manager#6622

@inteon inteon force-pushed the bugfix_versioned_module_directory branch 2 times, most recently from 85ad7d9 to 9d3106d Compare May 4, 2025 09:26
@inteon inteon changed the title BUGFIX(versioned module directory detection): differenciate between networking issues and go.mod being missing BUGFIX(versioned module directory detection): differentiate between networking issues and go.mod being missing May 4, 2025
@inteon inteon force-pushed the bugfix_versioned_module_directory branch from 9d3106d to bd3fae4 Compare May 4, 2025 09:27
@inteon inteon changed the title BUGFIX(versioned module directory detection): differentiate between networking issues and go.mod being missing BUGFIX(versioned module directory detection): differentiate between networking issues and missing go.mod May 4, 2025
@inteon inteon force-pushed the bugfix_versioned_module_directory branch 2 times, most recently from 5fe0dfb to 0d1338e Compare May 4, 2025 10:27
@inteon
Copy link
Contributor Author

inteon commented May 5, 2025

@Bobgy could you take a look at this PR?
This will improve the stability of cert-manager's pipelines that rely on the go-licenses tool.

inteon added 2 commits June 11, 2025 03:35
…etworking issues and go.mod being missing

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
@inteon inteon force-pushed the bugfix_versioned_module_directory branch 2 times, most recently from 7884ca2 to ed43e23 Compare June 16, 2025 20:43
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.

1 participant