Skip to content

RepoBranchPicker: add GitLab branch autocomplete support - #36086

Open
ebarault wants to merge 3 commits into
backstage:masterfrom
ebarault:feat/gitlab-repo-branch-picker
Open

ebarault wants to merge 3 commits into
backstage:masterfrom
ebarault:feat/gitlab-repo-branch-picker

Conversation

@ebarault

@ebarault ebarault commented Oct 9, 2026 •

Copy link
Copy Markdown

GitLab branch autocomplete for Software Templates

Adds GitLab branch autocomplete to RepoBranchPicker, alongside the existing GitHub and Bitbucket implementations. The GitLab autocomplete provider lists branches using the caller's SCM OAuth token, including projects in nested namespaces. Manual branch input remains available, and a failed branch lookup displays an error.

Validation: 14 focused backend/frontend tests passed, including regression coverage for out-of-order responses after repository or credential changes, obsolete failures, and removal of required context. The new regression tests fail against the previous implementation. Lint passed for both affected packages; repository-wide TypeScript and focused API reports passed without changes. The combined repository-wide API/SQL report command exceeded local memory during SQL report generation.

Implementation and regression tests were prepared with AI assistance.

✔️ 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)
  • All your commits have a Signed-off-by line in the message. (more info)

Signed-off-by: ebarault <eric.barault@gmail.com>
@github-actions github-actions Bot added area:documentation Improvements or additions to documentation area:scaffolder Everything and all things related to the scaffolder project area labels Oct 9, 2026
@backstage-goalie

backstage-goalie Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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
@backstage/plugin-scaffolder-backend-module-gitlab plugins/scaffolder-backend-module-gitlab patch v0.12.1-next.2
@backstage/plugin-scaffolder plugins/scaffolder minor v1.39.1-next.1

@backstage-goalie backstage-goalie Bot added size:medium Medium-sized pull requests receive no change in priority for reviews. waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Oct 9, 2026
Signed-off-by: ebarault <eric.barault@gmail.com>
@ebarault
ebarault marked this pull request as ready for review October 9, 2026 08:27
@ebarault
ebarault requested review from a team as code owners October 9, 2026 08:27
Copilot AI balanced review requested due to automatic review settings October 9, 2026 08:27

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.

🟡 Changes recommended

Stale autocomplete requests can overwrite current repository results, and the 0.x backend package has an incorrect changeset bump.

2 open findings
What changed in this PR

Adds GitLab branch autocomplete to RepoBranchPicker using user SCM credentials.

Changes:

  • Adds GitLab frontend and backend autocomplete support.
  • Covers nested namespaces, failures, and manual input with tests and docs.
  • Adds release metadata, though its backend bump level needs correction.
File Description
RepoBranchPicker.tsx Selects the GitLab picker.
GitLabRepoBranchPicker.tsx Implements GitLab branch autocomplete.
GitLabRepoBranchPicker.test.tsx Tests picker behavior and failures.
autocomplete.ts Lists GitLab repository branches.
autocomplete.test.ts Tests backend branch lookup.
ui-options-examples.md Documents GitLab requirements.
gitlab-branch-autocomplete.md Adds changeset metadata.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@@ -0,0 +1,6 @@
---
'@backstage/plugin-scaffolder': minor
'@backstage/plugin-scaffolder-backend-module-gitlab': minor
Copilot AI balanced review requested due to automatic review settings October 10, 2026 08:12
@backstage-goalie backstage-goalie Bot added size:large Large pull requests receive a slightly lower priority for reviews. and removed size:medium Medium-sized pull requests receive no change in priority for reviews. labels Oct 10, 2026

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.

🟢 Approval recommended

The implementation is complete and tested, with only minor non-blocking test-style feedback.

1 open finding
1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Low severity Use findByText instead of wrapping a query in waitFor

plugins/​scaffolder/​src/​components/​fields/​RepoBranchPicker/​GitLabRepoBranchPicker.test.tsx:122

Repository guidance prefers screen.findBy* queries over wrapping a synchronous query in waitFor (AGENTS.md:36). Using findByText directly also makes this asynchronous assertion clearer.

🧠 Review effort: Balanced

@backstage-goalie

Copy link
Copy Markdown
Contributor

Thanks for the contribution!
All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

Invalidate pending lookups when repository context or credentials change, cover out-of-order settlements, and use a patch bump for the 0.x GitLab backend module.

Signed-off-by: Eric Barault <eric.barault@gmail.com>
@ebarault
ebarault force-pushed the feat/gitlab-repo-branch-picker branch from 19771a5 to c9172a7 Compare October 10, 2026 09:34

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:documentation Improvements or additions to documentation area:scaffolder Everything and all things related to the scaffolder project area size:large Large pull requests receive a slightly lower priority for reviews. waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants