Skip to content
open tomato/ rafa
GitHub
rafa pages
  1. rafa
  2. rafa claim

rafa claim

Give up, hand over, accept or take over a device's claim on an issue, so two devices never work the same one.

Before a device plans or starts an issue, it claims it with a branch pushed to the remote, so two devices never work the same issue. rafa claim is how a claim changes hands outside that normal flow. Several devices explains claims and their settings.

Spends: nothing. Changes: claim branches on the remote and the issue's stage label. Needs: gh and push access; see Prerequisites.

NOTE

In the target layout this code lives in the private package rafa-run, bundled into @open-tomato/rafa (Repository layout). In 0.47.0 it is already a package, @open-tomato/rafa-run in packages/rafa-run, but only as a facade: it re-exports this code from the root package's src/, where the files still live until their move. You install and type the same either way. [verify: the release the move lands in]

Actions

ActionDoes
releasegive up this device's claim on an issue, and take its stage label off
handoffer this device's claim on an issue to another store, or withdraw the offer
accepttake up a handover of an issue's claim offered to this device
taketake over another device's stale claim on an issue

rafa claim release

Give up this device's claim on an issue, and take its stage label off.

rafa claim release <n>

Pushes one release commit to the issue's claim branch on origin, leased on the tip it read, so no other device's push is overwritten, then takes rafa:claimed or rafa:in-development off the issue; a label that cannot be written is a warning beside a release that stands. Refused when this device does not own the claim, when the branch moved meanwhile, and when origin cannot be reached. No local branch moves. With --output=json the issue, the branch, the store and the release commit are the data of the terminal result event.

ArgumentTypeWhat it is
nstring, requiredThe issue number whose claim this device gives up.

Examples:

  • rafa claim release 324: Releases this device's claim on #324 and takes its stage label off.
  • rafa claim release 324 --output=json: Writes a start event, then a result event whose data holds the branch and the release commit.

Output formats: text, json.

rafa claim hand

Offer this device's claim on an issue to another store, or withdraw the offer.

rafa claim hand <n> [--to=<string>] [--withdraw]

Pushes one handover commit naming the receiving store to the issue's claim branch on origin, leased on the tip it read, so no other device's push is overwritten. This device stays the owner until the receiver runs rafa claim accept, and until then --withdraw pushes a withdraw commit that ends the offer. Refused when this device does not own the claim, for a repeat handover to the same store, for a withdraw with no handover pending, when the branch moved meanwhile, and when origin cannot be reached. No label and no local branch moves. With --output=json the issue, the branch, the stores and the commit are the data of the terminal result event.

ArgumentTypeWhat it is
nstring, requiredThe issue number whose claim this device hands over.
FlagType and defaultWhat it does
--tostringThe store id to offer the claim to: the receiving store's store_meta.store_id.
--withdrawbooleanTake a pending handover back instead; this device keeps the claim.

Examples:

  • rafa claim hand 324 --to=0b9c6f1e-4d2a-4c55-9a8e-2f7d1c3b5a60: Offers the claim on #324 to that store; it becomes the owner once it accepts.
  • rafa claim hand 324 --withdraw: Takes the pending offer back before the receiver accepts it.

Output formats: text, json.

rafa claim accept

Take up a handover of an issue's claim offered to this device.

rafa claim accept <n>

Pushes one accept commit naming this device's store to the issue's claim branch on origin, leased on the tip it read, so this device owns the claim from then on and no other device's push is overwritten. Refused when no handover pending on the branch names this device's store, when the handover was withdrawn or replaced, when the branch moved meanwhile, and when origin cannot be reached. No label and no local branch moves. With --output=json the issue, the branch, the stores and the commits are the data of the terminal result event.

ArgumentTypeWhat it is
nstring, requiredThe issue number whose handover this device accepts.

Examples:

  • rafa claim accept 324: Accepts the handover of #324 offered to this device's store; this device owns the claim from then on.
  • rafa claim accept 324 --output=json: Writes a start event, then a result event whose data holds the branch and the accept commit.

Output formats: text, json.

rafa claim take

Take over another device's stale claim on an issue.

rafa claim take <n> [--stale]

Pushes one take commit naming this device's store to the issue's claim branch on origin, leased on the tip it read, so this device owns the claim from then on and an owner that pushed meanwhile is never overwritten. Refused while the claim has stood less than claims.staleAfter, whenever that is disabled, and for a stale claim in development (rafa:in-development, or labels that cannot be read) unless --stale is given. A released claim is taken as it is. No label and no local branch moves. With --output=json the issue, the branch, the stores and the take commit are the data of the terminal result event.

ArgumentTypeWhat it is
nstring, requiredThe issue number whose claim this device takes over.
FlagType and defaultWhat it does
--stalebooleanAlso take a stale claim in development, which is never taken over without it.

Examples:

  • rafa claim take 324: Takes over the claim on #324 once it has stood claims.staleAfter at rafa:claimed.
  • rafa claim take 324 --stale: Takes over a stale claim whose loop was started, at rafa:in-development.

Output formats: text, json.