-
Notifications
You must be signed in to change notification settings - Fork 59
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
Boefje runonce functionality in scheduler #3906
Conversation
Looks like this should do the trick! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work and tests 👍 Just a few things to consider, let me know what you think
mula/scheduler/models/plugin.py
Outdated
@@ -19,3 +19,4 @@ class Plugin(BaseModel): | |||
produces: list[str] | |||
cron: str | None = None | |||
interval: int | None = None | |||
runon: list[str] | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runon doesn't exist in the dictionary
runon: list[str] | None = None | |
run_on: list[str] | None = None |
I was also wondering, is it a str
or should it be a list of predefined choices? But perhaps this could even be mapped to MutationOperationType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could support both the string and the multiple option, however when we create a schema for the boefjes Im guessing it would be best to go for just the list.
This works well. How I tested:
|
|
* main: (21 commits) Bump django from 5.0.9 to 5.0.10 in /rocky (#3940) Do not let enabling plugins affect the global plugin cache (#3944) Fix typing in more places and configure mypy to follow imports (#3932) Updates CWE archive to 4.16 (#3943) Report flaws (#3880) Translations update from Hosted Weblate (#3939) Fix report recipe API (#3942) Boefje runonce functionality in scheduler (#3906) fix: 🔨 do not store CDN findings (#3931) Dont check for Locations on local Ip's. (#3894) add unpkg.com to disallowed hostnames in CSP (#3927) Update website_discovery.py (#3921) Add export http boefje (#3901) Bump python-multipart from 0.0.9 to 0.0.18 in /bytes (#3925) Fix layout issues on scheduled reports page (#3930) Create scheduled report with zero objects selectable (#3907) Improve the KATalogus `/plugins` endpoint performance (#3892) Add bgp.jsonl and bgp-meta.json to .gitignore (#3928) Update pre-commit and all hooks (#3923) add support for detecting Lame dns delegations on ip ranges (#3899) ...
Changes
With the specification on the plugin definition of
runon
theBoefjeScheduler
should be able to discern between task that needs to run once or that aschedule
needs to be created, and based on what type of mutation (CREATE
,UPDATE
).When a
schedule
or when a task needs to be run is laid out in this table #3879 (comment)Note that the
create_schedule
attribute on aScheduler
always takes precedence. When this is set toFalse
under no circumstances aschedule
will be created. As is the case with theNormalizerScheduler
.Reviewer notes
Tests for the outcomes of the mentioned table should be made. This is as of yet untested, but can be reviewed, and qa'ed.UPDATE: tests have been added.Issue link
Closes #3879
QA notes
Should be able to work with the following pr #3901
Reference this table #3879 (comment)
These paths should be tested, please additionally test some of the task to rescan and see what happens.
Code Checklist
.env
changes files if required and changed the.env-dist
accordingly.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.