Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: olexii4 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1656 (linux/amd64, linux/arm64, linux/s390x) kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1656", name: che-dashboard}]}}]" |
1 similar comment
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1656 (linux/amd64, linux/arm64, linux/s390x) kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1656", name: che-dashboard}]}}]" |
|
/retest |
|
@SkorikSergey please validate |
|
@olexii4 hello, still can reproduce this issue with https://github.com/prabhuk25/PublicRepo repo. But works well with our test githup repos. The only difference I see - metadata name. In prabhuk25 repo it is |
|
@olexii4 also there is e2e tests regression - after setting url to |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1656 (linux/amd64, linux/arm64, linux/s390x) kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1656", name: che-dashboard}]}}]" |
…mGit CreateNewIfExistingField.componentDidMount unconditionally overwrote Navigation.pageState with false, resetting the global "Create New" switch even when the user had it ON. Additionally, CreateNewIfExistSwitch never pushed its default true value to Navigation.pageState, so the field always saw undefined and replaced it with false. Fix: CreateNewIfExistSwitch now initialises Navigation.pageState on mount (when not yet set). CreateNewIfExistingField now adopts the existing global state on mount instead of overwriting it, so the ?new param reaches the factory URL and policies.create=perclick is set. Fixes: https://redhat.atlassian.net/browse/CRW-12731 Assisted-by: Claude Sonnet 4.6 Signed-off-by: Oleksii Orel <oorel@redhat.com>
Rewrite CreateNewIfExistingField/__tests__/index.spec.tsx — the file was testing TemporaryStorageField instead of CreateNewIfExistingField. Added four tests covering all componentDidMount branches: adopt global state, no-op when state matches, write local to global when undefined, and subscription response. Use act() for out-of-band state triggers. Simplify componentDidMount to delegate to handleChange() rather than duplicating its setState + props.onChange logic inline. Add a comment to the CreateNewIfExistSwitch test assertion explaining that the switch actively writes its initial value to pageState on mount. Assisted-by: Claude Sonnet 4.6 Signed-off-by: Oleksii Orel <oorel@redhat.com>
…xistingField The spec file in this directory was previously testing TemporaryStorageField and had written two snapshots. Now that the file correctly tests CreateNewIfExistingField (which has no snapshots), the stale snapshot file causes CI to fail with exit code 1 due to obsolete snapshots. Assisted-by: Claude Sonnet 4.6 Signed-off-by: Oleksii Orel <oorel@redhat.com>
componentDidMount called onChange(true) on mount, encoding ?new into the location URL. buildFactoryLoaderPath then stripped it back out, leaving the input showing "url?new" while the factory url param had only "url" — the E2E CreateWorkspaceWithExistingNameFromGitUrl test saw this as a partial URL mismatch. Fix: componentDidMount now adopts the global switch state silently (setState only, no onChange). ImportFromGit.startFactory() reads Navigation.pageState at click-time to inject ?new when the switch is ON. Also fix componentDidUpdate to compare raw props instead of undefined||false, which was overwriting the silently adopted state. Assisted-by: Claude Sonnet 4.6 Signed-off-by: Oleksii Orel <oorel@redhat.com>
The name-conflict lookup at Apply/Devfile step compared the raw devfile
metadata.name (e.g. "Devspaces-Public-repo") against already-created
workspace names that had gone through sanitizeName() and are lowercase
("devspaces-public-repo"). The case-sensitive mismatch always returned
nameConflict=false, so appendSuffix was never set and prepareDevfile()
produced the same unsuffixed sanitized name, causing Kubernetes to
reject the creation with a 409 Conflict.
Fix: sanitize the candidate name with sanitizeName() before the
allWorkspaces lookup so uppercase devfile names are normalised to the
same form as the existing workspace names.
Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1656 (linux/amd64, linux/arm64, linux/s390x) kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1656", name: che-dashboard}]}}]" |
1 similar comment
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1656 (linux/amd64, linux/arm64, linux/s390x) kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1656", name: che-dashboard}]}}]" |
|
@SkorikSergey fixed. The regression had two cooperating causes. Root cause:
Also, Fix:
Could you check again with https://github.com/prabhuk25/PublicRepo? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1656 +/- ##
==========================================
- Coverage 92.45% 92.44% -0.01%
==========================================
Files 609 609
Lines 63850 63877 +27
Branches 5011 5017 +6
==========================================
+ Hits 59031 59054 +23
- Misses 4754 4758 +4
Partials 65 65 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

What does this PR do?
Fixes the "Create New" switch being silently reset to OFF when a user enters a URL in the Import from Git field, causing a second workspace from the same repository URL to redirect to the existing one instead of creating a new one.
Root Cause
Two cooperating bugs caused the switch to reset every time a valid Git URL was typed.
1.
CreateNewIfExistSwitchnever wrote its initial state toNavigation.pageState.CreateNewIfExistSwitch.componentDidMountcalledprops.onChange(true)(propagating the default ON state to the samples list), but it never setNavigation.pageState[CREATE_NEW_IF_EXIST_SWITCH_ID]. The static store stayed at{ isChecked: undefined }.2.
CreateNewIfExistingField.componentDidMountunconditionally overwroteNavigation.pageStatewithfalse.When the URL field validated successfully,
RepoOptionsAccordionmounted, which in turn mounted the hiddenCreateNewIfExistingField. ItscomponentDidMountran:Because
Navigation.pageStatewasundefined(bug 1), this write was never blocked. The setter broadcastfalseto all subscribers, includingCreateNewIfExistSwitch, which flipped the visible switch to OFF and calledhandleCreateNewIfExistChange(false). The URL never received the?newquery param, so the factory loader usedpolicies.create=peruser, andCheckExistingWorkspacessilently redirected to the existing workspace.Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
fixes https://redhat.atlassian.net/browse/CRW-12731
Is it tested? How?
https://github.com/che-incubator/quarkus-api-example) and click Create & Open. Workspace A is created.Release Notes
Fixed an issue where creating a second workspace from the same Git repository URL would reopen the existing workspace instead of creating a new one.
Docs PR
N/A