Skip to content

(MIDRC-1276) Add pre-filtering in funnel query for listing tasks - #164

Open
george42-ctds wants to merge 7 commits into
masterfrom
fix/pre-filter-task-list
Open

(MIDRC-1276) Add pre-filtering in funnel query for listing tasks#164
george42-ctds wants to merge 7 commits into
masterfrom
fix/pre-filter-task-list

Conversation

@george42-ctds

@george42-ctds george42-ctds commented Jul 10, 2026

Copy link
Copy Markdown

JIRA ticket:MIDRC-1276

New Features

Breaking Changes

Bug Fixes

  • add tag_key and tag_value to funnel task query to get only tasks for user. Optional all flag allows getting all tasks in funnel query.

Improvements

Dependency updates

Deployment changes

@github-actions

Copy link
Copy Markdown

The style in this PR agrees with black. ✔️

This formatting comment was generated automatically by a script in uc-cdis/wool.

@coveralls

coveralls commented Jul 10, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29771115552

Coverage increased (+0.5%) to 83.598%

Details

  • Coverage increased (+0.5%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 17 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

17 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
routes/ga4gh_tes.py 17 89.94%

Coverage Stats

Coverage Status
Relevant Lines: 945
Covered Lines: 790
Line Coverage: 83.6%
Coverage Strength: 0.84 hits per line

💛 - Coveralls

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

Test summary after running integration tests

filepath passed failed error skipped SUBTOTAL
tests/test_gen3_workflow.py 18 3 7 1 29
TOTAL 18 3 7 1 29

Test summary after rerunning failed integration tests

filepath passed SUBTOTAL
tests/test_gen3_workflow.py 10 10
TOTAL 10 10

Please find the detailed integration test report here

Please find the detailed integration test report after rerunning failed tests here

Please find the Github Action logs here

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

Test summary after running integration tests

filepath passed failed skipped SUBTOTAL
tests/test_gen3_workflow.py 27 1 1 29
TOTAL 27 1 1 29

Test summary after rerunning failed integration tests

filepath passed SUBTOTAL
tests/test_gen3_workflow.py 1 1
TOTAL 1 1

Please find the detailed integration test report here

Please find the detailed integration test report after rerunning failed tests here

Please find the Github Action logs here

Comment thread gen3workflow/routes/ga4gh_tes.py Outdated
TAGS_HIDDEN_FROM_USER.remove("_AUTHZ")


def get_auth_string_for_user(user_id: str) -> str:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def get_auth_string_for_user(user_id: str) -> str:
def get_authz_string_for_user(user_id: str) -> str:

Comment on lines 313 to 314
# filter out tasks the current user does not have access to
listed_tasks["tasks"] = [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should not need to get the user's access and filter the tasks when we're already filtering on the _AUTHZ tag. But that means we'd 100% trust the TES server to filter tasks properly.

I'd say let's leave it in, but add a comment stating this^?

Comment thread gen3workflow/routes/ga4gh_tes.py Outdated
@router.get("/tasks/", status_code=HTTP_200_OK, include_in_schema=False)
async def list_tasks(request: Request, auth=Depends(Auth)) -> dict:
async def list_tasks(
request: Request, auth=Depends(Auth), all: str | None = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The all param needs to be documented

Example of how to do it here

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 28 1 29
TOTAL 28 1 29

Please find the detailed integration test report here

Please find the Github Action logs here

Comment thread gen3workflow/routes/ga4gh_tes.py Outdated
raise HTTPException(e.code, e.message)

# filter out tasks the current user does not have access to
# this should be redundant if all is None but is included in case pre-filtering fails

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# this should be redundant if all is None but is included in case pre-filtering fails
# this should be redundant if all is None but is included in case server-side filtering fails

Comment thread gen3workflow/routes/ga4gh_tes.py Outdated
request: Request,
auth=Depends(Auth),
all: str = Query(
None, description="Get all TES tasks without pre-filtering on _AUTHZ"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The description should be user-friendly because that's what goes into the auto-generated swagger doc. Maybe something like "If true, retrieves all the TES tasks you may have access to, instead of just your own. Default: false"?

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

Test summary after running integration tests

filepath passed failed skipped SUBTOTAL
tests/test_gen3_workflow.py 27 1 1 29
TOTAL 27 1 1 29

Test summary after rerunning failed integration tests

filepath passed SUBTOTAL
tests/test_gen3_workflow.py 1 1
TOTAL 1 1

Please find the detailed integration test report here

Please find the detailed integration test report after rerunning failed tests here

Please find the Github Action logs here

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 28 1 29
TOTAL 28 1 29

Please find the detailed integration test report here

Please find the Github Action logs here

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.

3 participants