https://bugzilla.wikimedia.org/show_bug.cgi?id=36228

--- Comment #5 from Antoine "hashar" Musso <[email protected]> 2012-06-18 19:50:25 
UTC ---
We can use gerrit 'query' to get files changed by a patchset.

$ gerrit query 11899 --patch-sets --files --format=json > ~/JSON
+ ssh -p 29418 [email protected] 'gerrit query 11899 --patch-sets
--files --format=json'


Gives you a nice JSON structure to parse

            "files":[
                {"file":"/COMMIT_MSG",
                    "type":"ADDED"
                },
                {"file":"additions/php_file.php",
                    "type":"ADDED"
                },
                {"file":"additions/sql_file.php",
                    "type":"ADDED"
                }
            ]

The Gerrit trigger plugin does publish the change number as an environment
variable (GERRIT_CHANGE_NUMBER). We could then write a script that would query
Gerrit for the list of files that change involve (command above), then based on
some logic the script could set a reviewer on the change (using gerrit
set-reviewers).

Commands:

 gerrit query $GERRIT_CHANGE_NUMBER --patch-sets --files --format=json 

 gerrit set-reviewers $GERRIT_CHANGE_NUMBER -add [email protected]

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to