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

feat: add brief err to CertificateStore CRD #846

Merged
merged 2 commits into from
May 29, 2023

Conversation

binbin-li
Copy link
Collaborator

@binbin-li binbin-li commented May 25, 2023

Description

What this PR does / why we need it:

Add truncated error message to CertificateStore Status to avoid displaying long error message when listing it.

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):

Fixes #843

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Helm Chart Change (any edit/addition/update that is necessary for changes merged to the main branch)
  • This change requires a documentation update

How Has This Been Tested?

Status before:
old get

Status after:
new get
Details when describing it:
new des

Checklist:

  • Does the affected code have corresponding tests?
  • Are the changes documented, not just with inline documentation, but also with conceptual documentation such as an overview of a new feature, or task-based documentation like a tutorial? Consider if this change should be announced on your project blog.
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have appropriate license header?

Post Merge Requirements

  • MAINTAINERS: manually trigger the "Publish Package" workflow after merging any PR that indicates Helm Chart Change

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.06 🎉

Comparison is base (cd1983b) 54.90% compared to head (d2519a3) 54.96%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #846      +/-   ##
==========================================
+ Coverage   54.90%   54.96%   +0.06%     
==========================================
  Files          80       80              
  Lines        4732     4739       +7     
==========================================
+ Hits         2598     2605       +7     
  Misses       1850     1850              
  Partials      284      284              
Impacted Files Coverage Δ
pkg/controllers/certificatestore_controller.go 38.09% <100.00%> (+4.42%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@binbin-li binbin-li force-pushed the add-brief-err branch 5 times, most recently from f805780 to b5ace32 Compare May 25, 2023 09:31
@binbin-li binbin-li marked this pull request as ready for review May 25, 2023 10:16
@akashsinghal
Copy link
Collaborator

General question: Is the goal to just truncate the error message? I'm wondering if this will make it more confusing?

@binbin-li
Copy link
Collaborator Author

General question: Is the goal to just truncate the error message? I'm wondering if this will make it more confusing?

I posted some screenshots before and after the pr. The target is to avoid displaying long message when listing resources. Truncating is just one possible solution. @fseldow and I also considered other options:

  1. Display error code while listing resources and display detailed error when describing it. But it means we need to parse the dependency error and have a mapping from error code to each specific error. And we have to maintain the mapping when new errors are added in the future.
  2. Probably we can just remove the ERROR column when listing it since there is anIsSuccess column which can indicate an error happened as well.

@akashsinghal
Copy link
Collaborator

General question: Is the goal to just truncate the error message? I'm wondering if this will make it more confusing?

I posted some screenshots before and after the pr. The target is to avoid displaying long message when listing resources. Truncating is just one possible solution. @fseldow and I also considered other options:

  1. Display error code while listing resources and display detailed error when describing it. But it means we need to parse the dependency error and have a mapping from error code to each specific error. And we have to maintain the mapping when new errors are added in the future.
  2. Probably we can just remove the ERROR column when listing it since there is anIsSuccess column which can indicate an error happened as well.

Thanks for clarifying. I understand the goal now. Truncating makes sense to me since user can just run describe to get the full error details.

@sajayantony
Copy link
Contributor

Thanks for making these diagnostics improvements. Really helps debuggability.

@binbin-li binbin-li merged commit 95bbea3 into ratify-project:main May 29, 2023
bspaans pushed a commit to bspaans/ratify that referenced this pull request Oct 17, 2023
Co-authored-by: Akash Singhal <akashsinghal@microsoft.com>
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.

Simplify error message when listing certStore resource
3 participants