Skip to content

Conversation

@michalvavrik
Copy link
Contributor

Changes:

  • make the project cloning for the default branch shallow (depth 1 commit)
  • add option to checkout Git tag and test it
  • add option to checkout Git branch and test it
  • add option to checkout Git commit and test it (this is the least efficient of the 3 as it requires the full project history checkout)

Release Note

NONE

@michalvavrik
Copy link
Contributor Author

Sorry I didn't catch the validation failure, I tried to run the validation before but it failed for me:

mvavrik@fedora:~/sources/camel-k$ make lint
GOBIN=/home/mvavrik/sources/camel-k/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5
go: downloading github.com/tdakkota/asciicheck v0.4.0
../../go/pkg/mod/github.com/golangci/golangci-lint@v1.64.5/pkg/golinters/asciicheck/asciicheck.go:4:2: reading github.com/tdakkota/asciicheck/go.mod at revision v0.4.0: git ls-remote -q origin in /home/mvavrik/go/pkg/mod/cache/vcs/e91413ff76cb95901df8e2d834855d07c617befa58b5014bc6cd6fd1148034dd: exit status 128:
	/usr/bin/gh auth git-credential get: line 1: /usr/bin/gh: No such file or directory
	fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
make: *** [Makefile:742: golangci-lint] Error 1

I'll rewrite the if-else to the switch statement and look what the GH CI does when running validation so that I can check it prior pushing commit.

@michalvavrik
Copy link
Contributor Author

- Allows to select branch, tag or commit for Git source
- closes: apache#6135

Changes:

- make the project cloning for the default branch shallow (depth 1 commit)
- add option to checkout Git tag and test it
- add option to checkout Git branch and test it
- add option to checkout Git commit and test it (this is the least efficient of the 3 as it requires the full project history checkout)
@michalvavrik michalvavrik force-pushed the feature/integration-git-branch-opt branch from 8f49826 to be5a6e7 Compare September 8, 2025 12:44
@michalvavrik
Copy link
Contributor Author

Should be fixed, the make lint command is now passing for me. When I resolved git auth config issue, I kept getting:

mvavrik@fedora:~/sources/camel-k$ make lint
GOBIN=/home/mvavrik/sources/camel-k/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5
go: downloading github.com/tdakkota/asciicheck v0.4.0
../../go/pkg/mod/github.com/golangci/golangci-lint@v1.64.5/pkg/golinters/asciicheck/asciicheck.go:4:2: reading github.com/tdakkota/asciicheck/go.mod at revision v0.4.0: git ls-remote -q origin in /home/mvavrik/go/pkg/mod/cache/vcs/e91413ff76cb95901df8e2d834855d07c617befa58b5014bc6cd6fd1148034dd: exit status 128:
	ERROR: Repository not found.
	fatal: Could not read from remote repository.
	
	Please make sure you have the correct access rights
	and the repository exists.
make: *** [Makefile:742: golangci-lint] Error 1

so I had to resolve to:

curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /home/mvavrik/sources/camel-k/bin v1.64.5

and dropping GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(LINTER_VERSION).

At least now I have a motivation to look into #6122 so that I understand my issue better, it is most likely in my setup.

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

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

Nice stuff. Thanks for the contribution!

@squakez squakez merged commit f0493e2 into apache:main Sep 9, 2025
10 checks passed
@michalvavrik michalvavrik deleted the feature/integration-git-branch-opt branch September 9, 2025 12:22
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.

Integration git branch option

2 participants