Skip to content

feat: add backend endpoint to set wiki DB version#1012

Merged
deer-wmde merged 7 commits into
mainfrom
de/T410394B
Nov 25, 2025
Merged

feat: add backend endpoint to set wiki DB version#1012
deer-wmde merged 7 commits into
mainfrom
de/T410394B

Conversation

@deer-wmde
Copy link
Copy Markdown
Contributor

@deer-wmde deer-wmde commented Nov 24, 2025

successor of #1010

Adds the backend endpoint /backend/setWikiDbVersion as defined in https://phabricator.wikimedia.org/T410394

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.

Generally looks very good; easy to review. I think there's probably one important bit of test missing though.

Comment thread tests/Routes/Backend/WikiDbVersionControllerTest.php
Comment thread routes/backend.php
$router->get('getWikiHostsForDomain', ['uses' => 'MediaWikiHostsController@getWikiHostsForDomain']);

// PUT
$router->put('setWikiDbVersion', ['uses' => 'WikiDbVersionController@updateWikiDbVersion']);
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.

I think it's good this isn't in wiki on second thoughts because it's actually about changing WikiDbs not Wikis


public function updateWikiDbVersion(Request $request): \Illuminate\Http\JsonResponse {
$validated = $request->validate([
'domain' => 'required|string',
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.

I like this light validation; I think we don't want to reuse the domain validation logic from Wiki creation because overtime it may become stricter and then requests here might start failing.

@deer-wmde deer-wmde merged commit 99d2200 into main Nov 25, 2025
5 checks passed
@deer-wmde deer-wmde deleted the de/T410394B branch November 25, 2025 09:46
deer-wmde added a commit that referenced this pull request Dec 15, 2025
successor of #1010

Adds the backend endpoint `/backend/setWikiDbVersion` as defined in
https://phabricator.wikimedia.org/T410394
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