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

Create devworkspaces using generated DevWorkspace and DevWorkspaceTemplate #429

Merged
merged 8 commits into from
Jan 4, 2022

Conversation

akurinnoy
Copy link
Contributor

What does this PR do?

This PR adds the ability to create devworkspaces using pre-generated resources.
When a user clicks on a sample, the dashboard analyzes the sample looking for devWorkspace links. Among those links it takes one for the default editor, adds that as a query parameter to factory link, and runs factory flow. The Factory Loader detects that query param and skips steps for resolving and fetching devfiles and processing devworkspace templates to apply editor-specific stuff. Instead, it fetches pre-generated resources, creates devworkspace template and devworkspace, and starts the devworkspace.

Screencast
Screen.Recording.2021-12-22.at.11.16.49.mov

What issues does this PR fix or reference?

resolves eclipse-che/che#20829

Is it tested? How?

Create a workspace from the Quick Add page.

@akurinnoy akurinnoy self-assigned this Dec 22, 2021
@che-bot
Copy link
Contributor

che-bot commented Dec 22, 2021

❌ E2E dashboard tests failed ❗

See Details

Test product:

  • Use comment "[dashboard-ci-test]" to rerun the dashboard e2e tests

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

@github-actions
Copy link

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

@dmytro-ndp
Copy link
Contributor

[dashboard-ci-test]

@che-bot
Copy link
Contributor

che-bot commented Dec 23, 2021

✅ E2E dashboard tests succeed 🎉

See Details

Test product:

  • Use comment "[dashboard-ci-test]" to rerun the dashboard e2e tests

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

) as devfileApi.DevWorkspaceTemplate;

await this.props.createWorkspaceFromPrebuiltResources(devworkspace, devworkspaceTemplate);

Copy link
Contributor

Choose a reason for hiding this comment

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

With this solution, we will be able to create only one workspace from a sample.

But, as a developer, I prefer to have 'a quick start' flow, when I can choose a sample with needed technology, create a new workspace. Then, add a new project inside, push it to upstream without requirement to recreate a new workspace.

Note:
We need to recreate workspace, because with this implementation click on a sample creates a new devworkspace from prebuilt resources without changing its name(adding some generated symbols as it was previosly).
And we can't create two workspaces with different name from the same sample, can't rename existing devworkspace. So, it will require to recreate each workspace wich was based on that sample.

My proposal: improve this implementation and add some generated symbols to devworkspace and devworkspacetemplate names

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, thanks!
Actually, I don't have any strong opinion on how do we proceed with this.
@ibuziuk @l0rd can you please share your thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

With this solution, we will be able to create only one workspace from a sample.

I believe this is fine for the first iteration. Basically, if a workspace based on the sample already exists, clicking on the devfile sample again will reopen the existing one. For the time being I would avoid doing any modifications of the DevWorkspace / DevWorkspace template on UD level

@eclipse-che eclipse-che deleted a comment from che-bot Dec 24, 2021
@github-actions
Copy link

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

@codecov
Copy link

codecov bot commented Dec 24, 2021

Codecov Report

Merging #429 (7f709ac) into main (954e3a8) will increase coverage by 0.63%.
The diff coverage is 53.78%.

❗ Current head 7f709ac differs from pull request most recent head 94a3f3b. Consider uploading reports for the commit 94a3f3b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #429      +/-   ##
==========================================
+ Coverage   49.95%   50.59%   +0.63%     
==========================================
  Files         216      214       -2     
  Lines        7356     7348       -8     
  Branches     1223     1220       -3     
==========================================
+ Hits         3675     3718      +43     
+ Misses       3331     3279      -52     
- Partials      350      351       +1     
Impacted Files Coverage Δ
...arted/CustomWorkspaceTab/DevfileSelector/index.tsx 75.43% <0.00%> (ø)
...end/src/pages/WorkspaceDetails/EditorTab/index.tsx 57.01% <ø> (ø)
...dashboard-frontend/src/services/bootstrap/index.ts 0.00% <0.00%> (ø)
...orkspace-client/cheworkspace/cheWorkspaceClient.ts 57.89% <ø> (+12.99%) ⬆️
...orkspace-client/devworkspace/devWorkspaceClient.ts 44.23% <0.00%> (-1.68%) ⬇️
...ontend/src/store/Workspaces/devWorkspaces/index.ts 9.38% <6.66%> (-0.47%) ⬇️
...es/GetStarted/GetStartedTab/SamplesListGallery.tsx 74.07% <55.55%> (-5.10%) ⬇️
...rd-frontend/src/containers/FactoryLoader/index.tsx 77.81% <60.00%> (-3.88%) ⬇️
...shboard-frontend/src/pages/FactoryLoader/index.tsx 74.62% <81.81%> (+1.74%) ⬆️
...oard-frontend/src/store/DevfileRegistries/index.ts 79.04% <91.30%> (+53.77%) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 954e3a8...94a3f3b. Read the comment docs.

@openshift-ci
Copy link

openshift-ci bot commented Jan 4, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akurinnoy, 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 Jan 4, 2022
@openshift-ci
Copy link

openshift-ci bot commented Jan 4, 2022

New changes are detected. LGTM label has been removed.

@github-actions
Copy link

github-actions bot commented Jan 4, 2022

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

@openshift-ci
Copy link

openshift-ci bot commented Jan 4, 2022

@akurinnoy: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v8-dashboard-happy-path 94a3f3b link true /test v8-dashboard-happy-path

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

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.

Use generated DevWorkspaceTemplates from the devfile registry to create workspaces
5 participants