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

Scheduler extra models #3749

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Scheduler extra models #3749

wants to merge 12 commits into from

Conversation

jpbruinsslot
Copy link
Contributor

@jpbruinsslot jpbruinsslot commented Oct 29, 2024

Changes

Changes made the the rest API server, fall more in line with fastapi conventions

Issue link

Closes #3711 (comment)

QA notes

Please add some information for QA on how to test the newly created code.


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 Oct 29, 2024
@jpbruinsslot jpbruinsslot self-assigned this Oct 29, 2024
* main:
  Fix reports with organization tags (#3790)
  Update README.rst - Fix guidelines URLs (#3789)
  Exclude Report from ooi list (#3768)
  Update `croniter` (#3767)
  Fixes for dropdowns (#3732)
  Fix scheduled Aggregate Report naming (#3748)
  Make systemctl call for kat-rocky-worker conditional (#3782)
  Fix vulnerability chapters in Aggregate table of content (#3780)
  Fix auth token middleware with wrong format header (#3755)
  Add rocky REST API for report recipes (#3746)
  Add exception handling to the rest api (#3708)
  Refactor Multi Report to comply to the new report flow (#3705)
  Fix report names for scheduled reports (#3726)
  Fix Multi Report recursion error (#3714)
  Bump waitress from 3.0.0 to 3.0.1 in /octopoes (#3760)
  Docs/add muted findings (#3699)
  Edit report recipe (#3690)
  Add start date to report schedule (#3701)
  Add REST API to list report and download pdf report (#3689)
  Fixes in Report Overview (#3707)
model_config = ConfigDict(from_attributes=True, use_enum_values=True)

# FIXME: pushing the same item with the id will update the item on the
# queue. Perhaps TaskCreate is not the right name for this and should
# be TaskPush instead, or in both cases TaskUpdate
id: uuid.UUID | None = None
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to have the id present in the model, this is done to support the functionality of pushing the same task on the queue will update it. Meaning, pushing the same item with the id will update the item on the queue. Perhaps TaskCreate is not the right name for this and should be TaskPush instead, or in both cases TaskUpdate.

We can also opt for moving away from this functionality. Since it is a feature for queues in order to update the same item by pushing it on again this doesn't seem to be a feature that is used. Since it's inception we've moved away from an in-memory queue, and updating the task can be done from other avenues.

Copy link

sonarqubecloud bot commented Nov 6, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
79.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@jpbruinsslot jpbruinsslot marked this pull request as ready for review November 13, 2024 14:19
@jpbruinsslot jpbruinsslot requested a review from a team as a code owner November 13, 2024 14:19
@@ -9,13 +9,13 @@
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"level": "DEBUG",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops

@@ -32,3 +32,9 @@ def test_toggle_expire(self):

with self.assertRaises(utils.ExpiredError):
ed.get("a")

def test_key_error(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not related to this pr, need to remove

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
None yet
Development

Successfully merging this pull request may close these issues.

fastapi conventions for 'out' and 'in' models for rest api in scheduler
1 participant