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

fix: remotes url parameter in factory url #938

Merged
merged 2 commits into from
Oct 4, 2023
Merged

Conversation

dkwon17
Copy link
Contributor

@dkwon17 dkwon17 commented Sep 29, 2023

What does this PR do?

Fixes eclipse-che/che#22530 by allowing redirect to workspace creation page when window.location.hash contains the following characters: {, }, and ,.

See:

const hash = window.location.hash.replace(/(\/?)#(\/?)/, '');
if (FactoryLocationAdapter.isHttpLocation(hash) || FactoryLocationAdapter.isSshLocation(hash)) {
// project url found, redirect to the workspaces creation page
window.location.href = window.location.origin + '/dashboard' + buildFactoryLoaderPath(hash);
return;
}

What issues does this PR fix or reference?

eclipse-che/che#22530

Is it tested? How?

  1. Deploy Eclipse Che, and set the following in the Che CR to test out this PR:
spec:
  components:
    dashboard:
      deployment:
        containers:
          - image: quay.io/dkwon17/che-dashboard:fixRemotesUrlParam
  1. Access the following url to start a new workspace:
{che-host}/#https://github.com/dkwon17/quarkus-api-example?remotes={https://github.com/che-incubator/quarkus-api-example}

and verify that the resulting dev workspace has the following:

    projects:
      - git:
          checkoutFrom:
            remote: origin
          remotes:
            origin: 'https://github.com/che-incubator/quarkus-api-example'
        name: quarkus-api-example
  1. Access the following url to start a new workspace:
{che-host}/#https://github.com/eclipse-che/che-plugin-registry?remotes={{origin,https://github.com/dkwon17/che-plugin-registry},{upstream,https://github.com/eclipse-che/che-plugin-registry}}

and verify that the resulting dev workspace has the following:

    projects:
      - git:
          checkoutFrom:
            remote: origin
          remotes:
            origin: 'https://github.com/dkwon17/che-plugin-registry'
            upstream: 'https://github.com/eclipse-che/che-plugin-registry'
        name: che-plugin-registry

Release Notes

Docs PR

Signed-off-by: David Kwon <dakwon@redhat.com>
@che-bot
Copy link
Contributor

che-bot commented Sep 29, 2023

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-938

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Merging #938 (e49d3b3) into main (333d6cf) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #938   +/-   ##
=======================================
  Coverage   82.59%   82.59%           
=======================================
  Files         365      365           
  Lines       37941    37941           
  Branches     2414     2414           
=======================================
  Hits        31338    31338           
  Misses       6579     6579           
  Partials       24       24           
Flag Coverage Δ
unittests 82.59% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...end/src/services/factory-location-adapter/index.ts 100.00% <100.00%> (ø)

Signed-off-by: David Kwon <dakwon@redhat.com>
@dkwon17 dkwon17 force-pushed the fixRemotesUrlParam branch from 55b6e1b to e49d3b3 Compare October 2, 2023 18:38
Copy link
Contributor

@akurinnoy akurinnoy left a comment

Choose a reason for hiding this comment

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

LGTM

@ibuziuk
Copy link
Member

ibuziuk commented Oct 3, 2023

/retest

@openshift-ci
Copy link

openshift-ci bot commented Oct 3, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akurinnoy, dkwon17, ibuziuk, olexii4

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ibuziuk ibuziuk requested a review from ScrewTSW October 3, 2023 13:36
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-938

@ScrewTSW
Copy link
Member

ScrewTSW commented Oct 4, 2023

Successfully verified against che:next

@ibuziuk ibuziuk merged commit 1002797 into main Oct 4, 2023
13 checks passed
@ibuziuk ibuziuk deleted the fixRemotesUrlParam branch October 4, 2023 14:24
@devstudio-release
Copy link

Build 3.10 :: dashboard_3.x/356: Console, Changes, Git Data

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.10 :: dashboard_3.x/356: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/4883 triggered

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.10 :: copyIIBsToQuay/1975: Console, Changes, Git Data

@devstudio-release
Copy link

Build 3.10 :: sync-to-downstream_3.x/4884: SUCCESS

Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/4704 triggered; /job/DS_CI/job/dsc_3.x triggered;

@devstudio-release
Copy link

Build 3.10 :: operator-bundle_3.x/2129: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/4884 triggered

@devstudio-release
Copy link

Build 3.10 :: dsc_3.x/1447: Console, Changes, Git Data

@devstudio-release
Copy link

Build 3.10 :: update-digests_3.x/4523: SUCCESS

Detected new images: rebuild operator-bundle
* dashboard; /DS_CI/operator-bundle_3.x/2129 triggered

@devstudio-release
Copy link

Build 3.10 :: dsc_3.x/1447: SUCCESS

3.10.0-CI

@devstudio-release
Copy link

Build 3.10 :: copyIIBsToQuay/1975: SUCCESS

3.10
arches = x86_64, s390x, ppc64le;
  * LATEST DS OPERATOR BUNDLE = <a href=https://quay.io/repository/devspaces/devspaces-operator-bundle?tab=tags>registry-proxy.engineering.redhat.com/rh-osbs/devspaces-operator-bundle:3.10-106
  * LATEST DWO OPERATOR BUNDLE = <a href=https://quay.io/repository/devworkspace/devworkspace-operator-bundle?tab=tags>registry-proxy.engineering.redhat.com/rh-osbs/devworkspace-operator-bundle:0.21-7
+ s390x-rhel8 IIB(s) copied:
  + quay.io/devspaces/iib:3.10-v4.14-589196-533291-s390x
  + quay.io/devspaces/iib:3.10-v4.14-s390x
  + quay.io/devspaces/iib:next-v4.14-s390x
  + quay.io/devspaces/iib:3.10-v4.13-589193-533286-s390x
  + quay.io/devspaces/iib:3.10-v4.13-s390x
  + quay.io/devspaces/iib:next-v4.13-s390x
  + quay.io/devspaces/iib:3.10-v4.12-589303-533281-s390x
  + quay.io/devspaces/iib:3.10-v4.12-s390x
  + quay.io/devspaces/iib:next-v4.12-s390x
  + quay.io/devspaces/iib:3.10-v4.11-589300-533277-s390x
  + quay.io/devspaces/iib:3.10-v4.11-s390x
  + quay.io/devspaces/iib:next-v4.11-s390x
+ ppc64le-rhel8 IIB(s) copied:
  + quay.io/devspaces/iib:3.10-v4.14-589196-533291-ppc64le
  + quay.io/devspaces/iib:3.10-v4.14-ppc64le
  + quay.io/devspaces/iib:next-v4.14-ppc64le
  + quay.io/devspaces/iib:3.10-v4.13-589193-533286-ppc64le
  + quay.io/devspaces/iib:3.10-v4.13-ppc64le
  + quay.io/devspaces/iib:next-v4.13-ppc64le
  + quay.io/devspaces/iib:3.10-v4.12-589303-533281-ppc64le
  + quay.io/devspaces/iib:3.10-v4.12-ppc64le
  + quay.io/devspaces/iib:next-v4.12-ppc64le
  + quay.io/devspaces/iib:3.10-v4.11-589300-533277-ppc64le
  + quay.io/devspaces/iib:3.10-v4.11-ppc64le
  + quay.io/devspaces/iib:next-v4.11-ppc64le
+ x86_64-rhel8 IIB(s) copied:
  + quay.io/devspaces/iib:3.10-v4.14-589196-533291-x86_64
  + quay.io/devspaces/iib:3.10-v4.14-x86_64
  + quay.io/devspaces/iib:next-v4.14-x86_64
  + quay.io/devspaces/iib:3.10-v4.13-589307-533286-x86_64
  + quay.io/devspaces/iib:3.10-v4.13-x86_64
  + quay.io/devspaces/iib:next-v4.13-x86_64
  + quay.io/devspaces/iib:3.10-v4.12-589303-533281-x86_64
  + quay.io/devspaces/iib:3.10-v4.12-x86_64
  + quay.io/devspaces/iib:next-v4.12-x86_64
  + quay.io/devspaces/iib:3.10-v4.11-589300-533277-x86_64
  + quay.io/devspaces/iib:3.10-v4.11-x86_64
  + quay.io/devspaces/iib:next-v4.11-x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remotes parameter in factory url is not working
7 participants