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

Allow using factories with gitub repositories with the default branch that is not equal to "master" #18066

Merged
merged 1 commit into from
Oct 12, 2020

Conversation

skabashnyuk
Copy link
Contributor

@skabashnyuk skabashnyuk commented Oct 7, 2020

What does this PR do?

Allow using factories with gitub repositories with the default branch that is not equal to "master"
To get a devfile content used @benoitf 's idea #18066 (comment)

Screenshot/screencast of this PR

Знімок екрана 2020-10-09 о 10 51 40
Знімок екрана 2020-10-09 о 10 53 41

What issues does this PR fix or reference?

Fixes #18044

How to test this PR?

Repo with default branch main

  • setup che with quay.io/skabashn/che-server:che18044 che server image
  • click on the link https://che-che.apps.cluster-17ef.17ef.example.opentlc.com/f?url=https://github.com/skabashnyuk/TestMainBranch.git
  • Expect result : Theia is able to clone https://github.com/dmytro-ndp/TestMainBranch.git with default branch main

Private or not existed GitHub repo

  • setup che with quay.io/skabashn/che-server:che18044 che server image
  • click on the link https://che-che.apps.cluster-17ef.17ef.example.opentlc.com//f?url=https://github.com/some/private.git
  • Expect result : Theia is trying to clone Github repo https://github.com/some/private.git

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@che-bot che-bot added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/bug Outline of a bug - must adhere to the bug report template. labels Oct 7, 2020
@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

Copy link
Member

@sleshchenko sleshchenko left a comment

Choose a reason for hiding this comment

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

Do we really need to evaluate the default branch here? Can't we just omit it?

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2020

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

ℹ️ Use comment "[crw-ci-test]" to rerun happy path E2E test.

@skabashnyuk
Copy link
Contributor Author

Do we really need to evaluate the default branch here? Can't we just omit it?

I'm afraid that is unlikely possible. we always (if the branch is not set) looking for a devfile in the root of the Github repository.

@SkorikSergey
Copy link
Contributor

[ci-test]

@che-bot
Copy link
Contributor

che-bot commented Oct 8, 2020

E2E tests of Eclipse Che Multiuser on OCP has failed:

Use command [ci-test] to rerun the test.

@che-bot
Copy link
Contributor

che-bot commented Oct 8, 2020

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

ℹ️ Use comment "[crw-ci-test]" to rerun happy path E2E test.

@sleshchenko
Copy link
Member

I did not take a look the code in details, I just saw a reported bug where there is no issue with devfile resolving but the resolved factory has initialized the main branch, which I assume we can omit and then theia just will do git clone and default branch will be used
Screenshot_20201008_103003

@skabashnyuk skabashnyuk marked this pull request as ready for review October 8, 2020 11:07
@skabashnyuk skabashnyuk requested review from mshaposhnik, sparkoo and metlos and removed request for nickboldt October 8, 2020 11:07
@che-bot
Copy link
Contributor

che-bot commented Oct 8, 2020

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

ℹ️ Use comment "[crw-ci-test]" to rerun happy path E2E test.

Copy link
Member

@sparkoo sparkoo left a comment

Choose a reason for hiding this comment

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

In general LGTM. Just some ideas to improvements and few questions.

@benoitf
Copy link
Contributor

benoitf commented Oct 8, 2020

Can't we simply use HEAD instead of master in github url ?

Like https://raw.githubusercontent.com/eclipse/che/HEAD/devfile.yaml

Or with a repo with main branch:
https://raw.githubusercontent.com/spring-projects/spring-petclinic/HEAD/pom.xml

And omit branch in devfile if not specified ( so git clone use default as well)

@sparkoo
Copy link
Member

sparkoo commented Oct 9, 2020

Can't we simply use HEAD instead of master in github url ?

Nice, that would be much simpler. But don't we need the exact branch name later anyway?

@che-bot
Copy link
Contributor

che-bot commented Oct 9, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@benoitf
Copy link
Contributor

benoitf commented Oct 9, 2020

@sparkoo : if it's not specified by the user, no as git clone operation will use what is configured by default
I think branch is only useful to retrieve the devfile with a raw URL

Using HEAD avoid the use of the API and its rate limit.

@skabashnyuk
Copy link
Contributor Author

Can't we simply use HEAD instead of master in github url ?

will take a look.

… that is not equal to master

Signed-off-by: Sergii Kabashniuk <skabashniuk@redhat.com>
@eclipse-che eclipse-che deleted a comment from che-bot Oct 9, 2020
@skabashnyuk
Copy link
Contributor Author

[crw-ci-test]

@che-bot
Copy link
Contributor

che-bot commented Oct 9, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@skabashnyuk skabashnyuk merged commit 25ddfb2 into eclipse-che:master Oct 12, 2020
@skabashnyuk skabashnyuk deleted the che18044 branch October 12, 2020 06:19
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Oct 12, 2020
@benoitf
Copy link
Contributor

benoitf commented Oct 12, 2020

I think this fix should be back-ported to 7.20.x as more and more ppl may face this issue in the near future
WDYT @mkuznyetsov @skabashnyuk ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eclipse Che couldn't clone repo with default 'main' branch
6 participants