Skip to content

Conversation

@quis
Copy link
Member

@quis quis commented Sep 8, 2016

We call the things that the clients need the ‘service ID’ and the ‘API key’. The client calls them client_id and secret. This is confusing if you’re a user of the client because you start by referring to them by the names the admin app gives them.

The terms used in the UI are more readily understood, as evidenced by the amount of research we’ve done with them in place.

This commit makes two changes:

  1. Rename the arguments that the client’s init method takes to match the terms we use in the UI.
  2. Update the documentation to use keyword arguments when initialising the client. For someone looking at the code down the line NotificationsClient(service_id='5c85a3d2-0ab9-44de-bb9b-45eedf2ab831') is more helpful than NotificationsClient('5c85a3d2-0ab9-44de-bb9b-45eedf2ab831'), when both the service_id and api_key are UUIDs.

This is a breaking change (and is versioned as such) because it renames a method’s arguments. The clients that inherit from this one will also need their method arguments and Super calls updating, eg https://github.com/alphagov/notifications-admin/blob/ae203dfe53bbc167b2146024b6513b391fc8982e/app/notify_client/status_api_client.py#L5

@quis quis changed the title Make init parameters to match what we call them Make init parameters match what we call them Sep 8, 2016
Copy link
Contributor

Choose a reason for hiding this comment

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

should change the assert messages too

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, fixed and squashed.

@leohemsted
Copy link
Contributor

👍

We call the things that the clients need the ‘service ID’ and the
‘API key’. The client calls them `client_id` and `secret`. This is
confusing if you’re a user of the client because you start by referring
to them by the names the admin app gives them.

The terms used in the UI are more readily understood, as evidenced by
the amount of research we’ve done with them in place.

This commit makes two changes:

1. Rename the arguments that the client’s `init` method takes to match
   the terms we use in the UI.

2. Update the documentation to use keyword arguments when initialising
   the client. For someone looking at the code down the line
   `NotificationsClient(service_id='5c85a3d2-0ab9-44de-bb9b-45eedf2ab831')`
   is more helpful than
   `NotificationsClient('5c85a3d2-0ab9-44de-bb9b-45eedf2ab831')`, when
   both the `service_id` and `api_key` are UUIDs.

THIS IS A BREAKING CHANGE BUT IS NOT VERSIONNED AS SUCH because reasons.
The clients that inherit from this one will need their method arguments
and `Super` calls updating, eg
https://github.com/alphagov/notifications-admin/blob/ae203dfe53bbc167b2146024b6513b391fc8982e/app/notify_client/status_api_client.py#L5
@quis quis merged commit ac60285 into master Sep 8, 2016
@quis quis deleted the it-is-what-it-is branch September 8, 2016 14:46
quis added a commit to alphagov/notifications-admin that referenced this pull request Sep 8, 2016
Just so that nobody else has to do it.

Implements:
- [x] alphagov/notifications-python-client#29

Which is a breaking change requiring the renaming of method arguments.
quis added a commit to alphagov/notifications-api that referenced this pull request Sep 8, 2016
Just so that nobody else has to do it.

Implements:
- [x] alphagov/notifications-python-client#29

Which is a breaking change requiring the renaming of method arguments.
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