Skip to content

thirdshift stop for a Run #773

Closed
Closed

Description

@JacobStephens2

Parent

#711

What to build

thirdshift stop <command> [--requeue] is a Stop for a live Run. #574's case becomes one command: stop a Run that started too early, and it isn't taken again.

  1. stop refuses a Command that has ended or died, giving the reason, so no unrelated process is ever signalled.
  2. It writes a Stop request beside the Command record. The request says who asked: the Unix user, from the CLI. Later, the Console will pass an account's email. It also says whether to requeue.
  3. It sends SIGTERM to the Command's process, which interrupts and cleans up as today.
  4. The interrupted Command reads the request. It writes the Activity log line <subject> stopped from the CLI by <who> before its ended: line.
  5. Then it ends its Claim the Stop's way:
    • Without --requeue: needs-triage is added and ready-for-agent is not put back. in-progress follows the usual rules: it's removed when nothing reached origin, and kept while an Issue branch or pull request waits for the Day shift.
    • With --requeue: the Claim is released and ready-for-agent put back, even when something is on origin. The next Run continues the Issue branch (ADR 0002).
  6. stop waits for the record's outcome, or for the process to be gone. Meanwhile it prints a "still ending" line each minute. Then it prints the outcome and the Issue branch or pull request left on origin.

stop never prompts. There is no forced kill.

Acceptance criteria

  • stop on a live Run that had pushed nothing:
    • it ends interrupted;
    • the issue gets needs-triage, without in-progress or ready-for-agent;
    • the Activity log has the stopped line before the ended line.
  • stop on a live Run that pushed its Issue branch keeps in-progress, adds needs-triage, and prints the branch left behind.
  • stop --requeue puts ready-for-agent back and removes in-progress, whether or not the branch was pushed.
  • stop on an ended or died Command is refused with the reason, and no signal is sent.
  • stop prints a "still ending" line while the cleanup runs past a minute.
  • The Claim's in-memory tests cover the Stop endings. End-to-end tests with the existing fakes check the labels and the Activity log.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions