Skip to content

Commit

Permalink
_cli: fix warning check (#1192)
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw authored Oct 25, 2024
1 parent f403812 commit 33951a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ All versions prior to 0.9.0 are untracked.

## [Unreleased]

### Fixed

* Fixed a CLI parsing bug introduced in 3.5.0 when attempting
to suppress irrelevant warnings
([#1192](https://github.com/sigstore/sigstore-python/pull/1192))

## [3.5.0]

### Added
Expand Down
23 changes: 10 additions & 13 deletions sigstore/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,19 +931,16 @@ def _collect_verification_state(
legacy_default_bundle = file.parent / f"{file.name}.sigstore"
bundle = file.parent / f"{file.name}.sigstore.json"

if (
not bundle.is_file()
and legacy_default_bundle.is_file()
# NOTE(ww): Only show this warning if bare materials
# are not provided, since bare materials take precedence over
# a .sigstore bundle.
and not (cert or sig)
):
_logger.warning(
f"{file}: {legacy_default_bundle} should be named {bundle}. "
"Support for discovering 'bare' .sigstore inputs will be deprecated in "
"a future release."
)
if not bundle.is_file() and legacy_default_bundle.is_file():
if not (cert or sig):
# NOTE(ww): Only show this warning if bare materials
# are not provided, since bare materials take precedence over
# a .sigstore bundle.
_logger.warning(
f"{file}: {legacy_default_bundle} should be named {bundle}. "
"Support for discovering 'bare' .sigstore inputs will be deprecated in "
"a future release."
)
bundle = legacy_default_bundle
elif bundle.is_file() and legacy_default_bundle.is_file():
# Don't allow the user to implicitly verify `{input}.sigstore.json` if
Expand Down

0 comments on commit 33951a5

Please sign in to comment.