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

Component create from Git fails if a devfile exists in git repo #3386 #3387

Conversation

vrubezhny
Copy link
Contributor

Fixes: #3386

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Attention: 73 lines in your changes are missing coverage. Please review.

Comparison is base (043edbe) 36.09% compared to head (04e273e) 35.76%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3387      +/-   ##
==========================================
- Coverage   36.09%   35.76%   -0.34%     
==========================================
  Files          78       78              
  Lines        5446     5502      +56     
  Branches     1067     1082      +15     
==========================================
+ Hits         1966     1968       +2     
- Misses       3480     3534      +54     
Files Coverage Δ
src/webview/devfile-registry/registryViewLoader.ts 25.86% <50.00%> (ø)
src/webview/common-ext/createComponentHelpers.ts 14.11% <25.00%> (-0.35%) ⬇️
src/webview/helm-chart/helmChartLoader.ts 23.71% <6.45%> (-3.93%) ⬇️
.../webview/create-component/createComponentLoader.ts 9.45% <0.00%> (-1.19%) ⬇️

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

@vrubezhny vrubezhny force-pushed the fix-component-create-from-git-devfile-undefined branch from f94347b to 7269032 Compare October 3, 2023 10:08
@vrubezhny vrubezhny marked this pull request as draft October 3, 2023 13:08
@vrubezhny vrubezhny force-pushed the fix-component-create-from-git-devfile-undefined branch 2 times, most recently from f18c0f7 to aca679b Compare October 10, 2023 16:21
@vrubezhny vrubezhny marked this pull request as ready for review October 10, 2023 16:41
@vrubezhny vrubezhny force-pushed the fix-component-create-from-git-devfile-undefined branch from aca679b to 1827f46 Compare October 10, 2023 17:14
Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

In addition to the comment I added, it would be nice to populate the "Component Name" field with the component name from the existing Devfile instead of the one that we generate.

src/webview/create-component/createComponentLoader.ts Outdated Show resolved Hide resolved
@vrubezhny vrubezhny force-pushed the fix-component-create-from-git-devfile-undefined branch from 1827f46 to e98fb34 Compare October 10, 2023 21:09
@vrubezhny
Copy link
Contributor Author

vrubezhny commented Oct 10, 2023

In addition to the comment I added, it would be nice to populate the "Component Name" field with the component name from the existing Devfile instead of the one that we generate.

@datho7561 Do you mean we should get the devfile's metadata.name in any case: either this is a devfile from a Git-repo or a recommended/selected devfile?

Doesn't look good, IMHO, because we're losing the Git-repo name, previously used to be an initial component name if we change it this way, f.i:

  • for Lemminx Git-repo initial component name lemminx is going to be changed to whatever a selected Devfile (from a Devfile Registry) is named (for example, maven-java)
  • for Wild-West-Frontend initial component name wild-west-frontend is going to be changed to nodejs

I'd say using the Git-repo URL/Path to construct the initial component name better answers the question like "What this component is?"

@datho7561
Copy link
Contributor

I think in the case of Wild-West-Frontend (i.e. when importing a git repo or local codebase with an existing Devfile), it makes sense to populate the field with the name from the existing Devfile, since if its already set, the user probably doesn't want to change it, even if it's different from the repo name.

@vrubezhny vrubezhny force-pushed the fix-component-create-from-git-devfile-undefined branch from e98fb34 to 04e273e Compare October 11, 2023 13:54
@vrubezhny
Copy link
Contributor Author

I think in the case of Wild-West-Frontend (i.e. when importing a git repo or local codebase with an existing Devfile), it makes sense to populate the field with the name from the existing Devfile, since if its already set, the user probably doesn't want to change it, even if it's different from the repo name.

@datho7561 Resonably. I've updated the form so the initial component name is taken from a devfile provided

Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks, Victor!

@datho7561 datho7561 merged commit 4fe8c8d into redhat-developer:main Oct 11, 2023
4 of 6 checks passed
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.

Component create from Git fails if a devfile exists in git repo
2 participants