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

Fix for task id as valid UUID #3744

Merged
merged 18 commits into from
Nov 27, 2024
Merged

Fix for task id as valid UUID #3744

merged 18 commits into from
Nov 27, 2024

Conversation

Rieven
Copy link
Contributor

@Rieven Rieven commented Oct 28, 2024

Changes

  • When fetching a task by id, we do not check if the string is a valid UUID.
  • check POST task id is a valid UUID

Issue link

#3743

Closes #3743

Demo

image

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.

@Rieven Rieven requested a review from a team as a code owner October 28, 2024 13:25
@Rieven Rieven changed the title fix for string as valid UUID Fix for task id as valid UUID Oct 28, 2024
@Rieven
Copy link
Contributor Author

Rieven commented Oct 28, 2024

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

We should exclude tests from covarage

@Rieven Rieven self-assigned this Nov 18, 2024
underdarknl
underdarknl previously approved these changes Nov 19, 2024
ammar92
ammar92 previously approved these changes Nov 19, 2024
@Rieven Rieven dismissed stale reviews from underdarknl and ammar92 via b6ad6d2 November 20, 2024 15:02
@dekkers
Copy link
Contributor

dekkers commented Nov 26, 2024

Quality Gate Failed Quality Gate failed

Failed conditions 70.6% Coverage on New Code (required ≥ 80%)
See analysis details on SonarCloud

We should exclude tests from covarage

We shouldn't and that isn't a problem here. The test code has 100% coverage, the code that should be tested is missing coverage:

image

@Rieven
Copy link
Contributor Author

Rieven commented Nov 26, 2024

Quality Gate Failed Quality Gate failed

Failed conditions 70.6% Coverage on New Code (required ≥ 80%)
See analysis details on SonarCloud

We should exclude tests from covarage

We shouldn't and that isn't a problem here. The test code has 100% coverage, the code that should be tested is missing coverage:

image

I was a bit confused that lines to cover is also counted for test files, but may has nothing to do with the covarage calculations?
image

@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:

Changing the uuid of the task to something non-existing results in a 404.

What doesn't work:

n/a

Bug or feature?:

n/a

Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@underdarknl underdarknl merged commit 2586547 into main Nov 27, 2024
20 of 22 checks passed
@underdarknl underdarknl deleted the fix/task-id-as-uuid branch November 27, 2024 10:40
jpbruinsslot added a commit that referenced this pull request Nov 27, 2024
* main:
  Increase max number of PostgreSQL connections (#3889)
  Fix for task id as valid UUID (#3744)
  Add `auto_calculate_deadline` attribute to Scheduler (#3869)
  Ignore specific url parameters when following location headers (#3856)
  Let mailserver inherit l1 (#3704)
  Change plugins enabling in report flow to checkboxes (#3747)
  Fix rocky katalogus tests and delete unused fixtures (#3884)
  Enable/disable scheduled reports (#3871)
jpbruinsslot added a commit that referenced this pull request Nov 27, 2024
* main: (60 commits)
  Increase max number of PostgreSQL connections (#3889)
  Fix for task id as valid UUID (#3744)
  Add `auto_calculate_deadline` attribute to Scheduler (#3869)
  Ignore specific url parameters when following location headers (#3856)
  Let mailserver inherit l1 (#3704)
  Change plugins enabling in report flow to checkboxes (#3747)
  Fix rocky katalogus tests and delete unused fixtures (#3884)
  Enable/disable scheduled reports (#3871)
  optimize locking in katalogus.py, reuse available data (#3752)
  Updates boefje clearances and descriptions (#3863)
  Fixes for empty tables (#3844)
  Fix cron for last day of the month (#3831)
  Sub reports for Aggregate Report (#3852)
  Add start time to scheduled reports (#3809)
  Add configuration setting for number of octopoes workers (#3796)
  Limit requesting prior tasks for ranking in scheduler (#3836)
  Let local plugins (files) take precedence over database entries (#3858)
  Skip empty queues in the Rocky worker (#3860)
  Report types listed in a modal @ report plugins (#3718)
  Support a Schedule without a schedule in scheduler (#3834)
  ...
jpbruinsslot added a commit that referenced this pull request Dec 2, 2024
* main: (64 commits)
  Bug fix: KAT-alogus parameter is now organization member instead of organization code (#3895)
  Remove sigrid workflows (#3920)
  Updated packages (#3898)
  Fix mula migrations Debian package (#3919)
  Adds loggers to report flow (#3872)
  Add additional check if task already run for report scheduler (#3900)
  Create separate finding for Microsoft RDP port (#3882)
  fix: 🐛 allow boefje completion with 404 (#3893)
  Feature/improve rename bulk modal (#3885)
  Update scheduler folder structure (#3883)
  Translations update from Hosted Weblate (#3870)
  Increase max number of PostgreSQL connections (#3889)
  Fix for task id as valid UUID (#3744)
  Add `auto_calculate_deadline` attribute to Scheduler (#3869)
  Ignore specific url parameters when following location headers (#3856)
  Let mailserver inherit l1 (#3704)
  Change plugins enabling in report flow to checkboxes (#3747)
  Fix rocky katalogus tests and delete unused fixtures (#3884)
  Enable/disable scheduled reports (#3871)
  optimize locking in katalogus.py, reuse available data (#3752)
  ...
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.

Fix task id as valid UUID
5 participants