You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before 1.0.0 I was updating attributes with the v4 API on both merge requests and hooks and able to save them correctly as the manager recognized I had modified them and was sending the updates to the API. But after 1.0.0 it appears the UpdateMixin (I assume, not familiar with this code) doesn't recognize changes any longer, which will cause the save() calls to fail when Gitlab returns a 400 because it wasn't actually asked to change anything.
Here's what my code looked like before
ifnothas_valid_changelog:
self.log.info(f"Adding CHANGELOG label to {merge_req.web_url}")
if'CHANGELOG'inmerge_req.labels:
self.log.info(f"MR {merge_req.web_url} is already tagged with CHANGELOG label")
returnmerge_req.labels.append('CHANGELOG')
merge_req.save()
And after
ifnothas_valid_changelog:
self.log.info(f"Adding CHANGELOG label to {merge_req.web_url}")
if'CHANGELOG'inmerge_req.labels:
self.log.info(f"MR {merge_req.web_url} is already tagged with CHANGELOG label")
returnmerge_req.labels.append('CHANGELOG')
# Need to stringize, since this doesn't go through the usual routesetattr(merge_req, 'labels', ','.join(merge_req.labels))
merge_req.save()
Before 1.0.0 the code was actually quite stupid and sent everything to the server on update, no matter what had been changed. The new version tries to be smarter but fails in this case (probably a broken equality test on a list).
Ditto. And thanks for the fix. I was just now experiencing the same problem in attempting to update labels for issues via the v4 API. Commit e09581f works for me also.
Ahh nice, sorry I didn't get a chance to confirm the fix for you, but looks like it's part of 1.0.1 so I'll update to that, thanks for the quick turnaround!
Activity
gpocentek commentedon Sep 8, 2017
Thank you for reporting this problem!
Before 1.0.0 the code was actually quite stupid and sent everything to the server on update, no matter what had been changed. The new version tries to be smarter but fails in this case (probably a broken equality test on a list).
I'll look into it ASAP.
Jake-Shadle commentedon Sep 8, 2017
Thanks, no need to rush, this workaround seems to work for now at least. 🙂
gpocentek commentedon Sep 19, 2017
Works for me with the commit e09581f, could you check if this is OK for you if you have a chance?
I'll do a minor release soon.
mshamma commentedon Sep 26, 2017
Ditto. And thanks for the fix. I was just now experiencing the same problem in attempting to update labels for issues via the v4 API. Commit e09581f works for me also.
Jake-Shadle commentedon Sep 26, 2017
Ahh nice, sorry I didn't get a chance to confirm the fix for you, but looks like it's part of
1.0.1so I'll update to that, thanks for the quick turnaround!