Skip to content

Add order_by parameter to GET /permissions for pagination consistency - #63418

Merged
vincbeck merged 1 commit into
apache:mainfrom
henry3260:add-order-by-in-get-permission-route
Mar 12, 2026
Merged

Add order_by parameter to GET /permissions for pagination consistency#63418
vincbeck merged 1 commit into
apache:mainfrom
henry3260:add-order-by-in-get-permission-route

Conversation

@henry3260

Copy link
Copy Markdown
Contributor

GET /permissions lacked the order_by parameter present on other list endpoints (e.g. GET /roles), causing non-deterministic pagination.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@henry3260
henry3260 requested a review from vincbeck as a code owner March 12, 2026 08:46
Copilot AI review requested due to automatic review settings March 12, 2026 08:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 order_by query parameter to GET /permissions in the FAB auth manager FastAPI API so pagination is deterministic and consistent with other list endpoints.

Changes:

  • Add order_by support to the permissions service query (including SQL ORDER BY).
  • Add order_by query parameter to the /permissions route and pass it to the service.
  • Update/add unit tests and update the generated OpenAPI spec to include the new query parameter.

Reviewed changes

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

Show a summary per file
File Description
providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/services/roles.py Add ordering support to get_permissions() via build_ordering() and .order_by(...).
providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/routes/roles.py Add order_by query param (default id) and pass through to the service.
providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/openapi/v2-fab-auth-manager-generated.yaml Document the new order_by query parameter in OpenAPI.
providers/fab/tests/unit/fab/auth_manager/api_fastapi/services/test_roles.py Update existing tests for new signature and add ordering/invalid-order tests.
providers/fab/tests/unit/fab/auth_manager/api_fastapi/routes/test_roles.py Update route test expectations and add tests for passing order_by and limit clamping behavior.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/routes/roles.py Outdated
Comment thread providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/routes/roles.py Outdated
Comment thread providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/routes/roles.py Outdated
GET /permissions lacked the order_by parameter present on other list
endpoints (e.g. GET /roles), causing non-deterministic pagination.
@henry3260
henry3260 force-pushed the add-order-by-in-get-permission-route branch from 09444a9 to 7ac9089 Compare March 12, 2026 09:02
@vincbeck
vincbeck merged commit 7b8c6ff into apache:main Mar 12, 2026
88 checks passed
@henry3260
henry3260 deleted the add-order-by-in-get-permission-route branch March 12, 2026 16:20
Pyasma pushed a commit to Pyasma/airflow that referenced this pull request Mar 13, 2026
…apache#63418)

GET /permissions lacked the order_by parameter present on other list
endpoints (e.g. GET /roles), causing non-deterministic pagination.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants