Page MenuHomePhabricator

Allow fixsuggesterbot to use the edit API endpoint
Closed, ResolvedPublic

Description

I'd like for Fix-Suggester-Bot to be able to use the "Change file content in Change Edit" API endpoint in Gerrit https://gerrit.wikimedia.org/r/Documentation/rest-api-changes.html#put-edit-file. The idea is that Fix Suggester Bot will push a modified version of a file that fails PHPCS (and later, eslint, or other automatically fixable issues).

If I try to do that with fixsuggesterbot user currently, I get Error 403 (Forbidden): edit not permitted. Maybe the user needs to be in the mediawiki group? The bot will only work on MW core and extensions that opt in to using it.

Event Timeline

From IRC:

10:53:04 <p858snake|cloud> kostajh: if its a amending someone elses patchset, they need trusted-contribs iirc

From IRC:

10:53:04 <p858snake|cloud> kostajh: if its a amending someone elses patchset, they need trusted-contribs iirc

Although, I am not sure that is the issue. fixsuggesterbot uses the email address kharlan+fixsuggesterbot@wikimedia.org so that should pass the checks in zuul/layout.yaml, and those checks (&test_pipeline at top of layout.yaml) are also just about running tests after submitting a patch (AIUI).

kostajh claimed this task.

Added the bot to the Trusted-Contributors group per the guidelines in T238651: Discussion about Trusted-Contributors Gerrit group:

Members of this group can amend changes submitted by someone else. The group is viral in that current members can add new members to the group. See T238651.

Trusted-Contributors is for human.

The bot should be added to Service Users, that marks the account as being a bot (different queue for processing their requests).

I have added fixsuggesterbot to the Service Users group. I think that would also cause the old comments made that by bot to be hidden in the web interface. EarlyWarningBot should probably be added to that group as well.

I have added fixsuggesterbot to the Service Users group. I think that would also cause the old comments made that by bot to be hidden in the web interface.

thanks!

EarlyWarningBot should probably be added to that group as well.

Sure, could you add it please?

EarlyWarningBot should probably be added to that group as well.

Sure, could you add it please?

Of course I should have done it immediately, thank you for the remainder. I have !log tagging T323750: Provide early feedback when a patch has job failures.

Another benefit is that service users are treated differently in the Web UI: the messages sent to previous patchsets are automatically hidden. That is similar to how old tagged messages are hidden (T48148) which I guess both bots are already doing ;)

Long live the 🤖s!