gerritaction
by @craftslab
Query Gerrit accounts, changes, groups, or projects and perform actions like adding reviewers, approving, submitting, or deleting changes via the Gerrit API.
clawhub install gerritactionπ About This Skill
Gerrit Action Skill
Use the gerritaction worker to query Gerrit resources and apply actions to matching changes through the Gerrit API.
When to use
Use this skill when the user wants to:
Worker configuration
The worker is configured by skill/config.yml:
apiVersion: v1
kind: worker
metadata:
name: gerritaction
spec:
gerrit:
host: http://127.0.0.1/
port: 8080
user: user
pass: pass
Required fields:
apiVersion: v1kind: workermetadata.name: gerritactionspec.gerrit.host: Gerrit base URL including schemespec.gerrit.port: Gerrit portspec.gerrit.user: Gerrit usernamespec.gerrit.pass: Gerrit passwordInvocation rules
pip install gerritaction before running commands.gerritaction instead of python action.py.--config-file with a .yml or .yaml file.--account-query, --change-query, --group-query, or --project-query.--change-action together with --change-query in the same invocation.--output-file only for a new .json file path. The command rejects an existing file.--output-file is omitted, query results are printed to standard output as JSON.Supported queries
Account query
Use --account-query to search accounts.
Example:
pip install gerritaction
gerritaction --config-file="skill/config.yml" --account-query="name:john email:example.com"
Change query
Use --change-query to search changes.
Example:
pip install gerritaction
gerritaction --config-file="skill/config.yml" --change-query="status:open since:2024-01-01 until:2024-01-02"
Group query
Use --group-query to search groups.
Example:
pip install gerritaction
gerritaction --config-file="skill/config.yml" --group-query="name:admin member:john"
Project query
Use --project-query to search projects. Project results are enriched with project config, branches, and tags.
Example:
pip install gerritaction
gerritaction --config-file="skill/config.yml" --project-query="name:test state:active"
Supported change actions
The worker supports these change actions:
add-reviewer:account-id[,account-id...]delete-reviewer:account-id[,account-id...]add-attention:account-id[,account-id...]remove-attention:account-id[,account-id...]approve-change:Label=Value[,Label=Value...]delete-changesubmit-changeMultiple actions can be chained in one --change-action value, separated by spaces.
Example:
pip install gerritaction
gerritaction \
--config-file="skill/config.yml" \
--change-query="status:open project:test" \
--change-action="add-reviewer:1001,1002 approve-change:Code-Review=+2"
Output handling
--output-file when the caller needs a persistent JSON artifact.--change-query.Example:
pip install gerritaction
gerritaction \
--config-file="skill/config.yml" \
--project-query="name:test state:active" \
--output-file="/tmp/projects.json"
Safety guidance
delete-change or submit-change, make sure the change query is narrow and explicit.Recommended behavior for the agent
--change-query and --change-action in the same command.--output-file with a new .json path.--change-action without --change-query.