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

Integration cannot be run from github with different branch #3475

Closed
mmajerni opened this issue Jul 21, 2022 · 4 comments · Fixed by #3489
Closed

Integration cannot be run from github with different branch #3475

mmajerni opened this issue Jul 21, 2022 · 4 comments · Fixed by #3489
Assignees
Labels
area/cli Kamel CLI good first issue Does not require full understanding of the codebase kind/bug Something isn't working

Comments

@mmajerni
Copy link
Contributor

Running integration from GitHub should work as:
kamel run github:$user/$repo/$path?branch=$branch
Command:
kamel run github:apache/camel-k/e2e/common/files/Java.java?branch=release-1.8.x
is not working and it returns an error:
Error: cannot read sources: cannot process file github:apache/camel-k/e2e/common/files/Java.java?branch=release-1.8.x: unsupported file type github:apache/camel-k/e2e/common/files/Java.java?branch=release-1.8.x

@squakez squakez added kind/bug Something isn't working area/cli Kamel CLI good first issue Does not require full understanding of the codebase labels Jul 21, 2022
@tadayosi
Copy link
Member

@mmajerni Running on a GH branch should rather be like this:

kamel run github:apache/camel-k/release-1.8.x/e2e/common/files/Java.java

See the e2e tests for more details:
https://github.com/apache/camel-k/blob/release-1.9.x/e2e/common/cli/run_test.go#L43

Is there anywhere that tells ?branch=release-1.8.x should work?

@tadayosi
Copy link
Member

OK, I tried that but doesn't work as well:

$ ./kamel run github:apache/camel-k/release-1.8.x/e2e/common/files/Java.java
Error: cannot read sources: cannot read sources: the provided URL https://raw.githubusercontent.com/apache/camel-k/master/release-1.8.x/e2e/common/files/Java.java is not reachable, error code is 404

Definitely there's something wrong with it.

@tadayosi
Copy link
Member

Looks like that test is silently failing, that's why we haven't noticed it. Related #3465

@mmajerni
Copy link
Contributor Author

Hi @tadayosi, I updated that test: https://github.com/apache/camel-k/pull/3438/files#diff-d618db0cd5368f9f7428e20a95fd07e6b62a1abd375a331ca74914dc10103821L43
Before, the main branch was used so it worked. I added the branch but it is not working as you mentioned.

Docs describe that if you want to specify a branch you need to specify the branch as a query parameter:
https://camel.apache.org/camel-k/1.8.x/running/run-from-github.html#_integration_code_stored_in_a_github_repository

Also you can see in the error code which you pasted that if you add branch to the URL (kamel run github:apache/camel-k/release-1.8.x/e2e/common/files/Java.java) it handles it as path not the branch and automatically set branch to master:
.../apache/camel-k/master/release-1.8.x/e2e/common/files/Java.java

There is definitely a problem. One of those commands should work:
kamel run github:apache/camel-k/e2e/common/files/Java.java?branch=release-1.8.x
kamel run github:apache/camel-k/release-1.8.x/e2e/common/files/Java.java

@tadayosi tadayosi self-assigned this Jul 26, 2022
tadayosi added a commit to tadayosi/camel-k that referenced this issue Jul 26, 2022
tadayosi added a commit to tadayosi/camel-k that referenced this issue Jul 26, 2022
tadayosi added a commit that referenced this issue Jul 27, 2022
tadayosi added a commit to tadayosi/camel-k that referenced this issue Jul 29, 2022
tadayosi added a commit to tadayosi/camel-k that referenced this issue Jul 29, 2022
tadayosi added a commit to tadayosi/camel-k that referenced this issue Aug 2, 2022
tadayosi added a commit to tadayosi/camel-k that referenced this issue Aug 2, 2022
tadayosi added a commit that referenced this issue Aug 7, 2022
tadayosi added a commit that referenced this issue Aug 7, 2022
squakez pushed a commit to jboss-fuse/camel-k that referenced this issue Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Kamel CLI good first issue Does not require full understanding of the codebase kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants