Skip to content

Conversation

@alexcottner
Copy link
Contributor

@alexcottner alexcottner commented Dec 2, 2025

Adding support for v2 api version.

Need to:

  • Add support for v2 routes in dev-tools
  • Add support for v2 routes in kinto-http-client (link)
  • Publish new kinto-http-client to firefox (link)
  • Figure out a reasonable UI for this
  • Update tests
image

This will require mozilla/remote-settings#1104 to be deployed for forwards compatability.

@alexcottner alexcottner marked this pull request as draft December 2, 2025 19:54
Copy link
Contributor

@leplatrem leplatrem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to gradually migrate our clients from v1 to v2, shouldn't we have a pref on the client instead, and do there what you do here in the devtools:

const apiVersion = Services.prefs.getCharPref("api_version", "/v1");
const serverUrl = new URL(SERVER_URL, apiVersion);

@alexcottner
Copy link
Contributor Author

alexcottner commented Dec 3, 2025

shouldn't we have a pref on the client instead

I was thinking leaving that as a single pref in services.settings.server and allowing it to be overridden in it's entirety. That feels simpler or am I wrong?

Splitting it in two for the dev-tools UI just feels easier because instead of a single dropdown with 14 options we have two dropdowns. (and if/when we make a v3 it would be 21)

Copy link
Contributor

@leplatrem leplatrem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't really found a design that would allow us to gradually roll out clients to v2

The changes of this PR work to try things out on nightly or when running the client with MOZ_REMOTE_SETTINGS_DEVTOOLS=1. But won't be able to also support our api version migration later

A potential idea would be to use a separate preference on the client:

Services.prefs.setIntPref("services.settings.api_version", 2);

And on the client have something like:

let apiVersion = Services.prefs.getIntPref("services.settings.api_version");
apiVersion = [1, 2].contains(apiVersion) ? apiVersion : 1;

and do the concatenation on the client code

}

if (serverURL.endsWith("v2")) {
apiVersion = "v2";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, need to adjust that logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

3 participants