Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-run store_derived_evidence fetchers #161

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Conversation

rhyshort
Copy link
Contributor

What

Ensure store_derived_evidence fetchers are re-run if dependent evidence is not yet available, this is achieved by get_evidence_dependency, rather than get_evidence_by_path.

Why

When running fetchers that store derived evidence, they often rely on evidence from previous fetchers, however if this evidence is not available the fetcher fails and is not automatically re-run because the store_derived_evidence function does not treat source evidence as dependency that can be re-run.

How

  • Replace get_evidence_by_path call to get_evidence_dependency call in the decorator wrapper function.

Test

  • Validated the current tests pass
  • Validated the evidence is re-run

Context

@drsm79
Copy link
Contributor

drsm79 commented Aug 16, 2024

Good to hear from you Rhys. Is it possible to test the condition you describe? And show it fail before and succeed after the patch?

@rhyshort
Copy link
Contributor Author

Yeah, I'll get the test case written

Ensure store_derived_evidence fetchers are re-run if dependant evidence
is not yet available, this is achieved by get_evidence_dependency,
rather than get_evidence_by_path.
@rhyshort
Copy link
Contributor Author

done

@cletomartin
Copy link
Collaborator

Thanks Rhys!

@rhyshort
Copy link
Contributor Author

@cletomartin I don't have commit rights, could you merge please? 😄

@drsm79 drsm79 merged commit 7ffa114 into ComplianceAsCode:main Aug 20, 2024
1 check passed
@drsm79
Copy link
Contributor

drsm79 commented Aug 20, 2024

Merging, thanks @rhyshort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants