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

re-introduce and fix declcfg.Meta unmarshal error #1109

Conversation

joelanford
Copy link
Member

Description of the change:
Re-introduce pretty-printing of json.Unmarshal errors encountered with unmarshaling declcfg.Meta objects.

Motivation for the change:
Prior to #1094, we had some nice pretty printing of JSON unmarshaling errors. That pretty printing also had a bug that caused an index out-of-bounds panic.

In #1094, we inadvertently stopped using the pretty-printing. This technically solved the panic bug, but we lost the pretty-printing as well.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 9, 2023
@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Merging #1109 (dfc71ec) into master (b51aaf0) will increase coverage by 0.27%.
The diff coverage is 85.71%.

❗ Current head dfc71ec differs from pull request most recent head b991fa8. Consider uploading reports for the commit b991fa8 to get more accurate results

@@            Coverage Diff             @@
##           master    #1109      +/-   ##
==========================================
+ Coverage   52.35%   52.63%   +0.27%     
==========================================
  Files         107      108       +1     
  Lines        9688     9703      +15     
==========================================
+ Hits         5072     5107      +35     
+ Misses       3674     3654      -20     
  Partials      942      942              
Impacted Files Coverage Δ
pkg/cache/cache.go 32.35% <0.00%> (ø)
alpha/declcfg/load.go 74.05% <62.50%> (-1.28%) ⬇️
alpha/template/composite/builder.go 83.44% <80.00%> (ø)
alpha/declcfg/errors.go 91.89% <91.89%> (ø)
alpha/action/render.go 65.02% <100.00%> (ø)
alpha/declcfg/declcfg.go 78.94% <100.00%> (+32.07%) ⬆️
alpha/template/composite/composite.go 78.70% <100.00%> (ø)
pkg/cache/json.go 53.15% <100.00%> (ø)

... and 2 files with indirect coverage changes

@joelanford
Copy link
Member Author

/hold
i think there's still a bug here with the marker placement.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 9, 2023
@joelanford joelanford force-pushed the json-unmarshal-err branch from 113199f to b991fa8 Compare June 9, 2023 19:48
@joelanford
Copy link
Member Author

/hold cancel

Beefed up the logic, added unit tests to prove things work and to prevent regressions.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 9, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 9, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn, joelanford

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:
  • OWNERS [grokspawn,joelanford]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@grokspawn
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 9, 2023
@openshift-merge-robot openshift-merge-robot merged commit 6c60284 into operator-framework:master Jun 9, 2023
@joelanford joelanford deleted the json-unmarshal-err branch June 9, 2023 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants