Closed
Bug 1354438
Opened 9 years ago
Closed 9 years ago
Split off the bug filer's api url from the one for fetching bug suggestions elsewhere
Categories
(Tree Management :: Treeherder: API, enhancement)
Tree Management
Treeherder: API
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: KWierso, Assigned: KWierso)
References
Details
Attachments
(1 file)
Right now, if I want to test out the bugfiler, both prod and staging Treeherder instances are pointed at production bugzilla, so any test bug I file from prod or staging will file a real bug on the real Bugzilla DB.
I understand why you'd want to use prod bugzilla to fetch bug suggestions for the failuresummary/autoclassify panels, since it actually has bugs to suggest for most of the failures. But I think Treeherder staging's bug filer should point to bugzilla stage API, to prevent me from accidentally filing more garbage bugs against prod bugzilla.
| Assignee | ||
Comment 1•9 years ago
|
||
Happy to make these changes if there's no objections.
Assignee: nobody → wkocher
| Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(emorley)
Comment 3•9 years ago
|
||
| Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8856073 [details] [review]
[treeherder] KWierso:bzapi > mozilla:master
This should do it.
Though I changed the "BZ_API_KEY" setting name to "BUGFILER_API_KEY", I didn't change the environmental variable name that it reads, so it shouldn't need any changes after deployment to keep the api key working on stage/prod treeherder.
"BZ_API_URL" still hardcodes to production bmo, and is used for fetching bug suggestions.
The new "BUGFILER_API_URL" setting reads from a new "BUGZILLA_API_URL" environmental variable, but defaults to production bmo if unset. This should mean that this patch can deploy and no changes in behavior will happen. After deployment, someone can set the staging/heroku treeherder "BUGZILLA_API_URL" envvar to "https://bugzilla-dev.allizom.org/" (only after creating a bugzilla-dev user account with an api key and setting "BUGZILLA_API_KEY" to it), which will allow the bugfiler to test submitting to bugzilla-dev.
Attachment #8856073 -
Flags: review?(emorley)
| Assignee | ||
Comment 5•9 years ago
|
||
One possible issue is that occasionally, bugzilla-dev resets user passwords. I'm unsure if that invalidates api keys, too, so we may need to occasionally update treeherder stage's envvars.
Comment 6•9 years ago
|
||
Comment on attachment 8856073 [details] [review]
[treeherder] KWierso:bzapi > mozilla:master
Looks good!
> One possible issue is that occasionally, bugzilla-dev resets user passwords. I'm unsure if that invalidates api keys, too, so we may need to occasionally update treeherder stage's envvars.
Let's cross that bridge when we come to it -- it's easy enough to change environment variables :-)
Attachment #8856073 -
Flags: review?(emorley) → review+
> > One possible issue is that occasionally, bugzilla-dev resets user passwords. I'm unsure if that invalidates api keys, too
yes it will - when the bugzilla-dev database is restored it's to a clean state; existing user accounts are effectively deleted.
Comment 8•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/03701af889c0f1409543cc7dafa04c41e318026a
Bug 1354438 - Give the Bug Filer control of its own API URL (#2328) r=emorley
BZ_API_URL currently is used for both the bug filer and fetching bug suggestions through the rest of Treeherder. At the moment, both of them point to production bmo's API. Bug suggestions coming from the bugzilla instance that actually has most of the intermittent bugs filed makes sense. Filing bugs from staging Treeherder's bug filer into production bmo makes less sense, so this patch lets you specify a different API URL.
If the new environmental variable isn't present, the bug filer will still default to production bmo, so this should be deployable without any configuration changes, and everything should still just work.
| Assignee | ||
Comment 9•9 years ago
|
||
Okay, merged this. If things go like I hope they go, no immediate changes should be needed anywhere: Both stage and prod Treeherder instances will continue to be configured to fetch and file bugs against production bmo. At some point, we can request a bmo staging user account and create an API key for use on Treeherder stage. Then we just have to occasionally recreate/reactivate the user account when the DB is reset, updating Treeherder's api key, and deal with occasionally not being able to file bugs on Treeherder staging. Hopefully the error message returned is obvious enough to remind us that it needs to be done.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 10•9 years ago
|
||
Just filed a bug from treeherder stage and it went to bugzilla prod, as expected. Go team!
| Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(emorley)
| Assignee | ||
Comment 12•9 years ago
|
||
Ed, I'm going to email you the bugzilla-dev configuration information, could you set it on Treeherder's staging (and only staging) instance?
Comment 13•9 years ago
|
||
Done:
$ ths config:set BUGZILLA_API_URL="https://bugzilla-dev.allizom.org" BUGZILLA_API_KEY="REDACTED"
Setting BUGZILLA_API_URL, BUGZILLA_API_KEY and restarting treeherder-stage... done, v932
! Release command executing: this config change will not be available until the command
! succeeds.
BUGZILLA_API_KEY: REDACTED
BUGZILLA_API_URL: https://bugzilla-dev.allizom.org
Flags: needinfo?(emorley)
| Assignee | ||
Comment 14•9 years ago
|
||
With that, filing bugs from treeherder stage files the bug with bugzilla-dev. However, the UI still opens a tab to production bugzilla (with the bugid from bugzilla-dev), so it opens to some random bug. I guess I'll need to return the URL back to the UI in the response.
You need to log in
before you can comment on or make changes to this bug.
Description
•