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

feat: adds task type SYSTEM_USER_ALL_TASKDATA #83

Merged
merged 2 commits into from
May 14, 2024
Merged

Conversation

mikeshultz
Copy link
Contributor

What I did

Adds TaskType.SYSTEM_USER_ALL_TASKDATA to fetch all user defined tasks in one job.

Checklist

  • Passes all linting checks (pre-commit and CI jobs)
  • New test cases have been added and are passing
  • Documentation has been updated
  • PR title follows Conventional Commit standard (will be automatically included in the changelog)

@mikeshultz mikeshultz added the enhancement New feature or request label May 14, 2024
@mikeshultz mikeshultz self-assigned this May 14, 2024
@mikeshultz mikeshultz requested a review from fubuloubu May 14, 2024 02:47
@@ -136,6 +139,9 @@ def __get_user_taskdata_handler(self, task_type: TaskType) -> list[TaskData]:
assert str(task_type).startswith("user:"), "Can only fetch user task data"
return self.tasks.get(task_type, [])

def __get_user_all_taskdata_handler(self) -> list[TaskData]:
Copy link
Member

Choose a reason for hiding this comment

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

Can probably just return the full dict with this new method

Originally made the other task segment by single task type so that in case we want dynamic registration there might be some measn of handling that (like say the app startup task registers a bunch of runtime tasks)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The full dict isn't needed. Task types are in labels so it's simpler to just iterate over them all and process them that way.

@mikeshultz mikeshultz merged commit 8e89008 into main May 14, 2024
22 checks passed
@mikeshultz mikeshultz deleted the feat/all-taskdata branch May 14, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants