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

Merge cleanup tasks into a single Housekeeping task #829

Closed
wants to merge 11 commits into from

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Aug 7, 2024

Description

Warning

This PR is based on #805 and #794.

Merges cleanup tasks into a single Housekeeping task.

Addressed Issue

N/A

Additional Details

Before #794, we already had:

  • VulnerabilityScanCleanupTask: Deletes all VULNERABILITYSCAN records that have not been updated for over an hour.
  • WorkflowStateCleanupTask
    • Transitions WORKFLOW_STATE records from STATUS=PENDING to STATUS=TIMED_OUT that have not been updated for a configurable duration.
    • Transitions WORKFLOW_STATE records from STATUS=TIMED_OUT to STATUS=FAILED that have not been updated for a configurable duration.
    • Cancels all child WORKFLOW_STEP records that had their parent transitioned to STATUS=FAILED
    • Deletes all WORKFLOW_STATE records that have not been updated for a configurable retention time.

With #794, a new task for enforcing BOM upload retention would've been necessary. And there are more cases in which we'd benefit from retention enforcement (added TODOs in the code for those).

It's easier to configure, and reason about these things if there's only a single task that executes them.

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

It doesn't make sense that plugins are defined by DT, and cannot be provided by users. Instead, DT defines "extension points", for which plugins can provide implementations ("extensions").

This change also enabled plugins to provide multiple extensions, not just one.

Signed-off-by: nscuro <[email protected]>
Making it easier to eventually move the API to a separate module altogether.

Signed-off-by: nscuro <[email protected]>
Plugin and extension names are not necessarily unique, but in combination with their classes, they should be. So always include both the name and class in log statements to avoid any ambiguity.

Make use of MDC to ensure consistent inclusion of contextual information in log statement.

Signed-off-by: nscuro <[email protected]>
@nscuro nscuro added enhancement New feature or request technical debt labels Aug 7, 2024
@nscuro nscuro added this to the 5.6.0 milestone Aug 7, 2024
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.12% (target: -1.00%) 83.39% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (990039d) 21021 17284 82.22%
Head commit (b15bd91) 21460 (+439) 17619 (+335) 82.10% (-0.12%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#829) 608 507 83.39%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@nscuro nscuro marked this pull request as draft August 8, 2024 13:39
@nscuro
Copy link
Member Author

nscuro commented Aug 8, 2024

Superseded by #840. That PR does not depend on #805.

@nscuro nscuro closed this Aug 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant