Skip to content

Accept providerNamespace on createRepository to create in a GitLab group#12970

Merged
HarshMN2345 merged 1 commit into
mainfrom
feat/vcs-gitlab-list-namespaces
Jul 24, 2026
Merged

Accept providerNamespace on createRepository to create in a GitLab group#12970
HarshMN2345 merged 1 commit into
mainfrom
feat/vcs-gitlab-list-namespaces

Conversation

@HarshMN2345

@HarshMN2345 HarshMN2345 commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

The namespaces endpoint and listRepositories namespace support (merged in #12951) let you browse a GitLab group's repos, but createRepository still always resolved the owner from the installation itself -- so a GitLab user with groups had no way to create a new repo inside a group, only in their personal namespace.

This mirrors the listRepositories fix: adds an optional providerNamespace param to createRepository, threaded through to OAuth2Gitlab::createRepository() as GitLab's namespace_id. Also widens Github/Gitea OAuth2 createRepository() signatures with the same optional (no-op) param so the call site doesn't need a provider-specific branch.

Test plan

  • composer format && composer analyze (done locally, clean)
  • E2E: create a repo with providerNamespace set to a GitLab group, verify it lands in the group not the personal namespace
  • E2E: create a repo without providerNamespace, verify unchanged personal-namespace behavior for GitHub/Gitea/GitLab

@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds namespace-aware repository creation by forwarding an optional provider namespace through the VCS endpoint and GitLab OAuth client, while preserving no-op compatibility for GitHub and Gitea OAuth clients.

  • Extends OAuth repository-creation signatures with an optional namespace identifier.
  • Sends GitLab’s namespace identifier as namespace_id.
  • Uses the requested namespace as the owner for adapter-backed repository creation.

Confidence Score: 5/5

The PR appears safe to merge because no additional blocking failure eligible for this follow-up review remains.

No blocking failure remains beyond the issues already covered by the previous review threads.

Important Files Changed

Filename Overview
src/Appwrite/Auth/OAuth2/Gitea.php Adds an optional, intentionally unused namespace argument for interface compatibility.
src/Appwrite/Auth/OAuth2/Github.php Adds an optional, intentionally unused namespace argument for interface compatibility.
src/Appwrite/Auth/OAuth2/Gitlab.php Adds optional GitLab namespace targeting through the project-creation payload.
src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Create.php Accepts and forwards an optional provider namespace through personal OAuth and adapter-backed repository creation paths.

Reviews (2): Last reviewed commit: "Accept providerNamespace on createReposi..." | Re-trigger Greptile

Mirrors the listRepositories fix: without this, a GitLab user with groups
could only ever create new repos in their personal namespace, since
createRepository always resolved the owner from the installation itself.
@HarshMN2345
HarshMN2345 force-pushed the feat/vcs-gitlab-list-namespaces branch from 8a98ec4 to f086253 Compare July 24, 2026 07:29
@HarshMN2345 HarshMN2345 changed the title Add GitLab namespace browsing + repo creation in groups Accept providerNamespace on createRepository to create in a GitLab group Jul 24, 2026
@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → feat/vcs-gitlab-list-namespaces (after).

Metric Before After Change
🚀 Requests/sec 220.66 220.67 0%
⏱️ Latency P50 65.16 ms 65.43 ms +0.4%
⏱️ Latency P95 229.22 ms 227.5 ms -0.8%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 65.43 227.5 13,737 220.67 -1.72
Account 124.43 338.59 723 12.1 +34.64
TablesDB 62.33 206.46 7,471 121.61 -7.25
Storage 58.72 208.14 3,615 60.84 +1.31
Functions 100.29 284.39 1,928 33.09 +8.89

Top API waits (after)

API request Max wait (ms)
functions.variables.create 889.68
tablesdb.rows.update 693.58
tablesdb.rows.create 691.45
account.name.update 683.44
tablesdb.rows.decrement 579.58

@HarshMN2345
HarshMN2345 merged commit 8cafca0 into main Jul 24, 2026
42 checks passed
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.

2 participants