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: change the way the original devfile content is stored #1315

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

olexii4
Copy link
Contributor

@olexii4 olexii4 commented Feb 12, 2025

What does this PR do?

This PR fixed the devfile resolve flow and how the original devfile content is stored.

These changes bring several improvements:

  • Fixed a bug with showing the message 'Applying the default configuration'.
  • Provided the mechanism to show the original devfile content without additional changes.
  • Added field 'Git repo URL', which includes original repo with parameters.

Screenshot/screencast of this PR

Знімок екрана 2025-02-12 о 16 29 56

Знімок екрана 2025-02-12 о 16 27 27

Знімок екрана 2025-02-12 о 17 21 45

Знімок екрана 2025-02-13 о 16 46 50

What issues does this PR fix or reference?

fixes eclipse-che/che#23331

Is it tested? How?

Release Notes

Docs PR

@che-bot
Copy link
Contributor

che-bot commented Feb 12, 2025

Click here to review and test in web IDE: Contribute

Copy link

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

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-1315", name: che-dashboard}]}}]"

Copy link

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

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-1315", name: che-dashboard}]}}]"

@eclipse-che eclipse-che deleted a comment from codecov bot Feb 14, 2025
Copy link

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

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-1315", name: che-dashboard}]}}]"

@olexii4
Copy link
Contributor Author

olexii4 commented Feb 14, 2025

/test v14-e2e-puppeteer

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 86.94158% with 38 lines in your changes missing coverage. Please review.

Project coverage is 91.85%. Comparing base (f2e8000) to head (b2cc47c).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...ges/WorkspaceDetails/OverviewTab/GitRepo/index.tsx 86.57% 20 Missing ⚠️
...d-frontend/src/services/workspace-adapter/index.ts 36.84% 10 Missing and 2 partials ⚠️
...oard-frontend/src/store/FactoryResolver/actions.ts 80.00% 4 Missing ⚠️
...ard-frontend/src/services/devfileApi/typeguards.ts 66.66% 1 Missing ⚠️
...oard-frontend/src/store/FactoryResolver/helpers.ts 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1315      +/-   ##
==========================================
+ Coverage   91.65%   91.85%   +0.20%     
==========================================
  Files         500      501       +1     
  Lines       45489    45478      -11     
  Branches     3173     3186      +13     
==========================================
+ Hits        41691    41776      +85     
+ Misses       3766     3673      -93     
+ Partials       32       29       -3     

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

@dmytro-ndp
Copy link
Contributor

dmytro-ndp commented Feb 15, 2025

@olexii4 : hello
FYI:

See test details below:

Test scenario to check eclipse-che/che#23331 issue fix up:

  1. Install Eclipse Che Next with User Dashboard image quay.io/eclipse/che-dashboard:pr-1315
  2. Open User Dashboard
  3. Create workspace from URL https://gist.githubusercontent.com/ibuziuk/0a8d3896865577aa010847991d561112/raw/5a3c54d48cea3f04343d727b5ff6807d010bc5dd/devfile.yaml
  4. Review workspace's Devfile in User Dashboard.

Test result:

✅ The workspace itself was created using the correct devfile from the repository.
✅ There was correct Devfile content shown in User Dashboard:

schemaVersion: 2.3.0
metadata:
  name: ubi9-minimal-demo
components:
  - attributes:
      controller.devfile.io/merge-contribution: true
    name: tools
    container:
      image: registry.access.redhat.com/ubi9-minimal:9.3-1552@sha256:582e18f13291d7c686ec4e6e92d20b24c62ae0fc72767c46f30a69b1a6198055
      args:
        - tail
        - '-f'
        - /dev/null
      endpoints:
        - exposure: public
          name: nodejs
          protocol: http
          targetPort: 3000
      memoryLimit: 2Gi
      memoryRequest: 256Mi
      mountSources: true

Screenshot from 2025-02-15 11-31-38

Test scenario to check eclipse-che/che#23301 issue fix up:

  1. Install Eclipse Che Next with User Dashboard image quay.io/eclipse/che-dashboard:pr-1315
  2. Open User Dashboard and add SSH Key.
  3. Create workspace from private repo using SSH Git URL [email protected]:crw-qe/quarkus-api-example-private.git
  4. Review workspace's Devfile in User Dashboard.

Test result:

✅ The workspace itself was created using the correct devfile from the repository.

⚠️ There was incorrect Devfile content shown in User Dashboard:

schemaVersion: 2.2.0
metadata:
  generateName: empty

Screenshot from 2025-02-15 10-59-42

Expected defile content: devfile (12).yaml.txt

Screencast: screen-capture.webm

@vinokurig
Copy link
Contributor

@dmytro-ndp

Create workspace from private repo using SSH Git URL [email protected]:crw-qe/quarkus-api-example-private.git

This is a private repository, we can not fetch the devfile content having only ssh key, see: https://eclipse.dev/che/docs/stable/end-user-guide/starting-a-workspace-from-a-git-repository-url/

@olexii4
Copy link
Contributor Author

olexii4 commented Feb 17, 2025

@dmytro-ndp From my point of view, the test scenario to check eclipse-che/che#23301 could not be properly correct because the added SSH Key allows us to use git operations after the workspace starts. So, we can create a new workspace from the private repo using SSH Git URL [email protected]:crw-qe/quarkus-api-example-private.git. A new workspace will be created from the empty.yaml because che-server resolves SSH Git URL [email protected]:crw-qe/quarkus-api-example-private.git with an error:

Знімок екрана 2025-02-17 о 14 51 48

These changes allow us to see the original devfile used to create a new workspace.
Without changes from this PR, we had:
Screenshot from 2025-01-05 21-53-20
Now we have the original empty devfile:
Знімок екрана 2025-02-17 о 15 25 32

So, in the case with the private repo using the SSH Git URL, we should restart the workspace from the local devfile from the che-editor side to accept the right devfile.

@dmytro-ndp
Copy link
Contributor

@vinokurig, @olexii4 : thank you for the comment

This is a private repository, we can not fetch the devfile content having only ssh key, see: https://eclipse.dev/che/docs/stable/end-user-guide/starting-a-workspace-from-a-git-repository-url/

I faced different result.
Workspaces seems to be created using correct devfile.yaml from the target repo. It could be related to the feature described in the issue eclipse-che/che#23277
See test screencast: screen-capture.webm.

@olexii4
Copy link
Contributor Author

olexii4 commented Feb 18, 2025

@dmytro-ndp I removed eclipse-che/che#23301 from the description.

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

Copy link

openshift-ci bot commented Feb 18, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akurinnoy, dmytro-ndp, 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

@openshift-ci openshift-ci bot removed the lgtm label Feb 20, 2025
Copy link

openshift-ci bot commented Feb 20, 2025

New changes are detected. LGTM label has been removed.

Copy link

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

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-1315", name: che-dashboard}]}}]"

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

Successfully merging this pull request may close these issues.

http raw devfile is not properly resolved by the User Dashboard
5 participants