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

factory will always use devfile generateName #14311

Merged
merged 2 commits into from
Aug 23, 2019
Merged

factory will always use devfile generateName #14311

merged 2 commits into from
Aug 23, 2019

Conversation

sparkoo
Copy link
Member

@sparkoo sparkoo commented Aug 22, 2019

Signed-off-by: Michal Vala mvala@redhat.com

What does this PR do?

Fixes possible workspace name collision when using factory with devfile. It takes generateName with precedence and converts name into generateName, when only name is defined. With this, we should always create uniquely named workspace that will have 5 random characters suffix.

  • When devfile has only name, it use it as generateName -> nameYYYYY
  • When devfile has only generateName, it uses that -> generateNameYYYY
  • When devfile has both name and generateName, it uses generateName -> generateNameYYYY
    (Y is random [0-9a-z] characted)

I've choosen to take generateName over name here, because there is higher chance that it would generate nicer name. If you have other opinion, please comment.

What issues does this PR fix or reference?

#13683

Release Notes

Docs PR

Signed-off-by: Michal Vala <mvala@redhat.com>
@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 Aug 22, 2019
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.

Copy link
Contributor

@metlos metlos left a comment

Choose a reason for hiding this comment

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

Nice way of fixing #13683!

@sparkoo
Copy link
Member Author

sparkoo commented Aug 22, 2019

Seems it should be modified as well

https://github.com/eclipse/che/blob/8d3cc8054a4ff13e5405400cbaf7221243399b33/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/URLFactoryBuilder.java#L154

It doesn't have to. The devfile naming is "fixed" later in the process. If you think it would be better, I'll modify it.

@che-bot
Copy link
Contributor

che-bot commented Aug 22, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

  • build details
  • "che-server" docker image: maxura/che-server:14311

@sleshchenko
Copy link
Member

sleshchenko commented Aug 22, 2019

It doesn't have to. The devfile naming is "fixed" later in the process.

I stared like a few minutes and did not manage to find where it will be fixed later.
BTW I think it would be more straightforward to set generateName right there instead of relying on name to generateName moving later. Or do you think there are props of moving these fields later?

Signed-off-by: Michal Vala <mvala@redhat.com>
@sparkoo
Copy link
Member Author

sparkoo commented Aug 22, 2019

It doesn't have to. The devfile naming is "fixed" later in the process.

I stared like a few minutes and did not manage to find where it will be fixed later.
BTW I think it would be more straightforward to set generateName right there instead of relying on name to generateName moving later. Or do you think there are props of moving these fields later?

you're right, it's not fixed later. I've missed that, twice :) Thanks for the catch. fixed

@che-bot
Copy link
Contributor

che-bot commented Aug 22, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

  • build details
  • "che-server" docker image: maxura/che-server:14311

@che-bot
Copy link
Contributor

che-bot commented Aug 22, 2019

Results of automated E2E tests of Eclipse Che Multiuser on OCP:
Build details
Test report
docker image: eclipseche/che-server:14311
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@che-bot
Copy link
Contributor

che-bot commented Aug 22, 2019

Results of automated E2E tests of Eclipse Che Multiuser on OCP:
Build details
Test report
docker image: eclipseche/che-server:14311
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

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.

LGTM

@sleshchenko sleshchenko merged commit 2b1830e into eclipse-che:master Aug 23, 2019
@sparkoo sparkoo deleted the factoryWsCreateNotFail branch August 23, 2019 07:54
@dmytro-ndp
Copy link
Contributor

ci-test

@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 Aug 23, 2019
@che-bot che-bot added this to the 7.1.0 milestone Aug 23, 2019
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.

5 participants