We want to use topics for changes that are under development but we need to fetch them because we build from a server. We know we can fetch a commit, and a change, but we want to fetch with the topic name for simplicity reasons.
We haven't found a way. Does somebody know how we could do this?
We have discarded the use of branches for testing developments because it brings trash to the master repository and we would have to delete them after and replicate all those deletes worldwide.
You should use a gerrit query to find all open changes by a known topic:
ssh -p 29418 review.example.com gerrit query --format=JSON topic:MY-TOPIC status:open project:xxx
Then you can iterate over each item in the returned JSON, fetch the changes and build them with your CI.
Old question but maybe improving bit. For CI purpose you also need refs to know patchset you need. so adding --current-patch-set
will give that information.
You can leave also project away as it will give project information anyway. Great for multirepo projects.
ssh -p 29418 review.example.com gerrit query --format=JSON --current-patch-set topic:<TOPIC> status:open
Then just parse json for your needed commits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With