Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

junngo
Copy link
Contributor

@junngo junngo commented May 6, 2024

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

@gmierz
Copy link
Collaborator

gmierz commented May 8, 2024

@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
Copy link
Collaborator

I think it's looking great, I wasn't able to test the code locally yet, I have some issues downloading data in order to do so. Perhaps we can do a deploy to staging in order for all the sheriffs to test this. What do you think @gmierz @junngo?

@gmierz
Copy link
Collaborator

gmierz commented May 9, 2024

@beatrice-acasandrei that sounds great to me!

@junngo
Copy link
Contributor Author

junngo commented May 10, 2024

If we test it locally, we need to set up a Bugzilla api key. It's good to test in staging :)
(I work on dealing with the error handling and push the patch again.)
@beatrice-acasandrei

@junngo junngo force-pushed the bug-1837998 branch 7 times, most recently from ed0eb54 to 92e124c Compare May 14, 2024 15:49
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 47.36842% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 77.05%. Comparing base (110cc98) to head (92e124c).
Report is 30 commits behind head on master.

Files Patch % Lines
ui/perfherder/alerts/StatusDropdown.jsx 0.00% 13 Missing ⚠️
treeherder/webapp/api/bugzilla.py 28.57% 5 Missing ⚠️
ui/perfherder/alerts/FileBugModal.jsx 88.88% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Comment on lines 36 to +38
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,
Copy link
Contributor Author

@junngo junngo May 14, 2024

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"

@junngo
Copy link
Contributor Author

junngo commented May 14, 2024

I added the feature. If there is an error from the server, we can see the error message in the modal.
Let me know If there is anything to change :)

@beatrice-acasandrei @gmierz

@beatrice-acasandrei
Copy link
Collaborator

@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;
}
Copy link
Contributor Author

@junngo junngo May 22, 2024

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

[0]
https://github.com/mozilla/treeherder/pull/8048/files#diff-af3e67b4a4a7bef0c90cd43bf6aa92b3a2815f0d5cbece21c7b079fb9f1e8fc9R146

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

@junngo junngo May 27, 2024

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

Copy link
Collaborator

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.

Copy link
Collaborator

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,
});
}
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants