The values stored within some CheckFacts instances are not consistent.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 210
- Forks
- 36
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 2
Description
During my exploration, I noticed something with our current setup of checks.
Let's take the build as code check as an example. The build as code check will create instances of BuildAsCodeFacts https://github.com/oracle/macaron/blob/39bd296051e31dae94ab5683b7537559ace1d511/src/macaron/slsa_analyzer/checks/build_as_code_check.py#L37
Those instances stores information that will later be put into the SQLite database. A BuildAsCodeFacts instance has an attribute called deploy_command. At some places, the value stored to this attribute is a JSON - serialized value (e.g. https://github.com/oracle/macaron/blob/39bd296051e31dae94ab5683b7537559ace1d511/src/macaron/slsa_analyzer/checks/build_as_code_check.py#L262).
At other places, it's stored as a string without going through serialization: https://github.com/oracle/macaron/blob/39bd296051e31dae94ab5683b7537559ace1d511/src/macaron/slsa_analyzer/checks/build_as_code_check.py#L201 and https://github.com/oracle/macaron/blob/39bd296051e31dae94ab5683b7537559ace1d511/src/macaron/slsa_analyzer/checks/build_as_code_check.py#L291
This could be an issue if someone wants to read this field as the format is not consistent.
In additions, this issue also happens to build service check with BuildServiceFacts's build_command attribute https://github.com/oracle/macaron/blob/39bd296051e31dae94ab5683b7537559ace1d511/src/macaron/slsa_analyzer/checks/build_service_check.py#L47
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 in src/macaron/slsa_analyzer/checks/build_as_code_check.py, comparing every assignment to BuildAsCodeFacts.deploy_command, then inspect build_service_check.py and BuildServiceFacts.build_command. Determine the intended single representation for these values and trace how the facts are stored in SQLite. Done means both attributes use the same format at all shown assignment sites and persisted values are consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlite
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100