-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
False
-
-
False
-
Release Note Not Required
-
-
-
Low
This is needed in the backend to address https://issues.redhat.com/browse/RHIDP-4949
Acceptance Criteria
- Add a sort query param to the following endpoints in the OpenAPI schema:
-
- `GET /organizations`
- `GET /repositories`
- `GET /organizations/:orgName/repositories`
`GET /imports`
- Generate the types definitions and docs
- Update the endpoint handlers to handle this new query parameter
Notes
- GET `/organizations/:orgName/repositories` is hitting GET /orgs/{org}/repos of Github API which support sorting on created, updated, pushed, full_name . Here details from Documentation
sort string The property to sort the results by. Default: created Can be one of: created, updated, pushed, full_name
- `GET /repositories` is hitting `/search/repositories` GitHub Search repositories API which support sorting based on stars, forks, or help-wanted-issues or how recently the items were updated . It does not support sorting based on name , organization or url . Details from Github Search Api documentation here .
sort string Sorts the results of your query by number of stars, forks, or help-wanted-issues or how recently the items were updated. Default: best match Can be one of: stars, forks, help-wanted-issues, updated
- GET /organizations
The endpoint behavior depends on the type of credentials used:
1. GitHub App Credential
Fetches all organizations accessible by the GitHub App . Hence sorting can be supported
2. Personal Access Token (PAT)
- With Search Text: Fetches all organizations and then filtering orgs matching the search text.Hence sorting can be supported.
- Without Search Text: Fetches only the organizations required for display using octokit.rest.orgs.listForAuthenticatedUser which does not support as per GitHub documentation . In this case also we can fetch all orgs at once and support sorting .
GET /imports :
Fetching all the imports , hence sorting can be supported
- blocks
-
RHDHBUGS-1033 [Bulk import] Apply sorting on all repositories rather that only the visible rows
-
- New
-
- clones
-
RHIDP-3884 [bulk-import][backend] Implement Server-side search
-
- Closed
-