Skip to content

Add getWikiHostsForDomain endpoint#1001

Merged
outdooracorn merged 17 commits into
mainfrom
T409530
Nov 20, 2025
Merged

Add getWikiHostsForDomain endpoint#1001
outdooracorn merged 17 commits into
mainfrom
T409530

Conversation

@rosalieper
Copy link
Copy Markdown
Contributor

@rosalieper rosalieper commented Nov 14, 2025

Bug: T409530

Co-author: @outdooracorn

@rosalieper rosalieper marked this pull request as draft November 14, 2025 10:45
Comment thread app/Http/Controllers/Backend/MediawikiHostMapController.php Outdated
Comment thread app/Http/Controllers/Backend/MediawikiHostMapController.php Outdated
Comment thread routes/backend.php Outdated
Copy link
Copy Markdown
Member

@outdooracorn outdooracorn left a comment

Choose a reason for hiding this comment

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

Noticed something we should probably address, but let's do that as a follow-up PR.

Comment thread app/Http/Controllers/Backend/MediaWikiHostController.php Outdated
@rosalieper rosalieper marked this pull request as ready for review November 18, 2025 09:05
tarrow
tarrow previously requested changes Nov 18, 2025
Copy link
Copy Markdown
Contributor

@tarrow tarrow left a comment

Choose a reason for hiding this comment

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

only the comment removal is blocking. The others are suggestions

Comment thread app/Http/Controllers/Backend/MediaWikiHostController.php Outdated
Comment thread app/Services/MediaWikiHostResolver.php
Comment thread app/Services/MediaWikiHostResolver.php Outdated
Comment thread app/Http/Controllers/Backend/MediaWikiHostController.php Outdated
@outdooracorn outdooracorn changed the title Add endpoint for wiki host map Add getWikiHostsForDomain endpoint Nov 18, 2025
@outdooracorn outdooracorn requested a review from tarrow November 18, 2025 18:19
Copy link
Copy Markdown
Member

@outdooracorn outdooracorn left a comment

Choose a reason for hiding this comment

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

Made some nitpick improvements. I'm happy with this now. :)

Copy link
Copy Markdown
Contributor Author

@rosalieper rosalieper left a comment

Choose a reason for hiding this comment

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

LGTM


public function getBackendHostForDomain(string $domain): string {
// TODO: Move 'backend.default.svc.cluster.local' to an env variable (e.g. PLATFORM_MW_BACKEND_HOST_SUFFIX) for flexibility.
// TODO: Make host format configurable for flexibility
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I actually found the previous comment clearer but I am also fine with updating it as this now

Copy link
Copy Markdown
Member

@outdooracorn outdooracorn Nov 19, 2025

Choose a reason for hiding this comment

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

The reason I changed it is because I don't actually know if PLATFORM_MW_BACKEND_HOST_SUFFIX is the best way to make this configurable. 😅 What about the mediawiki- at the start? Should it be PLATFORM_MW_BACKEND_HOST_FORMAT=mediawiki-%s-app-backend.default.svc.cluster.local. That won't work for the other hosts (web, api, alpha) though. Do we have one env var per host? Or one env var for all hosts, e.g. PLATFORM_MW_HOSTS_FORMAT=mediawiki-{version}-app-{name}.default.svc.cluster.local with strtr?

Comment thread app/Http/Controllers/Backend/MediaWikiHostsController.php
Comment thread app/Http/Controllers/Backend/MediaWikiHostsController.php
Copy link
Copy Markdown
Contributor

@dati18 dati18 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 this locally. I also need it for other work so let's move it :D

@AndrewKostka AndrewKostka dismissed their stale review November 19, 2025 16:28

See comments

@tarrow tarrow dismissed their stale review November 20, 2025 09:44

thanks for pointing out my mistake about the comment; let's follow up

@outdooracorn outdooracorn merged commit 359c84f into main Nov 20, 2025
5 checks passed
@outdooracorn outdooracorn deleted the T409530 branch November 20, 2025 10:06
deer-wmde pushed a commit that referenced this pull request Dec 15, 2025
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.

5 participants