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

Implement editors/devfile route #1134

Merged
merged 4 commits into from
Jun 26, 2024
Merged

Implement editors/devfile route #1134

merged 4 commits into from
Jun 26, 2024

Conversation

dkwon17
Copy link
Contributor

@dkwon17 dkwon17 commented Jun 18, 2024

What does this PR do?

This PR adds a new route exposed by the dashboard backend:
image

What issues does this PR fix or reference?

eclipse-che/che#22994

Is it tested? How?

When testing on Eclipse Che, access the following link and verify that the che-code/latest devfile is returned:

<CHE-HOST>/dashboard/api/editors/devfile?che-editor=che-incubator/che-code/latest

If no che-editor query param is provided, then there is a 400 error:

<CHE-HOST>/dashboard/api/editors/devfile?che-editor=che-incubator/che-code/latest

If there is not editor with id che-editor, there is a 404 error:

<CHE-HOST>/dashboard/api/editors/devfile?che-editor=doesnotexist

Additionally, create this following devworkspace and verify that the workspace starts and verify that you can access the editor:

kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: my-devworkspace
spec:
  routingClass: che
  started: true
  contributions:
    - name: ide
      uri: http://che-dashboard.eclipse-che.svc.cluster.local:8080/dashboard/api/editors/devfile?che-editor=che-incubator/che-code/latest
  template:
    projects:
      - name: my-project-name
        git:
          remotes:
            origin: https://github.com/eclipse-che/che-docs
    components:
      - name: tooling-container
        container:
          image: quay.io/devfile/universal-developer-image:ubi8-latest

Release Notes

Docs PR

@che-bot
Copy link
Contributor

che-bot commented Jun 18, 2024

Click here to review and test in web IDE: Contribute

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

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.59%. Comparing base (28abf62) to head (64cb29d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1134      +/-   ##
==========================================
- Coverage   89.61%   89.59%   -0.03%     
==========================================
  Files         411      411              
  Lines       41920    41982      +62     
  Branches     2809     2824      +15     
==========================================
+ Hits        37566    37613      +47     
- Misses       4329     4343      +14     
- Partials       25       26       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ibuziuk ibuziuk left a comment

Choose a reason for hiding this comment

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

@dkwon17 great job. Are the custom editors going to be exposed as well if configured ?
eclipse-che/che-docs#2738

@dkwon17
Copy link
Contributor Author

dkwon17 commented Jun 19, 2024

@ibuziuk thank you, yes, custom editors are also exposed and are accessible from the new endpoint

Copy link
Member

@ibuziuk ibuziuk left a comment

Choose a reason for hiding this comment

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

LGTM, but it seems there is a linting error that should be fixed via yarn lint:fix

Signed-off-by: dkwon17 <dakwon@redhat.com>
Signed-off-by: dkwon17 <dakwon@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Jun 20, 2024
@dkwon17 dkwon17 added the made-with-che Changes were made using Che label Jun 20, 2024
Copy link

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

kubectl patch command
kubectl 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-1134", name: che-dashboard}]}}]"

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

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

kubectl patch command
kubectl 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-1134", name: che-dashboard}]}}]"

} as IShhKeysApi,
} as DevWorkspaceClient;
}
export const getDevWorkspaceClient = jest.fn(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was done in order to provide certain mock implementations for certain tests:

(getDevWorkspaceClient as jest.Mock).mockImplementation(() => {

@ibuziuk
Copy link
Member

ibuziuk commented Jun 21, 2024

dkwon17 added a commit to dkwon17/che-docs that referenced this pull request Jun 21, 2024
dkwon17 added a commit to dkwon17/che-docs that referenced this pull request Jun 21, 2024
dkwon17 added a commit to dkwon17/che-docs that referenced this pull request Jun 21, 2024
dkwon17 added a commit to dkwon17/che-docs that referenced this pull request Jun 21, 2024
@dkwon17
Copy link
Contributor Author

dkwon17 commented Jun 21, 2024

@ibuziuk here is the docs PR: eclipse-che/che-docs#2747

@openshift-ci openshift-ci bot added the lgtm label Jun 25, 2024
Copy link

openshift-ci bot commented Jun 25, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 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
Copy link
Member

ibuziuk commented Jun 26, 2024

@dkwon17 I believe we are good to merge together withhttps://github.com/eclipse-che/che-docs/pull/2747

@ibuziuk ibuziuk merged commit 5e1ba62 into main Jun 26, 2024
17 of 18 checks passed
@ibuziuk ibuziuk deleted the getEditor branch June 26, 2024 13:08
ibuziuk pushed a commit to eclipse-che/che-docs that referenced this pull request Jun 26, 2024
* feat: accessing editor devfile from dashboard url

For eclipse-che/che-dashboard#1134

Signed-off-by: dkwon17 <dakwon@redhat.com>

* Update editor links

Signed-off-by: dkwon17 <dakwon@redhat.com>

---------

Signed-off-by: dkwon17 <dakwon@redhat.com>
@devstudio-release
Copy link

Build 3.15 :: dashboard_3.x/501: Console, Changes, Git Data

@devstudio-release
Copy link

@devstudio-release
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm made-with-che Changes were made using Che
Projects
None yet
5 participants