Uploaded image for project: 'Red Hat Internal Developer Platform'
  1. Red Hat Internal Developer Platform
  2. RHIDP-4016

[bulk-import][backend] Modify `GET /imports` response structure to include the total count and pagination info

Prepare for Y ReleasePrepare for Z ReleaseRemove QuarterXMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 1.4
    • 1.3
    • Bulk Import Plugin
    • None
    • RHDH Core Team 3263

      Otherwise, this breaks the current pagination in the UI, since there is no info about the total count of Import jobs.

      This also makes it consistent with how the other paginated endpoints (like `GET /organizations`, `GET /repositories`, and `GET /organizations/:org/repositories`) work.

      The structure can look like:

      {
         "errors": [],
         "imports":[
            {
               "approvalTool":"GIT",
               "id":"https://github.com/lemra-org-ent-2/animated-happiness",
               "lastUpdate":"2024-09-12T14:26:08Z",
               "repository":{
                  "defaultBranch":"main",
                  "id":"lemra-org-ent-2/animated-happiness",
                  "name":"animated-happiness",
                  "organization":"lemra-org-ent-2",
                  "url":"https://github.com/lemra-org-ent-2/animated-happiness"
               },
               "status":"ADDED"
            }
         ],
         "totalCount":10,
         "page":2,
         "size":1
      }

      NOTES:

      • Changing the API response structure will require an update in the clients (frontend plugin)
      • There is no API versioning in place and there is currently no plan to add it (to minimize the maintenance overhead) => to alleviate breaking changes, support for API versioning has been added, based on the 'api-version' request header.

              rh-ee-asoro Armel Soro
              rh-ee-asoro Armel Soro
              RHIDP - Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: