Repository navigation
Description
Problem or Motivation
The roadmap Service works on 7 repositories of 1 owner. The move of Service work into Jobs, Workflows and Valkey adds many objects and keys for each repository: unit Jobs, Workflows, mutexes, Valkey keys, labels and telemetry values. Today each part builds names in its own way:
- 7 ad hoc
.split("/")calls parseowner/name. is_name_segmentandis_repository_name(src/devops_cli/roadmap/stores/store.py:516-527),repository_labelandjob_name(src/devops_cli/k8s/cluster_job.py:53-65) and_resolve_roadmap_repo_path(src/devops_cli/roadmap/run.py:322-340) each use their own rule.- No collision is live today, but six gaps lose the identity of the repository, and three collisions are latent (two need a repository name that no live repository has).
Without one rule, the Jobs and Workflows steps will each make their own names, and two spellings of one repository go into Valkey keys and telemetry.
Proposed Solution & Architectural Design
Add src/devops_cli/github/repo_ref.py with one value type, RepoRef. It parses owner/name one time, at the edge (settings, command options, webhook payloads). key is the casefolded owner/name; display is the GitHub spelling; id is the first 16 hex characters of sha256(key), the value of the implement-repo label today, so live labels stay valid.
Builders (one function each):
- Label values for the owner and the repository: the casefolded part, or a cut value plus
-and 8 hex of the hash when the part is not a valid label value. The pair is exact. - DNS slug: casefold, change runs outside
[a-z0-9]to-, cut to the budget. - Ad hoc names (random suffix):
devops-cli-<what>-<slug(name)>[-<item>]-<6 hex>, only fordevops k8s run-jobJobs and the runner Job until feat(roadmap): Run implement as Argo Workflow with per-group resubmit #3105. - Unit names:
devops-cli-<row>-<slug(name)>-<n>-<10 hex of sha256(key, n, input key)>, 63 characters or fewer. The prefix keeps each unit inside the Argo CD orphan globdevops-cli-*. - Mutex and ConfigMap keys:
<row>-<owner>.<name>[-<n>], casefolded. - Valkey keys:
roadmap:v1:<kind>:<owner>/<name>[:<id>]for state of one repository,roadmap:v1:<kind>[:<id>]for state of the installation, and the twoSCAN MATCHpatterns that find all keys of one repository. - The metric
repovalue (thekey, orotherfor a repository outsideservice.repos), the OpenTelemetry VCS span attributes (vcs.provider.name,vcs.owner.name,vcs.repository.name) and the path parts of a clone.
Also in this item:
- A label value regex in
src/devops_cli/config/constants.py. - The
service.reposcheck refuses a bad form and two entries with the samekey. The error namesservice.repos. is_name_segmentandis_repository_namemove into the module, and their callers change in the same pull request (no shim). Each other helper moves in the item that changes its consumer.- Correct the comment of
CONST_CACHE_NAMESPACE_ROOT(constants.py:2312-2314): the root prefixes only the workstation run index, and each Valkey instance has one owner. - A naming ADR (next free number) owns the rules: object names, labels (one prefix
roadmap.devops-cli/with keysowner,repo,item;app.kubernetes.io/component: roadmap-<row>;app.kubernetes.io/name: devops-cli-jobunchanged;implement-repokept until no code lists by it), the annotationroadmap.devops-cli/repositorywith thekey,OTEL_SERVICE_NAME=roadmap-<row>, Valkey key forms, mutex names, metric, log and trace values, and the cleanup of a removed repository after 7 days. Namespaces do not change. The ADR links to the ADR of the move.
Target Subsystem
SDLC, Git & PR Governance (roadmap Service: src/devops_cli/github/, src/devops_cli/config/, docs/adr/).
Existing Tool Considered
- Kubernetes
metadata.generateName: rejected for Service work. The claim record names the Job first, a dry run must show the name with no request, and a repeated create must get 409. python-slugify: rejected. GitHub names are ASCII, so onere.subdoes it.- The Helm
trunc 63 | trimSuffix "-"pattern: adopted, plus a hash.hashlib.sha256: adopted. kubernetes==36.0.3has no public label value validator, so a regex is added.- OpenTelemetry VCS semantic conventions: adopted for span attributes.
Build: about 120 lines of code and 150 lines of Hypothesis tests. About 200,000 tokens and 2 hours to build, about 10,000 tokens a month to keep, about 40,000 tokens to fix a defect. No new runtime dependency.
Acceptance Criteria
- Hypothesis tests: for any valid
owner/name, each label value matches the label value rule; each ad hoc and unit name is a DNS label of 63 characters or fewer; the unit name is deterministic; two differentkeyvalues give two differentidand unit names; each mutex name is a valid ConfigMap key; the two Valkey patterns of a repository match all its keys and no key of another repository. - The 7 live repositories keep their name as the label value (no hash).
RepoRef("o/.github")is accepted. service.repos: [Owner/Repo, owner/repo]fails with an error that namesservice.repos.- No new runtime dependency.
- The naming ADR is in
docs/adr/and holds no live digest value, hostname or private address.
Dependencies
None. "docs(roadmap): record the roadmap Service move to jobs and Valkey" links to the naming ADR; the pull request that merges second adds the link.
Source: #4517
Proposed design
Problem statement
Each roadmap part builds repository names in its own way: seven .split("/") calls parse owner/name, and four helpers use different rules. Add one RepoRef value type in src/devops_cli/github/repo_ref.py that parses owner/name once and builds labels, DNS names, Job and Workflow names, mutex keys, Valkey keys, metric values and span values from one identity. The item also adds the label value regex, the service.repos validation, the move of the two name helpers with their callers, the corrected cache-root comment and a naming ADR.
Acceptance criteria
Requirement: RepoRef identity
src/devops_cli/github/repo_ref.py SHALL hold RepoRef, which parses owner/name once and exposes key, display and id.
Scenario: Mixed-case repository parse
- WHEN
RepoRefreceivesOwner/Repo - THEN
keyisowner/repo,displayisOwner/Repo, andidis the first 16 hex characters of sha256(owner/repo).
Requirement: Label values
RepoRef SHALL build each label value from the casefolded part, or from a cut part plus - and 8 hex of sha256.
Scenario: Valid and cut label values
- WHEN the owner or repository part is a valid label value, or it is too long
- THEN each label value matches the label value regex, and the owner and repository values stay exact.
Requirement: DNS slug
RepoRef SHALL build a DNS slug by casefolding the name, replacing each run outside [a-z0-9] with -, and cutting to the budget.
Scenario: Name with separators
- WHEN the repository name is
My.Repo_Name - THEN the slug is
my-repo-nameand is a DNS label of 63 characters or fewer.
Requirement: Ad hoc names
RepoRef SHALL build an ad hoc name as devops-cli-<what>-<slug(name)>[-<item>]-<6 hex> for devops k8s run-job and the runner Job until #3105.
Scenario: Ad hoc run-job name
- WHEN an ad hoc Job is named for repository
owner/My.Repo - THEN the name starts with
devops-cli-, ends with 6 hex characters, and is a DNS label of 63 characters or fewer.
Requirement: Unit names
RepoRef SHALL build a unit name from devops-cli-<row>-<slug(name)>-<n> and 10 hex of sha256(key, n, input key), of 63 characters or fewer.
Scenario: Same unit inputs
- WHEN the same repository, row, number and input key are named twice
- THEN the two unit names are equal, start with
devops-cli-, and are DNS labels of 63 characters or fewer.
Requirement: Identity uniqueness
Two different key values SHALL give two different id values and two different unit names.
Scenario: Two repositories
- WHEN
RepoRefparsesowner/oneandowner/two - THEN their
idvalues differ and their unit names differ.
Requirement: Mutex keys
RepoRef SHALL build each mutex and ConfigMap key as <row>-<owner>.<name>[-<n>], casefolded.
Scenario: Mutex key
- WHEN a mutex is named for
Owner/Repoat rowrefineand number 2 - THEN the key is
refine-owner.repo-2and is a valid ConfigMap key.
Requirement: Valkey keys
RepoRef SHALL build Valkey keys as roadmap:v1:<kind>:<owner>/<name>[:<id>], installation keys as roadmap:v1:<kind>[:<id>], and the two SCAN MATCH patterns roadmap:v1:*:<owner>/<name> and roadmap:v1:*:<owner>/<name>:*.
Scenario: Repository key scan
- WHEN the two repository
SCAN MATCHpatterns scan the keys ofowner/repo - THEN they match all its keys and no key of another repository.
Requirement: Metric value
RepoRef SHALL set the metric repo value to key, or to other for a repository outside service.repos.
Scenario: Metric label for a listed and an unlisted repository
- WHEN a metric is recorded for
Owner/Repoinsideservice.reposand for one outside it - THEN the first
repolabel isowner/repoand the second isother.
Requirement: Span and clone values
RepoRef SHALL set the OpenTelemetry VCS span attributes and the clone path parts from the repository identity.
Scenario: Span and clone values
- WHEN a span and a clone path are built for
Owner/Repo - THEN
vcs.provider.nameisgithub,vcs.owner.nameisOwner,vcs.repository.nameisRepo, and the path parts areOwnerandRepo.
Requirement: Label value regex
src/devops_cli/config/constants.py SHALL hold a regex for a valid label value.
Scenario: Label value regex
- WHEN the regex is applied to a leading
-value and to a valid casefolded name - THEN it rejects the leading
-value and matches the valid name.
Requirement: service.repos validation
The service.repos check SHALL refuse a bad form and two entries with the same key, and its error SHALL name service.repos.
Scenario: Duplicate entries differ by case
- WHEN
service.reposholds[Owner/Repo, owner/repo] - THEN the check fails with an error that names
service.repos.
Requirement: Helper move
is_name_segment and is_repository_name SHALL move into src/devops_cli/github/repo_ref.py, and every caller SHALL change in the same pull request with no shim.
Scenario: Callers import the helpers from the new module
- WHEN the pull request is applied
- THEN
src/devops_cli/roadmap/stores/store.pydefines neither helper and exports neither in__all__, andsrc/devops_cli/roadmap/alternatives.pyandsrc/devops_cli/roadmap/stores/github_store.pyimport the helpers from the new module.
Requirement: Constant comment
The comment of CONST_CACHE_NAMESPACE_ROOT SHALL state that the root prefixes only the workstation run index and that each Valkey instance has one owner.
Scenario: Constant comment
- WHEN the constant is read
- THEN its comment names the workstation run index and states one owner per Valkey instance, with no shared multi-tenant Valkey claim.
Requirement: Naming ADR
A naming ADR SHALL be in docs/adr/ at the next free number and SHALL own the naming rules of the item.
Scenario: ADR contents
- WHEN the ADR is read
- THEN it holds object names, labels, the annotation,
OTEL_SERVICE_NAME, Valkey forms, mutex names, metric, log and trace values, and the 7-day cleanup, and it links to the Service move ADR.
Requirement: ADR safety
The naming ADR MUST hold no live digest value, hostname or private address.
Scenario: ADR has no live secrets
- WHEN the ADR is checked
- THEN it holds no live digest value, hostname or private address.
Requirement: Hypothesis name tests
Hypothesis tests SHALL check label values, ad hoc names, unit names and uniqueness for any valid owner/name.
Scenario: Name property tests run offline
- WHEN the test suite runs
- THEN each label value matches the rule, each ad hoc and unit name is a DNS label of 63 characters or fewer, the unit name is deterministic, and different keys give different ids and unit names.
Requirement: Hypothesis key tests
Hypothesis tests SHALL check mutex keys and Valkey patterns for any valid owner/name.
Scenario: Key property tests run offline
- WHEN the test suite runs
- THEN each mutex name is a valid ConfigMap key, and the two Valkey patterns match all keys of one repository and no key of another.
Requirement: Live names and .github
The label value builder SHALL keep the casefolded owner and repository part with no hash when the part is a valid label value, so the 7 live repositories keep their label values, and RepoRef SHALL accept o/.github.
Scenario: Valid part and .github
- WHEN
RepoRefparsesOwner/Repoando/.github - THEN the owner and repository label values are
ownerandrepowith no hash, and the.githubparse succeeds.
Requirement: No runtime dependency
The change SHALL add no new runtime dependency.
Scenario: Dependency files
- WHEN the change is applied
- THEN
pyproject.tomlanduv.lockadd no runtime dependency.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers the exact need. python-slugify is open and maintained but covers a DNS slug only and adds a runtime dependency; the archived stage design already rejected it for ten lines of standard library (openspec/changes/archive/2026-10-29-2654-roadmap-stage/design.md:29). Kubernetes metadata.generateName is server-side only: the claim record names the Job first, a dry run must show the name with no request, and a repeated create must get 409, so it cannot serve. kubernetes==36.0.3 has no public label value validator, so the change adds the label value regex. The Helm trunc 63 | trimSuffix "-" pattern and hashlib.sha256 are adopted. Build cost is about 120 lines of code and 150 lines of Hypothesis tests: about 200,000 tokens and 2 hours to build, about 10,000 tokens a month to keep, and about 40,000 tokens to fix a defect. No new runtime dependency is needed.
Key questions
- Should one
RepoRefvalue type replace the per-caller repository name rules?: Yes. Parseowner/nameonce at the edge and build each name fromRepoRef. (best practice) [sources: src/devops_cli/roadmap/stores/store.py:520-531, src/devops_cli/k8s/cluster_job.py:54-65, src/devops_cli/roadmap/run.py:324-342]- Rejected: Keep each helper and add
RepoRefbeside them. Seven split calls and four rule sets would remain, so two spellings could reach Valkey and telemetry. - Chosen: Add one
RepoRefvalue type with builders. One key, display and id serve labels, DNS names, keys, metrics and spans.
- Rejected: Keep each helper and add
- Which value identifies a repository for labels and hashes?: The casefolded
owner/nameiskey.idis the first 16 hex characters of sha256(key), which is the value of theimplement-repolabel today, so live labels stay valid. (best practice) [sources: src/devops_cli/k8s/cluster_job.py:60-65]- Rejected: Use the GitHub spelling as the key. Case changes would create two identities and two label values.
- Chosen: Use the casefolded key with sha256 first 16 hex. It keeps the live
implement-repolabel value valid. - Rejected: Use the full sha256 digest. It is too long for a label value and an opaque name part.
- How should a label value be built when an owner or repository part is not a valid label value?: Use the casefolded part when it is valid. Otherwise cut it and append
-and 8 hex of sha256, so the pair stays exact and a valid live part keeps no hash. (best practice) [sources: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/, src/devops_cli/k8s/cluster_job.py:60-65]- Rejected: Hash every part. It changes the 7 live label values.
- Rejected: Use
python-slugify. It adds a runtime dependency for ASCII GitHub names. - Chosen: Use the casefolded part, or a cut part plus 8 hex. It keeps live values and makes the pair exact.
- How should a DNS name be built?: Casefold the name, replace each run outside
[a-z0-9]with-, and cut to the budget;hashlib.sha256supplies the hex that keeps the name unique. (best practice) [sources: src/devops_cli/core/dns_names.py:133, src/devops_cli/k8s/cluster_job.py:54-57]- Rejected: Use
python-slugify. It adds a dependency and GitHub names are ASCII. - Chosen: Use one
re.suband a cut. It is small, deterministic and stays inside the DNS label budget. - Rejected: Use Kubernetes
metadata.generateName. It gives no dry-run name and no deterministic name.
- Rejected: Use
- Should unit names be deterministic and ad hoc names random?: Unit names are deterministic from key, row, number and input key. Ad hoc
run-joband runner Job names use a random 6 hex suffix until feat(roadmap): Run implement as Argo Workflow with per-group resubmit #3105. (best practice) [sources: src/devops_cli/k8s/cluster_job.py:54-65]- Rejected: Make every name deterministic. Repeated ad hoc Jobs would collide.
- Rejected: Make every name random. A unit name must repeat for the same unit.
- Chosen: Use deterministic unit names and random ad hoc names. Each use gets the property it needs.
- What form should mutex and ConfigMap keys take?: Use
<row>-<owner>.<name>[-<n>], casefolded. (best practice) [sources: k8s/devops/workflowtemplate-rag-ingest.yaml:12, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md:3]- Rejected: Use a DNS slug. It loses the exact owner and repository pair.
- Rejected: Use a label value pair. A label value pair is not a ConfigMap key.
- Chosen: Use row plus the dotted key. It is a valid ConfigMap key and names the repository.
- What form should Valkey keys and scan patterns take?: Use
roadmap:v1:<kind>:<owner>/<name>[:<id>]for one repository androadmap:v1:<kind>[:<id>]for the installation. The two patternsroadmap:v1:*:<owner>/<name>androadmap:v1:*:<owner>/<name>:*find every key of one repository and no key of another. (best practice) [sources: src/devops_cli/ai/run_store.py:39, src/devops_cli/config/constants.py:2321-2324]- Rejected: Keep the
devops-cliroot. That root prefixes only the workstation run index, not Service state. - Rejected: Use the repository id only. An operator cannot read the repository from the key.
- Chosen: Use
roadmap:v1with the key and an optional id. The key is readable and the two scan patterns find one repository.
- Rejected: Keep the
- Should the metric and OpenTelemetry values use
keyordisplay?: The metricrepovalue iskey, orotheroutsideservice.repos. OpenTelemetry VCS attributes use the GitHub spelling indisplay. (best practice) [sources: https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/, docs/TELEMETRY.md:94]- Rejected: Use
displayfor the metric. Case changes would split one repository into two series. - Rejected: Use
idfor the metric. An opaque digest is hard to read in a metric. - Chosen: Use
keyfor the metric anddisplayfor spans. The metric stays stable and the span shows the GitHub spelling.
- Rejected: Use
- Should
is_name_segmentandis_repository_namemove now, and should other helpers move now?: Move both now with every caller and no shim:src/devops_cli/roadmap/alternatives.pyimports both, andsrc/devops_cli/roadmap/stores/github_store.pyimportsis_repository_name. Move each other helper in the item that changes its consumer. (best practice) [sources: src/devops_cli/roadmap/stores/store.py:520-531, src/devops_cli/roadmap/stores/store.py:1169-1170, src/devops_cli/roadmap/alternatives.py:131-132, src/devops_cli/roadmap/stores/github_store.py:83]- Rejected: Move every helper now. The item would change consumers that another item owns.
- Rejected: Keep a re-export shim. Two rules would remain in the tree.
- Chosen: Move the two helpers with their callers. The item removes the duplicate rule and keeps its scope.
- Where should the naming rules live?: In a new naming ADR under
docs/adr/, at the next free number (0021 when this change starts). It links to the ADR of the Service move. (best practice) [sources: AGENTS.md:39, docs/adr/0016-labels-hold-the-roadmap-items-fields.md:1, docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md:1]- Rejected: Put the rules in code comments. A comment is not a decision record.
- Rejected: Extend ADR 0016. ADR 0016 owns the roadmap fields, not resource names.
- Chosen: Add a naming ADR at the next free number. AGENTS.md sends the reason for a decision to
docs/adr/, and the naming rules are a new decision.
- Should
RepoRef("o/.github")be accepted even though the path resolver rejects a leading dot?: Yes.RepoRefaccepts.githubas a name segment. The leading-dot rule stays only in_resolve_roadmap_repo_path. (best practice) [sources: src/devops_cli/roadmap/stores/store.py:520-531, src/devops_cli/roadmap/run.py:336]- Rejected: Reject
.githubinRepoRef. GitHub has a real repository named.github. - Chosen: Keep the leading-dot rule in the path resolver only. The identity rule accepts the name and the path rule still guards a path.
- Rejected: Reject
- Where should the
service.reposduplicate check run?: In theservice.reposvalidation ofServiceConfig, so every load and command sees one check. (best practice) [sources: src/devops_cli/config/settings.py:1223, src/devops_cli/config/settings.py:1243]- Rejected: Check only inside
RepoRef.RepoRefsees one value, not the list. - Rejected: Check only at Service startup. A bad config would pass other commands.
- Chosen: Check in
servicesettings validation. One validation path covers every consumer.
- Rejected: Check only inside
- What is the next free ADR number?: 0021.
docs/adr/holds 0001 through 0020; a merge that takes 0021 first moves the naming ADR to the next free number. [sources: docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md, docs/adr/0001-github-is-the-roadmap-source.md] - Which modules call the two name helpers today?:
src/devops_cli/roadmap/alternatives.pyimports both and callsis_name_segmentandis_repository_name;src/devops_cli/roadmap/stores/github_store.pyimports and callsis_repository_name.src/devops_cli/roadmap/stores/store.pydefines both and exports them in__all__. [sources: src/devops_cli/roadmap/alternatives.py:131-132, src/devops_cli/roadmap/alternatives.py:349, src/devops_cli/roadmap/alternatives.py:399, src/devops_cli/roadmap/stores/github_store.py:83, src/devops_cli/roadmap/stores/github_store.py:1037, src/devops_cli/roadmap/stores/store.py:520-531, src/devops_cli/roadmap/stores/store.py:1169-1170] - Should the change add a runtime dependency for slugging or hashing?: No. Use
reandhashlibfrom the standard library; the archived stage design already rejectedpython-slugifyfor the same reason. (best practice) [sources: pyproject.toml, openspec/changes/archive/2026-10-29-2654-roadmap-stage/design.md:29, src/devops_cli/k8s/cluster_job.py:65]- Rejected: Add
python-slugify. GitHub names are ASCII and the dependency is not needed. - Chosen: Use the standard library.
re.subandhashlib.sha256cover the need.
- Rejected: Add
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.No live collision exists today, but six gaps and three latent collisions will break as Jobs and Workflows multiply.One rule replaces seven ad hoc parsers and prevents identity loss across labels, Valkey keys, metrics, and telemetry.It adds a new module, rewrites builders for six naming contexts, moves helpers, updates callers, and writes an ADR.Both derive a name from repository identity, but #3771 names a RAG project while the candidate centralises all label, Valkey, mutex, and metric names in one RepoRef module.devops-cli-service commentedon Nov 11, 2026
Status set to Ready at 5f75d25 (see proposed design in issue body).
devops-cli-service commentedon Nov 11, 2026
Released in v0.112.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.112.0
devops-cli-service commentedon Nov 11, 2026
Live since 2026-11-11 14:13 UTC