Page MenuHomePhabricator

[builds-api,jobs-api,envvars-api,api-gateway] Figure out and document how to do non-backwards compatible changes
Closed, ResolvedPublic

Description

Currently we have a v1.yaml file on the openapi/ folder, with all the methods prepended with v1, but that would mean that to bump one method we have to bump all of them by creating a new v2.yaml file.

There has to be a better way to be able to handle single-method non-backwards compatible changes.

We might want to define a version rollout strategy too before opening the APIs to any users (ex. doing some kind of preview-stable-deprecated-removed cycle or similar).

This task is to:

Find a process to add backwards-incompatible changes to the API while having always a backwards-compatible state

Extra things to implement:

  • Expose stats on the endpoint usage (maybe also by user agent).

Document the process

Done, created wiki page: https://wikitech.wikimedia.org/wiki/Help:Toolforge/API

Define a policy on how long each step of that process is going to be, and how we will be notifying the users about the incompatibilities

Where to announce the deprecations:

  • as an entry in the Changelog toolforge page
  • as a warning message in the endpoint response
  • as a note in the openapi spec docs

Timeline:

  • First notification of deprecation - day 0
  • Second notification - day 30
  • Deprecated - day 60

If needed, implement a grafana dashboard with the amount of calls to each method (so we know if there's users using each endpoint).

Done: each of the components API dashboard will show the calls to deprecated apis too (ex. https://grafana.wmcloud.org/d/kcAb-KUSz/jobs-api?orgId=1)

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
api-gateway: bump to 0.0.34-20240805081943-a45c7fa3repos/cloud/toolforge/toolforge-deploy!467ghostbump_api-gatewaymain
jobs-api: bump to 0.0.307-20240614070606-03ccd024repos/cloud/toolforge/toolforge-deploy!333ghostbump_jobs-apimain
d/changelog: bump to 16.0.10repos/cloud/toolforge/jobs-cli!35dcarobump_to_16.0.10main
envvars-api: bump to 0.0.45-20240525210201-625cdfb7repos/cloud/toolforge/toolforge-deploy!285ghostbump_envvars-apimain
[envvars-cli] add messages to all responsesrepos/cloud/toolforge/envvars-cli!38raymond-ndibeadd_messages_to_all_responsemain
d/changelog: bump to 0.0.15repos/cloud/toolforge/builds-cli!63raymond-ndibebump_versionmain
[envvars-api] add messages to all responsesrepos/cloud/toolforge/envvars-api!25raymond-ndibeadd_messages_to_all_responsemain
[builds-cli] remove unused coderepos/cloud/toolforge/builds-cli!59raymond-ndibeminor_refactormain
d/changelog: bump to 0.0.14repos/cloud/toolforge/builds-cli!58raymond-ndibebump_to_0.0.14main
builds_cli: Adapt to messages in responsesrepos/cloud/toolforge/builds-cli!57dcarouse_wrapped_responsesmain
Add messages to all responsesrepos/cloud/toolforge/builds-api!81dcarowrap_responsesmain
Show related patches Customize query in GitLab

Event Timeline

dcaro triaged this task as High priority.Feb 8 2024, 10:29 AM
dcaro updated the task description. (Show Details)
dcaro renamed this task from [OpenAPI] FIgure out and document how to do non-backwards compatible changes to [builds-api,jobs-api,envvars-api,api-gateway] FIgure out and document how to do non-backwards compatible changes.Feb 26 2024, 11:42 AM
dcaro claimed this task.
dcaro updated the task description. (Show Details)
dcaro edited projects, added Toolforge (Toolforge iteration 06); removed Toolforge.
dcaro changed the task status from Open to In Progress.Mar 5 2024, 9:35 AM
dcaro moved this task from In Progress to In Review on the Toolforge (Toolforge iteration 06) board.
dcaro renamed this task from [builds-api,jobs-api,envvars-api,api-gateway] FIgure out and document how to do non-backwards compatible changes to [builds-api,jobs-api,envvars-api,api-gateway] Figure out and document how to do non-backwards compatible changes.Apr 10 2024, 12:58 PM

project_1317_bot_df3177307bed93c3f34e421e26c86e38 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/285

envvars-api: bump to 0.0.45-20240525210201-625cdfb7

project_1317_bot_df3177307bed93c3f34e421e26c86e38 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/333

jobs-api: bump to 0.0.307-20240614070606-03ccd024

Raymond_Ndibe changed the task status from In Progress to Stalled.Jul 2 2024, 1:14 PM
Raymond_Ndibe changed the task status from Stalled to In Progress.Jul 30 2024, 1:27 PM

project_1317_bot_df3177307bed93c3f34e421e26c86e38 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/467

api-gateway: bump to 0.0.34-20240805081943-a45c7fa3

dcaro moved this task from In Progress to Done on the Toolforge (Toolforge iteration 14) board.
dcaro moved this task from Done to In Review on the Toolforge (Toolforge iteration 14) board.
dcaro moved this task from In Review to Done on the Toolforge (Toolforge iteration 14) board.