Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-1090

[bulk-import][backend] Implement Server-side sorting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • Bulk Import Plugin
    • None
    • False
    • Hide

      None

      Show
      None
    • 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 createdupdatedpushedfull_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 starsforks, 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 

       
       
       
       
       

              Unassigned Unassigned
              dsantra12 Debsmita Santra
              RHIDP - Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: