Skip to content

fix: honour console URL scheme in VCS commit statuses and authorize link - #13476

Merged
Meldiron merged 2 commits into
mainfrom
fix-vcs-comment-urls
Sep 7, 2026
Merged

Meldiron merged 2 commits into
mainfrom
fix-vcs-comment-urls

Conversation

@Meldiron

@Meldiron Meldiron commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

The VCS PR comment's build-log links already respected _APP_CONSOLE_URL_SCHEME, but two other links generated for the same pull request did not:

  • the commit-status target URLs (GitAction.php, and the "Starting..." status in GitHub/Deployment.php)
  • the external-contributor authorize link (GitHub/Deployment.php)

Both were hardcoded to the legacy /console/project-{region}-{projectId}/... form. On a root-scheme install that meant a single PR carried contradictory links — the comment's "View Logs" pointed at /projects/{id}/... while the commit status next to it pointed at /console/project-....

All three now branch on the same flag. GitAction also reads the hostname from the $platform config it already receives, instead of re-resolving _APP_CONSOLE_DOMAIN / _APP_DOMAIN itself.

Resulting URLs under _APP_CONSOLE_URL_SCHEME=root

Link Path
Site detail (commit status) /projects/{projectId}/sites/{siteId}
Function detail (commit status) /projects/{projectId}/functions/{functionId}
Site build logs /projects/{projectId}/sites/{siteId}/deployments/{deploymentId}
Function build logs /projects/{projectId}/functions/{functionId}/deployments/{deploymentId}
Authorize /git/authorize-contributor?…

The legacy branch is unchanged, so existing installs keep their current links.

Deployment note

Cloud does not currently set _APP_CONSOLE_URL_SCHEME, so production and staging default to legacy and are unaffected by this PR. Moving them to the new console needs _APP_CONSOLE_URL_SCHEME=root plus the matching _APP_CONSOLE_DOMAIN (appwrite.io / staging.appwrite.io) in cloud-applications.

Not changed here, but worth noting: the QR link (/v1/avatars/qr) and the comment's status icons (/images/vcs/*) are also built on the console hostname. They are served by the Appwrite container, so that hostname has to route them to the API and not only to the console app.

Test Plan

  • composer lint on both changed files — passed
  • composer analyze (PHPStan level 4) on both changed files — no errors
  • tests/unit/Vcs/CommentTest.php — 4/4 passing

Related PRs and Issues

n/a

Have you read the Contributing Guidelines on issues?

Yes

🤖 Generated with Claude Code

The VCS PR comment's build-log links already respected
_APP_CONSOLE_URL_SCHEME, but the commit-status target URLs and the
external-contributor authorize link did not, so on a root-scheme install
they pointed at the legacy /console/project-{region}-{id} paths while the
comment pointed at /projects/{id}.

Gate all three on the same flag, and let GitAction read the hostname from
the platform config it already receives instead of re-resolving
_APP_CONSOLE_DOMAIN.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@greptile-apps

greptile-apps Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates VCS-generated console links to honor _APP_CONSOLE_URL_SCHEME.

  • Uses root-scheme paths for site and function commit-status targets.
  • Uses the root-scheme contributor authorization path when configured.
  • Preserves existing legacy paths and uses the platform-provided console hostname.
  • The only change since the previous review is merging the current base branch; the two PR files are unchanged.

Confidence Score: 5/5

The PR appears safe to merge with no outstanding findings.

The URL branches consistently preserve legacy behavior while producing the documented root-scheme paths, and the previous testing suggestion was manually resolved.

Important Files Changed

Filename Overview
src/Appwrite/Deployment/GitAction.php Selects legacy or root console paths for site and function commit-status URLs.
src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php Selects scheme-appropriate contributor authorization and initial commit-status URLs.

Reviews (2): Last reviewed commit: "Merge branch 'main' into fix-vcs-comment..." | Re-trigger Greptile

Comment thread src/Appwrite/Deployment/GitAction.php Resolved
@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix-vcs-comment-urls (after).

Metric Before After Change
🚀 Requests/sec 148.93 161.74 🟢 +8.6%
⏱️ Latency P50 118.61 ms 109.58 ms 🟢 -7.6%
⏱️ Latency P95 262.96 ms 249.89 ms ⚪ -5%
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 109.58 249.89 10,260 161.74 -13.07
Account 207.22 358.15 540 9.18 -49.89
TablesDB 108.81 193.16 5,580 91.08 -22.48
Storage 93.02 221.55 2,700 45.98 +5.91
Functions 154.71 296.09 1,440 25.1 -5.08

Top API waits (after)

API request Max wait (ms)
account.name.update 624.5
storage.files.create 490.5
storage.buckets.create 478.68
tablesdb.rows.create 478.12
functions.variables.update 475.54

@Meldiron
Meldiron merged commit 1979c37 into main Sep 7, 2026
85 of 87 checks passed
@ChiragAgg5k ChiragAgg5k mentioned this pull request Sep 10, 2026
2 of 4 tasks
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.

1 participant