Skip to content

Commit

Permalink
chore: address PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: behnazh-w <[email protected]>
  • Loading branch information
behnazh-w committed Nov 6, 2024
1 parent c72a2eb commit c9761dc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/macaron/repo_finder/provenance_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def get_build_invocation(self, statement: InTotoV01Statement | InTotoV1Statement
return None, None

attestation_type = json_extract(statement["predicate"], ["attestations", "type"], str)
if not self.expected_attestation_type == attestation_type:
if self.expected_attestation_type != attestation_type:
return None, None
gl_workflow = json_extract(statement["predicate"], ["attestations", "attestation", "ciconfigpath"], str)
gl_job_url = json_extract(statement["predicate"], ["attestations", "attestation", "joburl"], str)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ def check_publish_start_commit_timestamps(
return False
return True

# Handle errors for calls to `fromisoformat()` and the time comparison.
except (ValueError, OverflowError, OSError, TypeError) as error:
except (ValueError, OverflowError, TypeError) as error:
logger.debug(error)

return False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def find_publish_timestamp(self, purl: str, registry_url: str | None = None) ->
raise InvalidHTTPResponseError("Failed to construct the API URL.") from error

response = send_get_http_raw(url)
if response and response.text and response.status_code == 200:
if response and response.text:
try:
metadata: dict = json.loads(response.text)
except requests.exceptions.JSONDecodeError as error:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@ exclude =
# temporarily because provenances have failed to publish due to an issue in `[email protected]`:
# https://github.com/slsa-framework/slsa-github-generator/issues/3350
mcn_provenance_available_1
# Exclude `cn_find_artifact_pipeline_1`, due to a non-deterministic behavior in deploy command detection,
# which will be fixed in PR #673.
cn_find_artifact_pipeline_1
include = *

0 comments on commit c9761dc

Please sign in to comment.