Page MenuHomePhabricator

Document the announcement endpoint config parameters
Closed, ResolvedPublic

Description

To prevent mistaken assumptions, we should document the various configuration parameters available in the announcement endpoint in an on-wiki schema akin to https://www.mediawiki.org/wiki/Specs/Summary/1.3.0.

Event Timeline

@Jhernandez I'm inclined to mark this high priority. Maybe that's too high, but it should get done.

Yeah, from what I've heard from other teams I agree. We want to do this soon.

Also, if we could have schema validation so that it is impossible for us to deploy incompatible responses that would be great. Given the nature of this endpoint I'm guessing it could even be a test that runs on the patch for now.

I see there is swagger definitions for announcement and announcementsResponse there.

Are they up to date? Exercised in the tests?

Are they up to date?

Some of the newer (optional) values (most are from T152160) are missing:

  • beta: boolean,
  • logged_in: boolean,
  • reading_list_sync_enabled: boolean,
  • negative_text: string
  • min_version: (Android: number), (iOS: string)
  • max_version: (Android: number), (iOS: string)
  • image_height: (Android only: number in dp)

Another issue is that we have inconsistent fields between the two apps. In the past the two apps teams designed the responses how they saw fit but didn't always check with the other teams.
More examples are:

  • image URL: Android calls it image, iOS image_url.
  • body text: Android allows/requires HTML tags for formatting; iOS requires plain text and \n for newlines.

Exercised in the tests?

Currently we don't have any announcements running. So, the announcement x-amples response is just an empty array. Also the tests are adjusted when we start/stop announcements. In the long run, once we have announcements which are configurable without code change/deploy, the latter part should change.

@bearND Thanks for the info. Lets document usage from both platforms, and as an outcome of this task it would be good to have a followup task with a proposal to unify the format across platforms, or definitely split it, whatever we need. We need to formalize this endpoint though so that we don't repeat the problems we've had in the past.

it would be good to have a followup task with a proposal to unify the format across platforms

@Jhernandez T153224 is a start of that.

There is information about the android format in the task that @Dbrant mentioned T152160: Add beta announcement capabilities to apps

Change 460874 had a related patch set uploaded (by Mholloway; owner: Mholloway):
[mediawiki/services/mobileapps@master] Announcements: Update spec, add docs to etc/feed/announcements.js

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

@Mholloway Any concerns about moving this to Specs/Announcements/0.2.0?

@Mholloway Any concerns about moving this to Specs/Announcements/0.2.0?

done

Change 460874 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Announcements: Update spec, add docs to etc/feed/announcements.js

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

Stashbot subscribed.

Mentioned in SAL (#wikimedia-operations) [2018-09-24T20:23:46Z] <bsitzmann@deploy1001> Started deploy [mobileapps/deploy@4be131b]: Update mobileapps to badb463 (T187098 T195838)

Mentioned in SAL (#wikimedia-operations) [2018-09-24T20:28:17Z] <bsitzmann@deploy1001> Finished deploy [mobileapps/deploy@4be131b]: Update mobileapps to badb463 (T187098 T195838) (duration: 04m 31s)