Skip to content

feat(argo): add branch and worktree annotations to roadmap Workflows #7273

Backlog

Description

@devops-cli-service

Update 2026-11-26 (infra move): the k8s/argo-workflows/ copy that deploys is in dan-petty/homelab, and #7290 deletes the one here (see #7141). The WorkflowTemplates of k8s/devops/ are rag-ingest and infra-drift. No roadmap Workflow exists yet.


Split from #4621.

Problem: The issue asks for branch and worktree annotations on Argo Workflows. The WorkflowTemplates of k8s/devops/ run RAG ingest and infra drift; none runs a roadmap row. ADR 0008 has not moved the roadmap rows to Argo Workflows. Why deferred: No roadmap Workflow exists to carry the annotations. The rest of the Job view uses Kubernetes Jobs. Acceptance criteria: Each roadmap Workflow SHALL carry roadmap.devops-cli/branch and roadmap.devops-cli/worktree annotations. A test SHALL build the roadmap WorkflowTemplate and check the two annotations. kube-state-metrics or the Argo Workflows controller SHALL export the two annotations to Prometheus.

Proposed design

Problem statement

ADR 0021 moves each roadmap job to an Argo Workflow at the engine step (#4566), and no roadmap Workflow exists before that step. The roadmap rows run as Kubernetes Jobs today. The parent change (#4621) adds the annotations roadmap.devops-cli/branch and roadmap.devops-cli/worktree to each Job and to its pod template. This change sets the same two annotations, from the item and the round, on each Workflow that the launcher submits and on its pod metadata. The Prometheus export of the two annotations is deferred to a separate issue, because its kube-state-metrics config lives in dan-petty/homelab.

Acceptance criteria

Requirement: The submitted Workflow carries the branch and the clone path

The roadmap Workflow launcher SHALL set the roadmap.devops-cli/branch and roadmap.devops-cli/worktree annotations on the metadata of each Workflow it submits and on its pod metadata.

Scenario: One item on one branch in one clone

  • WHEN A test calls the pure builder of the Workflow launcher for an item on branch feat/7273-demo with a clone under a temporary folder.
  • THEN The built Workflow holds roadmap.devops-cli/branch with feat/7273-demo and roadmap.devops-cli/worktree with the temporary clone path in metadata.annotations and in spec.podMetadata.annotations.

Requirement: Each Workflow holds the values of its own item and round

The launcher MUST take both annotation values from the item and the round, and not from the shared WorkflowTemplate.

Scenario: Two items of one repository on different branches

  • WHEN A test calls the pure builder for two items of one repository on different branches with different clone paths.
  • THEN Each built Workflow holds its own branch and its own clone path, and the two Workflows hold different values.

Requirement: The Workflow uses the annotation keys of the Job

The launcher SHALL use the BRANCH_ANNOTATION and WORKTREE_ANNOTATION constants of src/devops_cli/k8s/cluster_job.py for the two keys, so one view reads one key for a Job and a Workflow.

Scenario: One view reads the Job and the Workflow with the same keys

  • WHEN A test builds the Workflow of an item and reads the annotation keys of the built Workflow.
  • THEN The two keys equal BRANCH_ANNOTATION and WORKTREE_ANNOTATION of src/devops_cli/k8s/cluster_job.py.

Existing Tool Considered

No alternatives check has run for this item. Argo Workflows is the open, maintained engine that ADR 0021 chooses. It accepts arbitrary annotations on Workflow metadata and on spec.podMetadata, so it lacks nothing here. The change builds no library. The written cost is about 300 tokens of code and about 30 minutes to write and keep. The Prometheus export is deferred to a separate issue.

Key questions

  • Which roadmap WorkflowTemplate exists to carry the branch and worktree annotations?: No roadmap WorkflowTemplate exists. The kustomization lists the rag-ingest, infra-drift and devops-cli-noop templates; none runs a roadmap row. ADR 0021 puts the engine step, which adds a WorkflowTemplate for each job, at feat(k8s): let Argo Workflows run roadmap pods in devops #4566. [sources: k8s/devops/kustomization.yaml:21, k8s/devops/kustomization.yaml:23, k8s/devops/kustomization.yaml:25, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
  • Do the two annotations go on the shared WorkflowTemplate or on each submitted Workflow?: On each Workflow that the launcher submits. The branch belongs to the item and the clone path to the round, and the parent change takes both from the target and from the round that submits the unit. (best practice) [sources: openspec/changes/4621-show-service-jobs-branch-and-work/specs/roadmap-implement-job/runner-job/spec.md, openspec/changes/4621-show-service-jobs-branch-and-work/tasks.md, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md]
    • Chosen: Each submitted Workflow. The branch and the clone path differ for each item and round, and the launcher builds one Workflow for each item.
    • Rejected: The shared WorkflowTemplate. One template holds one stale value for every item and round.
  • Is an annotation the right metadata for the branch and the clone path, or a label?: An annotation. A Kubernetes label value is at most 63 characters and holds no /, and the clone path of a round holds /. The parent change names the two keys as annotations, BRANCH_ANNOTATION and WORKTREE_ANNOTATION, and reads them from kube_job_annotations. (best practice) [sources: docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md, openspec/changes/4621-show-service-jobs-branch-and-work/tasks.md, openspec/changes/4621-show-service-jobs-branch-and-work/design.md]
    • Chosen: An annotation. The clone path holds /, which no label value accepts, and no selector reads the two values.
    • Rejected: A label. A label value is at most 63 characters and holds no /, so a long branch name and the clone path fail.
  • Where on the Workflow do the two annotations go?: On metadata.annotations and on spec.podMetadata.annotations. The Job of the same row carries them on its metadata and on its pod template, and ADR 0022 puts the keys of a Workflow on both the Workflow and its pod metadata. (best practice) [sources: openspec/changes/4621-show-service-jobs-branch-and-work/specs/roadmap-implement-job/runner-job/spec.md, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md, src/devops_cli/k8s/cluster_job.py]
    • Chosen: The Workflow metadata and spec.podMetadata. The Job of the same row carries the two annotations on its metadata and its pod template, and a view of a Workflow pod reads the pod metadata.
    • Rejected: The Workflow metadata only. The Workflow and the Job of one row would carry the keys on different objects, and a view of the pod would miss them.
  • Does the Prometheus export of the two annotations belong to this issue?: No. It goes to a separate issue. The kube-state-metrics config of the cluster lives in dan-petty/homelab, and the parent change leaves the kube-state-metrics values and the dashboard to that repository. (best practice) [sources: openspec/changes/4621-show-service-jobs-branch-and-work/design.md, openspec/changes/4621-show-service-jobs-branch-and-work/proposal.md]
    • Chosen: A separate issue for the export. The exporter config lives in dan-petty/homelab, and no roadmap Workflow exists before the engine step.
    • Rejected: The export in this issue. The config is not in this repository, and the export has nothing to read before the engine step.
  • What does this issue wait on?: This issue waits on feat(k8s): let Argo Workflows run roadmap pods in devops #4566, the engine step, which adds the WorkflowTemplate and the Workflow submission path, and on feat(monitoring): show Service jobs, branch and work log #4621, which adds BRANCH_ANNOTATION and WORKTREE_ANNOTATION to src/devops_cli/k8s/cluster_job.py. Neither constant is in the tree at commit 71dd896. [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md, src/devops_cli/roadmap/job_launcher.py, openspec/changes/4621-show-service-jobs-branch-and-work/tasks.md, src/devops_cli/k8s/cluster_job.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4566, #4621

Watched files

A commit on the default branch that changes one of these files starts the next refine round.

  • k8s/devops/kustomization.yaml
  • src/devops_cli/k8s/cluster_job.py
  • src/devops_cli/roadmap/job_launcher.py

Activity

  1. added
    type/feature
    source/agent
    status/new
    value/medium
    on Nov 26, 2026
  2. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    ContributorAuthor
  3. added
    effort/low
    scope/argo
    priority/p2-medium
    on Nov 26, 2026
  4. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

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

    effort/lowpriority/p2-mediumscope/argosource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions