Skip to content

Conversation

@malancas
Copy link
Contributor

@malancas malancas commented Sep 4, 2024

Closes #9615

This updates the content of the error messages printed when parsing bundle files with either .json or .jsonl extensions. If bundle validation fails, the error message will now be more specific and informative.

Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
@malancas malancas changed the title Update gh attestation verify bundle file parse errors Update gh attestation verify bundle file processing errors Sep 5, 2024
Signed-off-by: Meredith Lancaster <[email protected]>
@malancas malancas marked this pull request as ready for review September 5, 2024 20:09
@malancas malancas requested a review from a team as a code owner September 5, 2024 20:09
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Sep 5, 2024
@cliAutomation
Copy link
Collaborator

Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message.

}
return attestations, nil
case ".jsonl":
attestations, err := loadBundlesFromJSONLinesFile(path)
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like loadBundlesFromJSONLinesFile wraps the error it gets back from os.ReadFile, so I think we might want to unwrap that, or do different error handling here.

@williammartin
Copy link
Member

Does this have an associated issue?

@malancas malancas requested a review from a team as a code owner September 10, 2024 14:04
@malancas
Copy link
Contributor Author

malancas commented Sep 10, 2024

Does this have an associated issue?

@williammartin sorry I just saw this comment. I have an issue I can share with you

Copy link
Member

@andyfeller andyfeller left a comment

Choose a reason for hiding this comment

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

lgtm

@andyfeller andyfeller self-requested a review September 11, 2024 18:56
@malancas malancas changed the title Update gh attestation verify bundle file processing errors Update gh attestation verify bundle parsing and validation errors Sep 12, 2024
@malancas malancas merged commit e381d54 into cli:trunk Sep 13, 2024
@malancas malancas deleted the verification-err-output branch September 13, 2024 15:27
izumin5210 referenced this pull request in izumin5210/dotfiles Sep 21, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cli/cli](https://redirect.github.com/cli/cli) | minor | `v2.56.0` ->
`v2.57.0` |

---

### Release Notes

<details>
<summary>cli/cli (cli/cli)</summary>

###
[`v2.57.0`](https://redirect.github.com/cli/cli/releases/tag/v2.57.0):
GitHub CLI 2.57.0

[Compare
Source](https://redirect.github.com/cli/cli/compare/v2.56.0...v2.57.0)

#### What's Changed

- Move non-integration tests to different test file by
[@&#8203;codysoyland](https://redirect.github.com/codysoyland) in
[https://github.com/cli/cli/pull/9577](https://redirect.github.com/cli/cli/pull/9577)
- Added tenancy aware attestation commands by
[@&#8203;kommendorkapten](https://redirect.github.com/kommendorkapten)
in
[https://github.com/cli/cli/pull/9542](https://redirect.github.com/cli/cli/pull/9542)
- Added `--active` flag to the `gh auth status` command by
[@&#8203;velumuruganr](https://redirect.github.com/velumuruganr) in
[https://github.com/cli/cli/pull/9520](https://redirect.github.com/cli/cli/pull/9520)
- build(deps): bump github.com/sigstore/sigstore-go from 0.6.1 to 0.6.2
by [@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/cli/cli/pull/9601](https://redirect.github.com/cli/cli/pull/9601)
- `gh attestation verify` test for custom OIDC issuers by
[@&#8203;bdehamer](https://redirect.github.com/bdehamer) in
[https://github.com/cli/cli/pull/9595](https://redirect.github.com/cli/cli/pull/9595)
- Suggest installing Rosetta when extension installation fails due to
missing `darwin-arm64` binary, but a `darwin-amd64` binary is available
by [@&#8203;timrogers](https://redirect.github.com/timrogers) in
[https://github.com/cli/cli/pull/9599](https://redirect.github.com/cli/cli/pull/9599)
- Update `gh attestation verify` bundle parsing and validation errors by
[@&#8203;malancas](https://redirect.github.com/malancas) in
[https://github.com/cli/cli/pull/9564](https://redirect.github.com/cli/cli/pull/9564)
- Suppress `attestation verify` output when no TTY present by
[@&#8203;bdehamer](https://redirect.github.com/bdehamer) in
[https://github.com/cli/cli/pull/9612](https://redirect.github.com/cli/cli/pull/9612)
- Use api subdomains for tenant hosts by
[@&#8203;williammartin](https://redirect.github.com/williammartin) in
[https://github.com/cli/cli/pull/9618](https://redirect.github.com/cli/cli/pull/9618)

#### New Contributors

- [@&#8203;kommendorkapten](https://redirect.github.com/kommendorkapten)
made their first contribution in
[https://github.com/cli/cli/pull/9542](https://redirect.github.com/cli/cli/pull/9542)
- [@&#8203;velumuruganr](https://redirect.github.com/velumuruganr) made
their first contribution in
[https://github.com/cli/cli/pull/9520](https://redirect.github.com/cli/cli/pull/9520)
- [@&#8203;bdehamer](https://redirect.github.com/bdehamer) made their
first contribution in
[https://github.com/cli/cli/pull/9595](https://redirect.github.com/cli/cli/pull/9595)
- [@&#8203;timrogers](https://redirect.github.com/timrogers) made their
first contribution in
[https://github.com/cli/cli/pull/9599](https://redirect.github.com/cli/cli/pull/9599)

**Full Changelog**: cli/cli@v2.56.0...v2.57.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/izumin5210/dotfiles).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: izumin5210-update-aqua-checksum[bot] <169593670+izumin5210-update-aqua-checksum[bot]@users.noreply.github.com>
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Sep 23, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cli/cli](https://github.com/cli/cli) | minor | `v2.55.0` -> `v2.57.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>cli/cli (cli/cli)</summary>

### [`v2.57.0`](https://github.com/cli/cli/releases/tag/v2.57.0): GitHub CLI 2.57.0

[Compare Source](cli/cli@v2.56.0...v2.57.0)

#### What's Changed

-   Move non-integration tests to different test file by [@&#8203;codysoyland](https://github.com/codysoyland) in cli/cli#9577
-   Added tenancy aware attestation commands by [@&#8203;kommendorkapten](https://github.com/kommendorkapten) in cli/cli#9542
-   Added `--active` flag to the `gh auth status` command by [@&#8203;velumuruganr](https://github.com/velumuruganr) in cli/cli#9520
-   build(deps): bump github.com/sigstore/sigstore-go from 0.6.1 to 0.6.2 by [@&#8203;dependabot](https://github.com/dependabot) in cli/cli#9601
-   `gh attestation verify` test for custom OIDC issuers by [@&#8203;bdehamer](https://github.com/bdehamer) in cli/cli#9595
-   Suggest installing Rosetta when extension installation fails due to missing `darwin-arm64` binary, but a `darwin-amd64` binary is available by [@&#8203;timrogers](https://github.com/timrogers) in cli/cli#9599
-   Update `gh attestation verify` bundle parsing and validation errors by [@&#8203;malancas](https://github.com/malancas) in cli/cli#9564
-   Suppress `attestation verify` output when no TTY present by [@&#8203;bdehamer](https://github.com/bdehamer) in cli/cli#9612
-   Use api subdomains for tenant hosts by [@&#8203;williammartin](https://github.com/williammartin) in cli/cli#9618

#### New Contributors

-   [@&#8203;kommendorkapten](https://github.com/kommendorkapten) made their first contribution in cli/cli#9542
-   [@&#8203;velumuruganr](https://github.com/velumuruganr) made their first contribution in cli/cli#9520
-   [@&#8203;bdehamer](https://github.com/bdehamer) made their first contribution in cli/cli#9595
-   [@&#8203;timrogers](https://github.com/timrogers) made their first contribution in cli/cli#9599

**Full Changelog**: cli/cli@v2.56.0...v2.57.0

### [`v2.56.0`](https://github.com/cli/cli/releases/tag/v2.56.0): GitHub CLI 2.56.0

[Compare Source](cli/cli@v2.55.0...v2.56.0)

#### Important note about renewed GPG key

The Debian and RedHat releases have been signed with a new GPG key. If you are experiencing issues updating your `.deb` or `.rpm` packages, please read  [cli/cli#9569](cli/cli#9569).

#### What's Changed

-   Always print URL scheme to stdout by [@&#8203;heaths](https://github.com/heaths) in cli/cli#9471
-   Quote repo names consistently in `gh repo sync` stdout by [@&#8203;muzimuzhi](https://github.com/muzimuzhi) in cli/cli#9491
-   Fetch bundle from OCI registry for verify  by [@&#8203;ejahnGithub](https://github.com/ejahnGithub) in cli/cli#9421
-   Remove `Internal` from `gh repo create` prompt when owner is not an org by [@&#8203;jtmcg](https://github.com/jtmcg) in cli/cli#9465
-   Drop surplus trailing space char in flag names in web by [@&#8203;muzimuzhi](https://github.com/muzimuzhi) in cli/cli#9495
-   fix the trimming of log filenames for `gh run view` by [@&#8203;benebsiny](https://github.com/benebsiny) in cli/cli#9482
-   "offline" verification using the bundle of attestations without any additional handling of the file by [@&#8203;aryanbhosale](https://github.com/aryanbhosale) in cli/cli#9523
-   build(deps): bump actions/attest-build-provenance from 1.4.1 to 1.4.2 by [@&#8203;dependabot](https://github.com/dependabot) in cli/cli#9518
-   Fix doc typo for `repo sync` by [@&#8203;muzimuzhi](https://github.com/muzimuzhi) in cli/cli#9509
-   Correct the help message for -F by [@&#8203;Goooler](https://github.com/Goooler) in cli/cli#9525
-   chore: fix some function names by [@&#8203;crystalstall](https://github.com/crystalstall) in cli/cli#9555
-   verify 2nd artifact without swapping order by [@&#8203;aryanbhosale](https://github.com/aryanbhosale) in cli/cli#9532
-   `gh attestation verify` handles empty JSONL files by [@&#8203;malancas](https://github.com/malancas) in cli/cli#9541
-   Enhance Linux installation docs to redirect users to GPG renewal issue, better troubleshooting support by [@&#8203;andyfeller](https://github.com/andyfeller) in cli/cli#9573
-   Upgrade sigstore-go to v0.6.1 by [@&#8203;codysoyland](https://github.com/codysoyland) in cli/cli#9566
-   Check for nil values to prevent nil dereference panic by [@&#8203;codysoyland](https://github.com/codysoyland) in cli/cli#9578
-   build(deps): bump actions/attest-build-provenance from 1.4.2 to 1.4.3 by [@&#8203;dependabot](https://github.com/dependabot) in cli/cli#9575

#### New Contributors

-   [@&#8203;aryanbhosale](https://github.com/aryanbhosale) made their first contribution in cli/cli#9523
-   [@&#8203;Goooler](https://github.com/Goooler) made their first contribution in cli/cli#9525
-   [@&#8203;crystalstall](https://github.com/crystalstall) made their first contribution in cli/cli#9555

**Full Changelog**: cli/cli@v2.55.0...v2.56.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update gh attestation verify bundle validation error content should be more specific

5 participants