Summary: | Create a generic gerrit plugin to forward command to tb3 | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Norbert Thiebaud <nthiebaud> |
Component: | ci-infra | Assignee: | DavidO <d.ostrovsky> |
Status: | ASSIGNED --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | medium | CC: | bjoern.michaelsen, d.ostrovsky |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Norbert Thiebaud
2013-10-11 13:11:48 UTC
Bjoern, can you provide more infos how to call tb3 + give an test case how to test that? (In reply to comment #1) > Bjoern, can you provide more infos how to call tb3 + give an test case how > to test that? the fact that we eventually call tb3 is irrelevant to the plugin. from the plugin point of view it must know (config) the name of an executable to call and call it with the parameters as decribed above... iow the fact that we intend to use this as a way to drive tb3 is immaterial to the work needed on the plugion side to test it you can just use a small echo-like program that send back to stdout the command line arguments it received and test with ssh gerrit <plugin> args [arg....] and it should output --user <your username in gerrit> --groups='the group you belong too' args [args...] Another IRC session: There is currently not possible to define default SSH command, so the command can not be omitted, instead "call" command should be used instead: ssh gerrit <plugin> call [args] It is not obviously to me how to handle generic arguments. Will have a look here. The actually command has to be configured in <plugin-name>.config file located in $gerrit_site/etc directory. The format of this file is: [shell] target = /home/gerrit/bin/foo ACL = BUILDBOT_USERS forward_user = true forward_user_groups = true where * target is the path to the executable * ACL optionally the group the caller must be in to be able to call that shell utility. If the call is not in this group, then the call is rejected with not authorized error. * forward_user if true, then --user=<user> option should be passed to the target shell utility. What exactly should be passed exactly? Username, i. e. "doe", user id, i. e. "1000031" or prefered Email, i. e. john.doe@example.com as defined in Gerrit? * forward_user_groups if true then the --groups="<group1 group2>, ..." passed to the target shell utility. Blanks are replaced with '_' character. in second thought, may be divide the sections in config file? [shell] target = /home/gerrit/bin/foo [acl] group = BUILDBOT_USERS [forward] user = true groups = true (In reply to comment #3) > > * forward_user if true, then --user=<user> option should be passed to the > target shell utility. What exactly should be passed exactly? Username, i. e. > "doe", user id, i. e. "1000031" or prefered Email, i. e. > john.doe@example.com as defined in Gerrit? Username, as this is easely available and does not change (whereas there can be more than one email addres associated with an account) and yes having section in the cfg file is fine... up to you. First version is ready and deployed on gerrit-test2. Here is a short description of config file: Name: $gerrit_site/etc/plugin-name.config Format: Section: shell * target: aboslute path to the target command to call. Required: yes. * directory: directory where the command should be executed. Required: np. Default $gerrit_site/plugins Section: acl * group: name of the group the calles must be a member of. Required: no. Default: no acl check Section: forward * user: true if user name should be forward to the target command. Required: no. Default false * groups: true if groups should be forwarded to the target command, the curent user is a member of. Required: no. Default fasel. Note: because the names of the groups can contain blanks, the blanks are replaced with "_" chracter. Example: If plugin is loaded as shell.jar, then the plugin name is tb3 and the config file is $gerrit_site/etc/shell.config. $> cat $gerrit_sie/etc/shell.config [shell] target = /home/gerrit2_lo/bin/say-hello directory = / [acl] group = Administrators [forward] user = true groups = true (In reply to comment #6) > If plugin is loaded as shell.jar, then the plugin name is tb3 and the config > file is $gerrit_site/etc/shell.config. Upps: the plugin name is of course shell: If plugin is loaded as shell.jar, then the plugin name is shell and the config file is $gerrit_site/etc/shell.config. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.