Closed Bug 963204 Opened 9 years ago Closed 8 years ago

slaveapi's reboot action shouldn't create a bug for a slave unless it was unable to reboot it

Categories

(Release Engineering :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bhearsum, Assigned: bhearsum)

References

Details

Attachments

(2 files, 2 obsolete files)

Just noticed this today when I saw https://bugzilla.mozilla.org/show_bug.cgi?id=963197 fly by.
Attached patch fix slave bug creation logic (obsolete) — Splinter Review
Assignee: nobody → bhearsum
Status: NEW → ASSIGNED
Attachment #8364526 - Flags: review?(jhopkins)
Attached patch better patch (obsolete) — Splinter Review
Per IRC, I've modified the patch to not load bug info twice. I switched up the state from REOPENED -> NEW because Bugzilla complains if you try to change a bug from NEW -> REOPENED (which is what happens when the IT bug is filed when the slave bug is already open).
Attachment #8364526 - Attachment is obsolete: true
Attachment #8364526 - Flags: review?(jhopkins)
Attachment #8364576 - Flags: review?(jhopkins)
Attached patch the right patchSplinter Review
Attachment #8364576 - Attachment is obsolete: true
Attachment #8364576 - Flags: review?(jhopkins)
Attachment #8364595 - Flags: review?(jhopkins)
Attachment #8364595 - Flags: review?(jhopkins) → review+
Comment on attachment 8364595 [details] [diff] [review]
the right patch

Landed and bumped the version in Puppet.
Attachment #8364595 - Flags: checked-in+
Landed and working.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
(In reply to Ben Hearsum [:bhearsum] from comment #2)
> Created attachment 8364576 [details] [diff] [review]
> better patch
> 
> Per IRC, I've modified the patch to not load bug info twice. I switched up
> the state from REOPENED -> NEW because Bugzilla complains if you try to
> change a bug from NEW -> REOPENED (which is what happens when the IT bug is
> filed when the slave bug is already open).

Unfortunately,  it seems this patch has stopped the reopening existing bugs.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Justin Wood (:Callek) from comment #6)
> (In reply to Ben Hearsum [:bhearsum] from comment #2)
> > Created attachment 8364576 [details] [diff] [review]
> > better patch
> > 
> > Per IRC, I've modified the patch to not load bug info twice. I switched up
> > the state from REOPENED -> NEW because Bugzilla complains if you try to
> > change a bug from NEW -> REOPENED (which is what happens when the IT bug is
> > filed when the slave bug is already open).
> 
> Unfortunately,  it seems this patch has stopped the reopening existing bugs.

Argh! It looks like RESOLVED -> NEW is also an invalid change:
 69947 2014-01-25 17:01:03,647 - ERROR - Something went wrong while processing!
 69948 Traceback (most recent call last):
 69949   File "/builds/slaveapi/prod/lib/python2.7/site-packages/slaveapi/processor.py", line 58, in _worker
 69950     res, msg = action(slave, *args, **kwargs)
 69951   File "/builds/slaveapi/prod/lib/python2.7/site-packages/slaveapi/actions/reboot.py", line 80, in reboot
 69952     slave.bug.add_comment(status_text, data={"status": "NEW"})
 69953   File "/builds/slaveapi/prod/lib/python2.7/site-packages/slaveapi/clients/bugzilla.py", line 16, in add_comment
 69954     return bugzilla_client.add_comment(self.id_, comment, data)
 69955   File "/builds/slaveapi/prod/lib/python2.7/site-packages/bzrest/client.py", line 66, in add_comment
 69956     return self.update_bug(id_, data)
 69957   File "/builds/slaveapi/prod/lib/python2.7/site-packages/bzrest/client.py", line 61, in update_bug
 69958     return self.request("PUT", "bug/%s" % id_, data)
 69959   File "/builds/slaveapi/prod/lib/python2.7/site-packages/bzrest/client.py", line 51, in request
 69960     raise BugzillaAPIError(resp["code"], resp["message"], resp)
 69961 BugzillaAPIError: (u'You are not allowed to change the bug status from RESOLVED to NEW.', {u'message': u'You are not allowed to change the bug status from RESOLVED to NEW.', u'code': 123, u'error': True})


There's 19 of them in the log, which I think accounts for all of them...
Attached patch fix bug filingSplinter Review
This should fix the issue. I tested it in 4 scenarios against bugzilla-dev:
* No slave bug, no reboot bug: https://bugzilla-dev.allizom.org/show_bug.cgi?id=talos-r3-fed-096
* Open slave bug, no reboot bug: https://bugzilla-dev.allizom.org/show_bug.cgi?id=talos-r3-fed64-058
* Closed slave bug, no reboot bug: https://bugzilla-dev.allizom.org/show_bug.cgi?id=talos-r3-fed-098
* Open slave bug, open reboot bug: https://bugzilla-dev.allizom.org/show_bug.cgi?id=talos-r4-snow-023

The edits around 8:36/8:37 are me manually tweaking bugs to be in the state I needed them to be before testing the patch.
Attachment #8366108 - Flags: review?(bugspam.Callek)
Attachment #8366108 - Flags: review?(bugspam.Callek) → review+
Attachment #8366108 - Flags: checked-in+
This in production and slaverebooter has been turned back on. I'm doing a manual run of it now, to get caught up, then it will continue to run every 4 hours as before.
Status: REOPENED → RESOLVED
Closed: 9 years ago8 years ago
Resolution: --- → FIXED
Duplicate of this bug: 947209
Component: Tools → General
You need to log in before you can comment on or make changes to this bug.