Hawk credential cleanup now that Treeherder ETL no longer posts to our API



Tree Management
Treeherder: Data Ingestion
2 years ago
2 years ago


(Reporter: emorley, Assigned: emorley)




(1 attachment)

Now that bug 1281056 (the last of the bug 1211414 deps) has landed, we can remove the in-built 'treeherder-etl' hawk credentials & perform a few other pieces of cleanup.
Created attachment 8768432 [details] [review]
[treeherder] mozilla:credentials-cleanup > mozilla:master
Attachment #8768432 - Flags: review?(wlachance)
Comment on attachment 8768432 [details] [review]
[treeherder] mozilla:credentials-cleanup > mozilla:master

Attachment #8768432 - Flags: review?(wlachance) → review+

Comment 3

2 years ago
Commits pushed to master at https://github.com/mozilla/treeherder

Bug 1284853 - Allow Hawk credentials to have no owner

* simplifies creating test credentials
* allows for removing ownership of a credential from someone when they
leave Mozilla, but when we don't yet have a new owner
* would have meant I could have left the owner blank to more accurately
reflect current state, when migrating credentials from SCL3 stage to
Heroku stage, prior to be mapping the stage vs prod user IDs.

Bug 1284853 - Simplify the create_credentials command

Since it's only used for local testing, so there's no need to populate
description or set an owner. (They can always be added afterwards via
the Django admin UI).

Prior to this the command would fail if the provided owner email address
did not correspond to a valid user, which meant the added hassle of
creating a user prior, if one did not already exist.

Bug 1284853 - Skip creating a user in the client_credentials fixture

Since Hawk credentials can now be created without an owner, there's no
need for this fixture to create a user to be associated with the test
Hawk credentials, since none of the tests using the `client_credentials`
fixture actually use the created user.

The `transactional_db` fixture is now required since it's no longer
inherited from the `test_user` fixture.

Also switch back to `.create()` rather than `.get_or_create()` now that
bug 1133273 is fixed.

Bug 1284853 - Vagrant: Stop creating treeherder-etl credentials & user

Since the `treeherder-etl` user is no longer used as part of data
ingestion after bug 1211414, and it doesn't help people wanting to
submit locally, since it's a pain for them to retrieve the Hawk secret.

Instead it makes more sense for them to just use:
`./manage.py create_credentials my-test-user`
...which then outputs the secret to the console.

Bug 1284853 - Handle an already existing client_id in create_credentials

Previously if the requested client_id already existed, the command
would have raised. Now the existing credentials secret is output, in
case the user had just forgotten it.
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.