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

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

Fix for task id as valid UUID #3744

wants to merge 16 commits into from

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
@@ -299,14 +299,15 @@ def list_tasks(self, **kwargs) -> PaginatedTasksResponse:
filter_key = "filters"
params = {k: v for k, v in kwargs.items() if v is not None if k != filter_key} # filter Nones from kwargs
endpoint = "/tasks"
res = self._client.post(endpoint, params=params, json=kwargs.get(filter_key, None))
res = self._client.post(endpoint, params=params, json=kwargs.get(filter_key))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is automatically removed and is not part of this PR. None is already a default return value.

@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

@@ -57,6 +57,7 @@ def get_context_data(self, **kwargs):
class NormalizerTaskJSONView(TaskDetailView):
task_type = "normalizer"
plugin_type = "normalizer"
template_name = "tasks/normalizer_task_detail.html"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My test failed on this part, because it was missing the template name

@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
Copy link

sonarcloud bot commented Nov 21, 2024

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

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
3 participants