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

Fix failure for removed GitHub release in golang dependencies of former version #583

Open
ckunki opened this issue Aug 16, 2024 · 0 comments
Labels
bug Unwanted / harmful behavior

Comments

@ckunki
Copy link
Collaborator

ckunki commented Aug 16, 2024

When running pk fix in a go project, then PK generates dependency changes.

PK retrieves the (go) dependencies of the previous version as denoted by the latest git tag and compares these to the current dependencies.

PK fails if the previous version was using a go dependency referring to a GitHub release, that has been removed.

See the following sample stack trace for project exasol-rest-api.
In this case, the dependency github.com/veraison/go-cose previously referred to version v1.2.0 that is no longer available on GitHub.

❯ pk fix 
Running .github/workflows/project-keeper.sh fix
Running Project Keeper 4.3.3 with mode fix from /home/chku/.m2/repository/com/exasol/project-keeper-cli/4.3.3/project-keeper-cli-4.3.3.jar
2024-08-16 09:05:03.012 [FINEST ] Executing command 'go list -f {{if not .Indirect}}{{.}}{{end}} -m all' in working dir '/home/chku/git/rest-api'... 
Exception in thread "main" java.lang.IllegalStateException: E-PK-CORE-157: 
Failed to list direct dependencies. Run 'go mod tidy' and try again.
	at com.exasol.projectkeeper.sources.analyze.golang.GolangServices.getModuleInfo(GolangServices.java:147)
	at com.exasol.projectkeeper.sources.analyze.golang.GolangSourceAnalyzer.analyzeSource(GolangSourceAnalyzer.java:42)
	at com.exasol.projectkeeper.sources.analyze.golang.GolangSourceAnalyzer.lambda$analyze$0(GolangSourceAnalyzer.java:36)
	at com.exasol.projectkeeper.sources.analyze.golang.GolangSourceAnalyzer.analyze(GolangSourceAnalyzer.java:36)
	at com.exasol.projectkeeper.sources.SourceAnalyzer.analyzeSources(SourceAnalyzer.java:68)
	at com.exasol.projectkeeper.sources.SourceAnalyzer.analyze(SourceAnalyzer.java:59)
	at com.exasol.projectkeeper.ProjectKeeper.phase2AnalyzeSources(ProjectKeeper.java:137)
	at com.exasol.projectkeeper.ProjectKeeper.runValidationPhases(ProjectKeeper.java:276)
	at com.exasol.projectkeeper.ProjectKeeper.fix(ProjectKeeper.java:260)
	at com.exasol.projectkeeper.cli.ProjectKeeperLauncher.runProjectKeeper(ProjectKeeperLauncher.java:73)
	at com.exasol.projectkeeper.cli.ProjectKeeperLauncher.start(ProjectKeeperLauncher.java:67)
	at com.exasol.projectkeeper.cli.ProjectKeeperLauncher.main(ProjectKeeperLauncher.java:61)
Caused by: java.lang.IllegalStateException: 
E-PK-CORE-126: Failed to run command 'go list -f {{if not .Indirect}}{{.}}{{end}} -m all' 
in '/home/chku/git/rest-api', exit code was 1 after PT0.43473546S. Output:
''
Error output:
'go: github.com/veraison/[email protected]: invalid version: unknown revision v1.2.0'
	at com.exasol.projectkeeper.sources.analyze.generic.SimpleProcess.waitUntilFinished(SimpleProcess.java:102)
	at com.exasol.projectkeeper.sources.analyze.golang.GolangServices.getModuleInfo(GolangServices.java:143)
	... 18 more
@ckunki ckunki added the bug Unwanted / harmful behavior label Aug 16, 2024
@ckunki ckunki changed the title Fix failure for removed git release in dependencies of former version Fix failure for removed git release in golang dependencies of former version Aug 16, 2024
ckunki added a commit to exasol/exasol-rest-api that referenced this issue Aug 16, 2024
PK fix currently fails due to exasol/project-keeper#583
@ckunki ckunki changed the title Fix failure for removed git release in golang dependencies of former version Fix failure for removed GitHub release in golang dependencies of former version Aug 16, 2024
ckunki added a commit to exasol/exasol-rest-api that referenced this issue Aug 19, 2024
* Updated dependencies
* PK fix currently fails due to exasol/project-keeper#583
* Fixed linter errors
* Moved linter execution after tests to ensure dependencies are available
* Updated go version to 1.22, 1.23

Co-authored-by: Christoph Pirkl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted / harmful behavior
Projects
None yet
Development

No branches or pull requests

1 participant