-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1837998 - File regression bugs using the API #8048
base: master
Are you sure you want to change the base?
Conversation
@junngo and I discussed this patch yesterday, and one thing to change will be to output a failure message if the bug creation doesn't work. |
@beatrice-acasandrei that sounds great to me! |
If we test it locally, we need to set up a Bugzilla api key. It's good to test in staging :) |
ed0eb54
to
92e124c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8048 +/- ##
==========================================
- Coverage 77.08% 77.05% -0.03%
==========================================
Files 545 545
Lines 26984 27005 +21
Branches 3389 3400 +11
==========================================
+ Hits 20801 20810 +9
- Misses 6016 6028 +12
Partials 167 167 ☔ View full report in Codecov by Sentry. |
url = settings.BUGFILER_API_URL + "/rest/bug" | ||
headers = {"x-bugzilla-api-key": settings.BUGFILER_API_KEY, "Accept": "application/json"} | ||
headers = { | ||
"x-bugzilla-api-key": settings.BUGFILER_API_KEY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI:
When I test it on the local, I set the buzilla api url[0] and api key[1] through hardcoding.
[0] BUGFILER_API_URL: "https://bugzilla.mozilla.org"
[1] BUGFILER_API_KEY: "My bugzilla api key"
I added the feature. If there is an error from the server, we can see the error message in the modal. |
@junngo looks good! If you need help with deploying to staging feel free to ping me on element! |
let needinfoFrom = ''; | ||
if (bugData.assigned_to !== 'nobody@mozilla.org') { | ||
needinfoFrom = bugData.assigned_to; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a new bug is created by entering a bug number, a needinfo
[0] who is the assignee in the entered bug is added to the new bug.
But if no one is assigned in the entered bug, nobody@mozilla.org
is responded from entered bug.
nobody@mozilla.org
is a non-existent person, so an error occurs in the bugzilla api when adding to needinfo
.
For that reason, I added a condition.
Tell me if you don't want to create a new bug when there is no assigned person in the entered bug.
@gmierz @beatrice-acasandrei
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's no asignee on the bug then we should set a needinfo for the triage owner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also another edge case when the asignee is disabled (here's an example of an old bug). Just to be safe I think it's best to also check if the user is disabled - if so, then the needinfo should be set to the triage owner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry to tell you. We can't know the triage owner and if the assignee status is disabled or not by this api[0].
Why don't we add a creator(reporter) to the needinfo
if there's no assigned person?
Or we can clear the needinfo
like this patch.
[0]
https://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#get-bug
https://github.com/mozilla/treeherder/pull/8048/files#diff-af3e67b4a4a7bef0c90cd43bf6aa92b3a2815f0d5cbece21c7b079fb9f1e8fc9R53
@beatrice-acasandrei @gmierz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @junngo ! I'll try to clarify your question if I understand correctly what you are asking. The creator(reporter) is a sheriff (including me and other team members), which is different from the person that worked on the patch. By setting a needinfo we are requesting to the person that caused a certain regression to look into it and potentially backout their changes. For more context: adding a person to the needinfo field is an esential step in the sheriffing process. If we don't set a needinfo automatically then the sheriff needs to go over the created bug and add it manually which is the oposite of what we want to achieve here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junngo could you investigate if there's a way to get the details of a certain component in bugzilla? every bug has a component. The component details should contain the triage owner's information (id or something similar).
I've seen that they used this endpoint in the UI https://bugzilla.mozilla.org/rest/component-watching?Bugzilla_api_token=jjt9LqN7XjuFLJUftBra9x so that's were I got the idea.
For the disabled assignee edge case I don't have a suggestion yet - maybe we could figure out how to set the triage owner first if possible and continue from there.
this.setState({ | ||
fileBugErrorMessage: null, | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a code to clear the error message when closing the file bug modal.
Hi there.
I delete the
cf_has_regression_range
field. I guess, This field was deprecated.Before We filed the bug without the log-in, but We should log in to call the post request and to file the bug at the moment.
Feel free to tell me If there is something to be modified :)
bug link: https://bugzilla.mozilla.org/show_bug.cgi?id=1837998