Page MenuHomePhabricator

GitLab replica banners are missing
Closed, ResolvedPublic

Description

A warning banner was added to the replicas to make sure users don't confuse GitLab replicas and production instance. The script which does the restore and banner creation directly calls GitLab rails command to create the banner:

gitlab-rails runner 'BroadcastMessage.create()

See gitlab-restore.sh. Afaik this endpoint in the rails console is not documented and may just be removed or deprecated in one of the last updates.

I tried running the gitlab-rails runner command manually and it returns the following error:

uninitialized constant BroadcastMessage

We might have to switch to the official API: https://docs.gitlab.com/ee/api/broadcast_messages.html

Event Timeline

We chose to use the rails command rather than the API to avoid having to create a service user and API key, but since we'll likely need to do this for the apt-staging work, that gets rid of that reason

We chose to use the rails command rather than the API to avoid having to create a service user and API key, but since we'll likely need to do this for the apt-staging work, that gets rid of that reason

Yes that was quite a nice solution without the need of a dedicated API key. Maybe the command also just changed a bit and we have to modify the gitlab-rails call slightly? Do you have any resources or docs about the BroadcastMessage.create() call which might help troubleshooting this?

I'd like to say it was some excellent documentation to find it, but I mostly just took a look around the source code to follow the path of an API call to the public API. It does look like they just moved the class though (found by searching for the BroadcastMessage class in the source), so now it is System::BroadcastMessage. I can prepare a patch for this.

LSobanski triaged this task as Medium priority.
LSobanski moved this task from Incoming to Consultation on the collaboration-services board.
LSobanski moved this task from Consultation to Backlog on the collaboration-services board.

Change 980377 had a related patch set uploaded (by EoghanGaffney; author: EoghanGaffney):

[operations/puppet@production] [gitlab] Update BroadcastMessage class to new namespace

https://gerrit.wikimedia.org/r/980377

Change 980377 merged by EoghanGaffney:

[operations/puppet@production] [gitlab] Update BroadcastMessage class to new namespace

https://gerrit.wikimedia.org/r/980377

eoghan moved this task from Backlog to Work in Progress on the collaboration-services board.