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

Limit requesting prior tasks for ranking in scheduler #3836

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

jpbruinsslot
Copy link
Contributor

@jpbruinsslot jpbruinsslot commented Nov 13, 2024

Changes

Limit requesting prior task in the BoefjeScheduler for ranking. At the moment we don't leverage ranking of tasks based on prior task runs. At least we should limit the number of tasks. This PR will limit this to the last task that has run, since the ranker only uses the last run task at the moment.

QA notes

Nothing really to QA here. We limit the number of tasks we retrieve from the database to make ranking a bit more optimized. Regular running of scanning jobs should continue to work. Mainly rescanning a job that has already been executed can be tested to make sure that it continues to work.


Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@jpbruinsslot jpbruinsslot added the mula Issues related to the scheduler label Nov 13, 2024
@jpbruinsslot jpbruinsslot self-assigned this Nov 13, 2024
@jpbruinsslot jpbruinsslot requested a review from a team as a code owner November 13, 2024 14:17
Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. Tiny question, looks good otherwise

mula/scheduler/rankers/boefje.py Show resolved Hide resolved
@stephanie0x00
Copy link
Contributor

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.
  • I checked the logs for errors and/or warnings and made issues where necessary

What works:

Looks good. Onboarding works, rescheduling of tasks works and reports can also be (re)scheduled.

What doesn't work:

N/a

Bug or feature?:

N/a

Copy link

sonarcloud bot commented Nov 20, 2024

@underdarknl underdarknl merged commit 1d1cfb5 into main Nov 21, 2024
21 of 22 checks passed
@underdarknl underdarknl deleted the fix/mula/limit-prior-tasks branch November 21, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mula Issues related to the scheduler
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants