Skip to content

Commit 927d8c3

Browse files
committed
chore: minor fixes after rebase
Signed-off-by: Ben Selwyn-Smith <[email protected]>
1 parent 2e7411c commit 927d8c3

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/macaron/repo_finder/provenance_finder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def find_gav_provenance(purl: PackageURL, registry: JFrogMavenRegistry) -> list[
377377
return provenances[:1]
378378

379379

380-
def find_provenance_from_ci(self, analyze_ctx: AnalyzeContext, git_obj: Git | None) -> InTotoPayload | None:
380+
def find_provenance_from_ci(analyze_ctx: AnalyzeContext, git_obj: Git | None) -> InTotoPayload | None:
381381
"""Try to find provenance from CI services of the repository.
382382
383383
Note that we stop going through the CI services once we encounter a CI service
@@ -463,7 +463,7 @@ def find_provenance_from_ci(self, analyze_ctx: AnalyzeContext, git_obj: Git | No
463463
ci_info["provenance_assets"].extend(provenance_assets)
464464

465465
# Download the provenance assets and load the provenance payloads.
466-
self.download_provenances_from_github_actions_ci_service(
466+
download_provenances_from_github_actions_ci_service(
467467
ci_info,
468468
)
469469

@@ -473,7 +473,7 @@ def find_provenance_from_ci(self, analyze_ctx: AnalyzeContext, git_obj: Git | No
473473
return None
474474

475475

476-
def download_provenances_from_github_actions_ci_service(self, ci_info: CIInfo) -> None:
476+
def download_provenances_from_github_actions_ci_service(ci_info: CIInfo) -> None:
477477
"""Download provenances from GitHub Actions.
478478
479479
Parameters

src/macaron/slsa_analyzer/analyzer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
check_if_input_repo_commit_provenance_conflict,
4242
extract_repo_and_commit_from_provenance,
4343
)
44-
from macaron.repo_finder.provenance_finder import ProvenanceFinder
44+
from macaron.repo_finder.provenance_finder import ProvenanceFinder, find_provenance_from_ci
4545
from macaron.slsa_analyzer import git_url
4646
from macaron.slsa_analyzer.analyze_context import AnalyzeContext
4747
from macaron.slsa_analyzer.asset import VirtualReleaseAsset
@@ -322,6 +322,7 @@ def run_single(
322322
status=SCMStatus.ANALYSIS_FAILED,
323323
)
324324

325+
provenance_is_verified = False
325326
if not provenance_payload and parsed_purl:
326327
# Try to find the provenance file for the parsed PURL.
327328
provenance_finder = ProvenanceFinder()
@@ -440,7 +441,7 @@ def run_single(
440441

441442
if not provenance_payload:
442443
# Look for provenance using the CI.
443-
provenance_payload = ProvenanceFinder().find_provenance_from_ci(analyze_ctx, git_obj)
444+
provenance_payload = find_provenance_from_ci(analyze_ctx, git_obj)
444445
# If found, verify analysis target against new provenance
445446
if provenance_payload:
446447
# If repository URL was not provided as input, check the one found during analysis.
@@ -1191,7 +1192,7 @@ def perform_checks(self, analyze_ctx: AnalyzeContext) -> dict[str, CheckResult]:
11911192
service=ci_service,
11921193
callgraph=callgraph,
11931194
provenance_assets=[],
1194-
latest_release={},
1195+
release={},
11951196
provenances=[
11961197
SLSAProvenanceData(
11971198
payload=InTotoV01Payload(statement=Provenance().payload),

src/macaron/slsa_analyzer/checks/provenance_available_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def run_check(self, ctx: AnalyzeContext) -> CheckResultData:
7171
CheckResultData
7272
The result of the check.
7373
"""
74-
available = True if (not ctx.dynamic_data["is_inferred_prov"] and ctx.dynamic_data["provenance"]) else False
74+
available = ctx.dynamic_data["provenance"] and not ctx.dynamic_data["is_inferred_prov"]
7575
return CheckResultData(
7676
result_tables=[
7777
ProvenanceAvailableFacts(

0 commit comments

Comments
 (0)