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

Introduce err code for user error in devfile #196

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

maysunfaisal
Copy link
Member

@maysunfaisal maysunfaisal commented Jan 5, 2024

What does this PR do?:

  • Introduces err codes for user errors in devfile, so this helps devfile/library consumers with prometheus metrics
  • remove unnecessary error wrapping

Which issue(s) this PR fixes:

Partially https://issues.redhat.com/browse/DEVHAS-580

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:

tests should pass

Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
@openshift-ci openshift-ci bot requested review from elsony and Jdubrick January 5, 2024 19:23
Copy link

codecov bot commented Jan 5, 2024

Codecov Report

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

Comparison is base (4821a63) 60.42% compared to head (91a1eb2) 60.83%.
Report is 3 commits behind head on main.

Files Patch % Lines
pkg/devfile/parse.go 0.00% 1 Missing ⚠️
pkg/devfile/parser/context/schema.go 50.00% 1 Missing ⚠️
pkg/devfile/parser/parse.go 92.85% 1 Missing ⚠️
pkg/devfile/parser/reader.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #196      +/-   ##
==========================================
+ Coverage   60.42%   60.83%   +0.41%     
==========================================
  Files          43       43              
  Lines        5097     5097              
==========================================
+ Hits         3080     3101      +21     
+ Misses       1828     1809      -19     
+ Partials      189      187       -2     

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

@maysunfaisal maysunfaisal requested review from yangcao77 and removed request for elsony January 5, 2024 19:39
@Jdubrick
Copy link
Contributor

Jdubrick commented Jan 5, 2024

@maysunfaisal in general looks good to me and make test passes. Is it possible to add more coverage to allow codecov/patch check to pass? I know @thepetk and I ran into issues with lines being missed in devfile/alizer#37 for reference

@maysunfaisal
Copy link
Member Author

maysunfaisal commented Jan 8, 2024

@maysunfaisal in general looks good to me and make test passes. Is it possible to add more coverage to allow codecov/patch check to pass? I know @thepetk and I ran into issues with lines being missed in devfile/alizer#37 for reference

@Jdubrick I think it could have been addressed as part of a separate PR, because I wasnt introducing any new lines and it was a direct line-line replacement, hence these gaps were already present in the main branch. However, I have tried addressing all of them with the exception of 2 lines. They seem really hard to mock if not almost impossible without further code refactoring.

Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
Copy link
Contributor

@Jdubrick Jdubrick left a comment

Choose a reason for hiding this comment

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

lgtm. if you think we should add more tests in a different issue we should do that, your added tests increased the patch % significantly though!

Copy link

openshift-ci bot commented Jan 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@openshift-ci openshift-ci bot added the approved label Jan 8, 2024
@maysunfaisal maysunfaisal merged commit 3d259fa into devfile:main Jan 8, 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
Development

Successfully merging this pull request may close these issues.

2 participants