Skip to content

feat(platform): add 'for_organization' to list all runs of an org#510

Open
akunft wants to merge 4 commits intomainfrom
feat/list_runs_for_org
Open

feat(platform): add 'for_organization' to list all runs of an org#510
akunft wants to merge 4 commits intomainfrom
feat/list_runs_for_org

Conversation

@akunft
Copy link
Copy Markdown
Collaborator

@akunft akunft commented Mar 25, 2026

Adds for_organization parameter to Runs.list and Runs.list_data: If set, returns all runs triggered by users of the specified organization that match the filter criteria. If None, only the runs of the user are returned.

  • Now also allows to set for_organization in the service & cli

Copilot AI review requested due to automatic review settings March 25, 2026 21:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an organization-scoped filter to the Platform Runs resource so admins/superadmins can list runs for a whole organization, not just the current user, while keeping existing filters and pagination behavior.

Changes:

  • Added for_organization parameter to Runs.list() and Runs.list_data() and propagated it into the API call.
  • Updated unit test coverage to assert for_organization is passed through when combining all filters.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/aignostics/platform/resources/runs.py Exposes for_organization on Runs.list / Runs.list_data and forwards it to list_runs_v1_runs_get.
tests/aignostics/platform/resources/runs_test.py Extends the “all filters combined” test to include for_organization.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/aignostics/application/_service.py 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/aignostics/application/_cli.py 70.30% <100.00%> (-1.79%) ⬇️
src/aignostics/platform/__init__.py 100.00% <100.00%> (ø)
src/aignostics/platform/resources/runs.py 65.21% <ø> (ø)
src/aignostics/application/_service.py 60.96% <0.00%> (-3.44%) ⬇️

... and 5 files with indirect coverage changes

@akunft
Copy link
Copy Markdown
Collaborator Author

akunft commented Mar 26, 2026

From offline discussion: Make available in CLI (if not auto-discovered).

Copilot AI review requested due to automatic review settings March 26, 2026 17:18
@akunft akunft force-pushed the feat/list_runs_for_org branch from 00153c7 to c136907 Compare March 26, 2026 17:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

@akunft akunft force-pushed the feat/list_runs_for_org branch from c136907 to 8aaf95d Compare March 30, 2026 12:51
@sonarqubecloud
Copy link
Copy Markdown

@akunft akunft requested a review from arne-aignx March 30, 2026 13:32
@arne-aignx
Copy link
Copy Markdown
Contributor

LGTM.
Nice solution for the user error messages depending on the scope

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