Page MenuHomePhabricator

🧬 Sync queryservice-ui with upstream
Closed, ResolvedPublic

Description

A/C:

  • sync all changes that are not present in the upsteam gitlab (https://gitlab.wikimedia.org/repos/wmde/wikidata-query-gui)
  • document how to sync it in the future
  • ship it to production
  • timebox investigate (2-4hrs) could we sync by using the upstream OCI image (with some modification for our hacks) rather than syncing using git magic

Event Timeline

Andrew-WMDE moved this task from Doing to To do on the Wikibase Cloud (Kanban Board Q2 2025) board.
Andrew-WMDE subscribed.

We agreed today that this should go on the backburner because for now collecting metrics from Wikidata will be far easier.
We are also confident that we will want to pull in whatever additional work comes out of T396002 to cloud when it is merged upstream

Took a look at this today: the last sync we did with upstream was Feb 2022 (tag: wmde.6 / commit: 3be93201 (gitlab)

I checked the upstream repo out and diffed it against our fork. Since we are so far behind upstream my suggestion is to

  • create an inventory of modifications that are currently in place (see the list below for a start)
  • use git to merge upstream, as we did with for example cradle (see https://github.com/wbstack/cradle#syncing-this-fork)
  • keep track of all our custom changes in the README, so we have an inventory of things we modified and can test after an update
  • sync "regularly" to make updating smoother / avoid build up of changes

Using the docker image as a base sounds great at first but unless we find a way to write a test suite for our modifications, I suspect overlaying changes on it would just evolve to its own little maintenance nightmare (since in the future we would lose out on git showing us potential breaking changes when syncing upstream).

Overall our git history of changes aren't too many. Here are some notable changes I saw in the diff against wmde.6, with some notes for refactoring:

We have kept the base64 encoded tinyurl modification but we haven't investigated further if this has totally resolved T383250

I couldn't see any wikibase/init.js changes that relate to T347023 or #237. There are changes in wikibase/queryService/ui/queryHelper/QueryHelper.js that are related, though. I believe we should keep the changes made in #237 (i.e. we should not clean query prefixes).

PR: https://github.com/wbstack/queryservice-ui/pull/312

How to sync:

  1. Create a new branch
  2. Add local upstream remote: git remote add upstream https://gitlab.wikimedia.org/repos/wmde/wikidata-query-gui
  3. Rebase main brnach git rebase upstream/main (or you can merge but rebase seems to be better option git merge upstream/main)
  4. Resolve conflicts

some important changes:

  • wikibase/queryService/api/UrlShortener.js and wikibase/queryService/ui/App.js: are part of PR#292 to improve TinyURL
  • style.less: combine both changes, using new codex
  • wikibase/queryService/ui/queryHelper/QueryHelper.js: keep workaround for T133316 removed

Note: node will be updated to node:18 to be similar with upstream

Ollie.Shotton_WMDE removed dang as the assignee of this task.EditedJul 2 2025, 3:19 PM
Ollie.Shotton_WMDE added a subscriber: dang.

Ended up taking over PR #296 and updating it with latest upstream changes (via another git rebase upstream/main). We did a force push of upstream/main to origin/main and then (fast-forward) merged #296 in. This keeps the wbstack modifications at the tip of the git history which makes it easier to compare changes with upstream and make future syncs easier. Ideally, we will rework the GitHub Actions for the repo so that we don't have to rewrite the history of origin/main.

Notable conflict resolutions and fixes:

  • removed duplicated code from style.less
  • fixed the hiding of Wikidata specific UI elements in style.less
  • removed Query Builder Discovery feedback banner from index.html and changes to style.less that hid it from the UI (this banner got removed from upstream)
  • removed duplicate setExamplesHelpLink() call from init.js
  • bump the docker builder from node:12 to node:18 to be similar to upstream

Syncing with upstream also fixes T358602: Remove Query Builder notice in Query Service as banners are now configurable and default to none being shown.

EDIT: we didn't manage to fix T358602: Remove Query Builder notice in Query Service this time round - I didn't realize that closing the banner is cached.

Anton.Kokh claimed this task.