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

Add Functionality For Multiple Devfile Name Variations #198

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

Jdubrick
Copy link
Contributor

What does this PR do?:

This PR updates the DownloadGitRepoResources function to allow for different naming schemes for devfiles to be supported. Before the change only devfile.yaml was being recognized. This PR adds support for devfile.yaml, devfile.yml, .devfile.yaml and .devfile.yml. In addition to this it allows for more naming schemes to be added in the future.

Which issue(s) this PR fixes:

fixes devfile/api#1362

PR acceptance criteria:

Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened and linked to this PR, if they are not in the PR scope due to various constraints.

  • Unit/Functional tests

  • QE Integration test

  • Documentation (READMEs, Product Docs, Blogs, Education Modules, etc.)

  • Client Impact

  • Gosec scans

How to test changes / Special notes to the reviewer:

Running make test should pass with the addition of the new tests for the devfile validation.

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Copy link

codecov bot commented Feb 21, 2024

Codecov Report

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

Comparison is base (2a1d045) 60.83% compared to head (3cc0a0e) 60.88%.

Files Patch % Lines
pkg/devfile/parser/util/mock.go 0.00% 1 Missing ⚠️
pkg/devfile/parser/util/utils.go 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #198      +/-   ##
==========================================
+ Coverage   60.83%   60.88%   +0.04%     
==========================================
  Files          43       43              
  Lines        5097     5103       +6     
==========================================
+ Hits         3101     3107       +6     
  Misses       1809     1809              
  Partials      187      187              

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

Copy link
Contributor

@thepetk thepetk left a comment

Choose a reason for hiding this comment

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

@Jdubrick a minor update proposed from my side regarding the sorting that the ValidateDevfileExistence is following.

pkg/devfile/parser/util/utils.go Outdated Show resolved Hide resolved
@thepetk
Copy link
Contributor

thepetk commented Feb 22, 2024

Codecov Report

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

Comparison is base (2a1d045) 60.83% compared to head (22c637b) 60.88%.

Files Patch % Lines
pkg/devfile/parser/util/mock.go 0.00% 1 Missing ⚠️
pkg/devfile/parser/util/utils.go 85.71% 1 Missing ⚠️
Additional details and impacted files
☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here.

Not related to this PR, but I think we can add more failure test cases to the Test_DownloadGitRepoResources so we can include more cases inside the DownloadGitRepoResources func.

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@Jdubrick
Copy link
Contributor Author

Codecov Report

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

Comparison is base (2a1d045) 60.83% compared to head (22c637b) 60.88%.

Files Patch % Lines
pkg/devfile/parser/util/mock.go 0.00% 1 Missing ⚠️
pkg/devfile/parser/util/utils.go 85.71% 1 Missing ⚠️
Additional details and impacted files
☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here.

Not related to this PR, but I think we can add more failure test cases to the Test_DownloadGitRepoResources so we can include more cases inside the DownloadGitRepoResources func.

See devfile/api#1456 for an issue about the test suite

@thepetk thepetk self-requested a review February 22, 2024 15:54
Copy link
Contributor

@thepetk thepetk left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Feb 22, 2024
Copy link

openshift-ci bot commented Feb 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jdubrick, thepetk

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

The pull request process is described 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

@Jdubrick Jdubrick merged commit eefdbd3 into devfile:main Feb 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants