Skip to content

RHIDP 7065: gitlab bulk import backend support#1336

Merged
AndrienkoAleksandr merged 23 commits intoredhat-developer:mainfrom
lholmquist:RHIDP-7065-gitlab-bulk-import-backend-support
Sep 19, 2025
Merged

RHIDP 7065: gitlab bulk import backend support#1336
AndrienkoAleksandr merged 23 commits intoredhat-developer:mainfrom
lholmquist:RHIDP-7065-gitlab-bulk-import-backend-support

Conversation

@lholmquist
Copy link
Copy Markdown
Member

Hey, I just made a Pull Request!

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app bot commented Aug 19, 2025

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-bulk-import-backend workspaces/bulk-import/plugins/bulk-import-backend minor v6.2.0

@lholmquist lholmquist force-pushed the RHIDP-7065-gitlab-bulk-import-backend-support branch 2 times, most recently from 32cc565 to d89fee6 Compare August 25, 2025 14:39
@lholmquist lholmquist marked this pull request as ready for review August 26, 2025 11:28
@lholmquist lholmquist force-pushed the RHIDP-7065-gitlab-bulk-import-backend-support branch 5 times, most recently from cb33e29 to d773ea8 Compare August 28, 2025 14:50
@lholmquist lholmquist force-pushed the RHIDP-7065-gitlab-bulk-import-backend-support branch from 556f426 to e99bc31 Compare September 2, 2025 14:35
@AndrienkoAleksandr
Copy link
Copy Markdown
Contributor

I proposed changes lholmquist#1

@lholmquist lholmquist force-pushed the RHIDP-7065-gitlab-bulk-import-backend-support branch from ae75260 to 52a42e1 Compare September 4, 2025 15:55
@lholmquist lholmquist requested review from a team and its-mitesh-kumar as code owners September 10, 2025 19:43
@lholmquist lholmquist force-pushed the RHIDP-7065-gitlab-bulk-import-backend-support branch 2 times, most recently from bca24d3 to b90d3a0 Compare September 16, 2025 12:24
Comment thread workspaces/bulk-import/plugins/bulk-import-backend/src/gitlab/utils/glUtils.ts Outdated
Copy link
Copy Markdown
Contributor

@AndrienkoAleksandr AndrienkoAleksandr left a comment

Choose a reason for hiding this comment

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

I tested your code using curl and noticed a bug — created import jobs don’t appear in the import list. I can share a patch with a quick fix as a hint, but please note that the unit test is failing. With this fix API looks working.

fix-get-imports-method-for-gitlab.patch

#Hints: My test curl commands:

list organizations:

curl -X GET "http://localhost:7007/api/bulk-import/organizations?pagePerIntegration=1&sizePerIntegration=5&search=&approvalTool=GITLAB" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${token}"

list repositories

curl -X GET "http://localhost:7007/api/bulk-import/repositories?pagePerIntegration=1&sizePerIntegration=5&search=&approvalTool=GITLAB" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${token}"

list repositories by org

curl -X GET "http://localhost:7007/api/bulk-import/organizations/my-org-2/repositories?pagePerIntegration=1&sizePerIntegration=5&search=&approvalTool=GITLAB" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${token}"

get list imports

curl -X GET "http://localhost:7007/api/bulk-import/imports?page=1&size=5&search=&sortColumn=repository.name&sortOrder=asc" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${token}"

create GitLab import

curl -X POST http://localhost:7007/api/bulk-import/imports \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${token}" \
-d '[
    {
        "approvalTool": "GITLAB",
        "codeOwnersFileAsEntityOwner": false,
        "catalogEntityName": "test-001",
        "repository": {
            "id": "logarifm6/test-001",
            "url": "https://gitlab.com/logarifm6/test-001",
            "name": "test-001",
            "organization": "logarifm6",
            "defaultBranch": "main"
        },
        "catalogInfoContent": "apiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n  name: test-001\n  annotations:\n    github.com/project-slug: logarifm6/test-001\nspec:\n  type: other\n  lifecycle: unknown\n  owner: user:default/andrienkoaleksandr\n",
        "github": {
            "pullRequest": {
                "title": "Add catalog-info.yaml config file",
                "body": "This pull request adds a **Backstage entity metadata file**\nto this repository so that the component can\nbe added to the [software catalog](http://localhost:3000/catalog).\nAfter this pull request is merged, the component will become available.\nFor more information, read an [overview of the Backstage software catalog](https://backstage.io/docs/features/software-catalog/).\nView the import job in your app [here](http://localhost:3000/bulk-import/repositories?repository=https://github.com/logarifm6/test-001&defaultBranch=main)."
            }
        }
    }
]' -v

Delete import

curl -X DELETE "http://localhost:7007/api/bulk-import/import/by-repo?repo=https://gitlab.com/logarifm6/test-001&defaultBranch=main" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${token}"

lholmquist and others added 23 commits September 18, 2025 12:32
* feat(bulk-import-backend): fix typization for @gitbeaker/rest

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>

* squash: updates to make the tests work

---------

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Co-authored-by: Oleksandr Andriienko <oandriie@redhat.com>
Co-authored-by: Christoph Jerolimov <jerolimov@gmail.com>
@lholmquist lholmquist force-pushed the RHIDP-7065-gitlab-bulk-import-backend-support branch from aea4191 to 420a33b Compare September 18, 2025 16:35
@sonarqubecloud
Copy link
Copy Markdown

@AndrienkoAleksandr AndrienkoAleksandr merged commit 60cea87 into redhat-developer:main Sep 19, 2025
10 checks passed
elai-shalev pushed a commit to elai-shalev/rhdh-plugins that referenced this pull request Jan 21, 2026
* feat(bulk-import-backend): addition of Gitlab support to the bulk-import backend.

see https://issues.redhat.com/browse/RHIDP-8281

* squash: type fixes

* squash: removing comments and todos

* squash: consolidate duplicated code

* squash: consolidate duplicated code

* squash: a little cleanup

* squash: update @gitbeaker/rest module to the latest release

* squash: prettier fix for api-docs

* squash: adding in an exclusion for the dupe tests

* squash: prettier fixes

* squash: code cleanup

* squash: more code cleanup

* squash: fixing sonarcloud secrutiy hotspots

* squash: Gitlab bulk import fix typization (redhat-developer#2)

* feat(bulk-import-backend): fix typization for @gitbeaker/rest

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>

* squash: updates to make the tests work

---------

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Co-authored-by: Oleksandr Andriienko <oandriie@redhat.com>

* squash add back the things i forgot i commented out

* squash: findAllImports needed both integrations.  fixed the delete import thing

* squash: trying to remove duplications

* squash: removing commented code

* squash: sending back the approvalTool

* squash: update and fix tests

* squash: remove commented code

* squash: Update workspaces/bulk-import/.changeset/rude-boats-cough.md

Co-authored-by: Christoph Jerolimov <jerolimov@gmail.com>

* squash: update yarn.lock after the rebase

---------

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Co-authored-by: Oleksandr Andriienko <oandriie@redhat.com>
Co-authored-by: Christoph Jerolimov <jerolimov@gmail.com>
elai-shalev pushed a commit to elai-shalev/rhdh-plugins that referenced this pull request Jan 21, 2026
* feat(bulk-import-backend): addition of Gitlab support to the bulk-import backend.

see https://issues.redhat.com/browse/RHIDP-8281

* squash: type fixes

* squash: removing comments and todos

* squash: consolidate duplicated code

* squash: consolidate duplicated code

* squash: a little cleanup

* squash: update @gitbeaker/rest module to the latest release

* squash: prettier fix for api-docs

* squash: adding in an exclusion for the dupe tests

* squash: prettier fixes

* squash: code cleanup

* squash: more code cleanup

* squash: fixing sonarcloud secrutiy hotspots

* squash: Gitlab bulk import fix typization (redhat-developer#2)

* feat(bulk-import-backend): fix typization for @gitbeaker/rest

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>

* squash: updates to make the tests work

---------

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Co-authored-by: Oleksandr Andriienko <oandriie@redhat.com>

* squash add back the things i forgot i commented out

* squash: findAllImports needed both integrations.  fixed the delete import thing

* squash: trying to remove duplications

* squash: removing commented code

* squash: sending back the approvalTool

* squash: update and fix tests

* squash: remove commented code

* squash: Update workspaces/bulk-import/.changeset/rude-boats-cough.md

Co-authored-by: Christoph Jerolimov <jerolimov@gmail.com>

* squash: update yarn.lock after the rebase

---------

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Co-authored-by: Oleksandr Andriienko <oandriie@redhat.com>
Co-authored-by: Christoph Jerolimov <jerolimov@gmail.com>
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.

4 participants