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

Cannot create a factory from repository (without devfile) that has uppercase characters in name #21338

Closed
Tracked by #21395
SkorikSergey opened this issue Apr 19, 2022 · 8 comments · Fixed by eclipse-che/che-dashboard#527
Assignees
Labels
area/factory/dashboard Issues related to factories frontend (che user dashboard side) area/factory/server Server side of factory implementation kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.

Comments

@SkorikSergey
Copy link
Contributor

SkorikSergey commented Apr 19, 2022

Describe the bug

Cannot create a factory from repository(without devfile) that has uppercase characters in name.
There are restrictions:
Unable to create devworkspace: DevWorkspace.workspace.devfile.io "TestRepo" is invalid: metadata.name: Invalid value: "TestRepo": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Che version

other (please specify in additional context)

Steps to reproduce

  1. Try to create a factory from repository(without devfile) that has uppercase characters in name, for example from this - https://github.com/SkorikSergey/TestRepo.

Expected behavior

Workspace created and started successfully.

Suggested behaviour change is that the factory / devworkspace engine will sanitize the input GH repo name to make it compliant with OCP naming rules.

Runtime

OpenShift

Screenshots

Selection_005

Installation method

OperatorHub

Environment

Linux

Eclipse Che Logs

No response

Additional context

Eclipse Che 7.47.0

@SkorikSergey SkorikSergey added kind/bug Outline of a bug - must adhere to the bug report template. team/controller labels Apr 19, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Apr 19, 2022
@nickboldt
Copy link
Contributor

Suggested behaviour change is that the factory / devworkspace engine will sanitize the input GH repo name to make it compliant with OCP naming rules.

@nickboldt
Copy link
Contributor

nickboldt commented Apr 19, 2022

Also fails in dogfood cluster:

Dashboard Version 7.43.0-next
Server Version 7.47.0-SNAPSHOT
Username nickboldt
Browser Name chrome
Browser Version 100.0.4896
Browser OS Linux

image

image

Failed to create a workspace. 
Failed to create a new workspace from the devfile, reason: 
Failed to create a new workspace. Unable to create devworkspace: 
DevWorkspace.workspace.devfile.io "TestRepo" is invalid: metadata.name: 
Invalid value: "TestRepo": a lowercase RFC 1123 subdomain must consist of lower case 
alphanumeric characters, '-' or '.', and must start and end with an alphanumeric 
character (e.g. 'example.com', regex used for validation 
is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

@artaleks9
Copy link
Contributor

artaleks9 commented Apr 19, 2022

Also this bug can be reproduced if customer devfile has ver. 1.0 and metadata with name in uppercase, e.g.

apiVersion: 1.0.0
metadata:
  name: testName

In this case we'll get the same error.
After fix the problem should check also this test case.

@dkwon17 dkwon17 added severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Apr 19, 2022
@dmytro-ndp dmytro-ndp changed the title Cannot create a factory from repository(without devfile) that has uppercase characters in name Cannot create a factory from repository (without devfile) that has uppercase characters in name Apr 19, 2022
@nickboldt
Copy link
Contributor

@SkorikSergey what happens with accented characters? Do we sanitize those already? Or break when French or Spanish or Arabic characters are used?

@SkorikSergey
Copy link
Contributor Author

@nickboldt It is not possible to create repo with Arabic characters. And also with characters like ä, ö, ü.

@ibuziuk
Copy link
Member

ibuziuk commented Apr 20, 2022

@l0rd wdyt should the fix be part of 3.0 ?

@l0rd
Copy link
Contributor

l0rd commented Apr 20, 2022

This is not a blocker because it's a corner case: there is no devfile, the repo name has uppercase letters. But if it's an easy fix and there is no risk to postpone the release let's include that.

@ibuziuk ibuziuk added severity/P1 Has a major impact to usage or development of the system. area/factory/server Server side of factory implementation area/factory/dashboard Issues related to factories frontend (che user dashboard side) and removed severity/P2 Has a minor but important impact to the usage or development of the system. labels May 18, 2022
@ibuziuk ibuziuk mentioned this issue May 18, 2022
49 tasks
@olexii4 olexii4 self-assigned this May 19, 2022
@ibuziuk
Copy link
Member

ibuziuk commented May 25, 2022

Fixed in eclipse-che/che-dashboard#527

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/factory/dashboard Issues related to factories frontend (che user dashboard side) area/factory/server Server side of factory implementation kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants