Incorrect invocation.configSource.uri value for inferred provenance value.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 210
- Forks
- 36
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 2
Description
How to replicate
Run this command:
macaron analyze -rp https://github.com/ben-manes/caffeine.git --skip-deps
Because this repository doesn't have a provenance that Macaron can detect, Macaron put an inferred provenance in the final JSON report.
The content of the JSON report of this analysis is as follow:
...
"invocation": {
"configSource": {
"uri": "https://github.com/ben-manes/caffeine@refs/heads/None",
...
Description
The logic for generating the content of invocation.configSource.uri for the inferred provenance is located here:
predicate["invocation"]["configSource"]["uri"] = (
f"{ctx.component.repository.remote_path}"
f"@refs/heads/{ctx.component.repository.branch_name}"
)
In scenarios where the branch name is not available, the content of this uri will be incorrect
Suggestion
If the branch name is not available for this software component, we can use f"{ctx.component.repository.remote_path}" only without f"@refs/heads/{ctx.component.repository.branch_name}"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/macaron/slsa_analyzer/checks/build_as_code_check.py around the inferred provenance logic, then run the documented macaron analyze command against the caffeine repository. Check the generated invocation.configSource.uri when branch_name is unavailable; done means it no longer includes the literal None suffix while retaining the repository remote path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100