Repository navigation
Description
Problem or Motivation
The homelab environment moves to the private repository dan-petty/homelab (tracker #5120, phase 2). Tests and CI jobs in devops-cli check the environment files: for example test_k8s_argocd_apps.py, the manifest part of test_k8s_manifests.py, the environment alert and dashboard tests and the cloudflared checks. #5131 lists each check that moves. #5134 step 6 (plan step 17) deletes the environment files and these checks from devops-cli. No step brings the checks to homelab before the delete. homelab has only .github/workflows/lint.yml (make lint) and no Python test harness. Some invariants also fail on the copy: test_k8s_argocd_apps.py:155 asserts that prune is true, and lines 163-175 assert that each source is devops-cli main.
Proposed Solution & Architectural Design
Step 16 of the corrected plan on #5120. The work is in dan-petty/homelab. This item is a sub-issue of #5120, because the tracker holds the order.
- Bring the environment checks that the refactor(k8s): read the environment tree from the infra repo #5131 list moves to homelab CI.
- Choose one of two ways in the plan of this item:
- a pytest project in homelab with the helpers that the checks need;
- generic checks as product commands of
devopsthat run on any environment root. This way fits the owner's direction for infra repos (feat(infra): manage infra repos with devops infra #5120).
- Change the invariants for the copy. Prune is false until feat(argocd): read the environment from the homelab repo #5134 step 5a (plan step 13) and true after it. Each git source names homelab, except Application
devops(devops-clik8s/devopson main) and the product ref of Applicationprometheus(devops-cli main). - Use path filters on each homelab workflow, so that no workflow runs at each devops-cli release (owner decision on Actions minutes). Renovate makes the version bumps.
- Make each test fixture from the devops-cli history only, never from homelab, because homelab holds the real hosts after plan step 14.
Check.
- homelab CI runs each check that the refactor(k8s): read the environment tree from the infra repo #5131 list moves, and each check passes on the copy.
- The checks are advisory. They report on each pull request. No ruleset, branch protection or other setting makes them required. A failed check does not block a merge or an apply.
Rollback. git revert in homelab.
Downtime. None.
Order and dependencies. Plan step 16. It needs dan-petty/homelab#23 (the copy, plan step 9) and the #5131 list of moved checks. It must land before #5134 step 6 (plan step 17). A person merges.
Owner decision (2026-11-13). homelab is the development environment. It keeps the branch and pull request conventions and gets a .pre-commit-config.yaml with the pre-commit-hooks hook no-commit-to-branch (branch main). It gets no branch protection, no ruleset, no required check and no other gate that blocks or delays work. The step 16 environment checks are advisory: they report on each pull request and never block a merge or an apply.
Target Subsystem
Kubernetes & Minikube Automation
Existing Tool Considered
pytest, kustomize, kube-linter, promtool and the devops commands already cover the checks. The work is to run them on the homelab tree. Cost: about 2M tokens to build, 0.2M a quarter to keep, 4 hours.
Source: #5120
Alternatives check of 2026-11-22: in-use.
The repository already uses this tool.
Tool: pytest (https://pypi.org/project/pytest), MIT, last activity 2026-10-27, maintained.
Reason: Searches found no tool that moves these project-specific checks. pytest, already used by the repository, runs and reports them as tests, but the homelab workflow, path filters, check logic and invariant values stay custom work.
Covers:
- Runs the moved environment checks as one test suite
- Builds each fixture tree from the devops-cli history only
- Reports each test result on a pull request
Lacks:
- Homelab CI workflow with path filters on each check
- The check logic itself: kustomize, kube-linter, promtool, cloudflared image
- Invariant values of the copy, such as prune and git source
- Advisory reporting that blocks no merge or apply
Proposed design
Problem statement
dan-petty/devops-cli moves its homelab environment files to the private repository dan-petty/homelab, and #5134 step 6 deletes the environment checks that stay behind. The checks that move already run in homelab CI: the homelab k8s.yml workflow runs scripts/k8s-checks.py under paths filters, and the person who refused the earlier plan reports that homelab pull request #39 delivered the checks and later homelab pull requests updated them. This item adds no check code to devops-cli; it records the delivery in Step 16 of docs/HOMELAB_REPO_SWITCH.md, which #5134 step 6 waits on, so a reader can run the check of the step.
Acceptance criteria
Requirement: Step 16 names where homelab CI runs the checks
The Step 16 section of docs/HOMELAB_REPO_SWITCH.md SHALL name the homelab workflow .github/workflows/k8s.yml, the script scripts/k8s-checks.py and the live check of the workflow.
Scenario: The step names the workflow and the script
- WHEN
git grep -n 'scripts/k8s-checks.py' -- docs/HOMELAB_REPO_SWITCH.mdruns - THEN the command prints the Step 16 line that names
.github/workflows/k8s.ymlandscripts/k8s-checks.py.
Requirement: Homelab CI runs the moved checks on a pull request
The homelab workflow .github/workflows/k8s.yml MUST run the environment checks on a pull request that changes an environment path and report each result.
Scenario: The newest k8s workflow run of a pull request
- WHEN
gh run list --repo dan-petty/homelab --workflow k8s.yml --limit 1 --json event,conclusionruns after a homelab pull request that changesk8s/llm/valkey.yaml - THEN the command prints one run whose
eventispull_requestand whoseconclusionissuccess.
Requirement: No homelab check is required
The homelab repository MUST NOT hold a branch protection, a ruleset or a required check that blocks a merge or an apply.
Scenario: The protection of main
- WHEN
uv run devops gh api repos/dan-petty/homelab/branches/main/protectionruns - THEN the command exits 1 with the message
Branch not protected, so no check is required.
Requirement: devops-cli keeps the environment paths frozen until step 17
The k8s row of devops ci SHALL keep the environment_freeze check until #5134 step 6 deletes it.
Scenario: A branch that changes an environment file
- WHEN
uv run devops ci test tests/invariants/test_environment_freeze_check.pyruns - THEN the suite passes, and its case for a diff that holds
k8s/llm/valkey.yamlgives exit 1 with a finding that names the path and dan-petty/homelab.
Existing Tool Considered
The alternatives check gives pytest (https://pypi.org/project/pytest) the verdict in-use: MIT, maintained, last activity 2026-10-27, and the repository already runs it. The block in the alternatives check states what pytest lacks, and this item adds no harness and no check code to devops-cli, because homelab runs its own scripts/k8s-checks.py. The own code that homelab keeps instead of a tool that covers it carries the cost of the issue: about 2M tokens to build, 0.2M a quarter to keep and 4 hours.
Key questions
- Where does the work of this item live, and what does it add to devops-cli?: The checks live in dan-petty/homelab: its
k8s.ymlworkflow runsscripts/k8s-checks.pyunderpathsfilters, and the stage return reports that homelab pull request feat(devcontainer): automate PR devcontainer cleanup on PR merge in GHCR #39 delivered the checks and later homelab pull requests updated them. devops-cli adds no check code; its one change is the Step 16 record indocs/HOMELAB_REPO_SWITCH.md, because Step 17 starts only when Step 16 is merged and the check of Step 16 names no command. [sources: openspec/changes/archive/2026-11-22-5408-pr-ready-no-workflow/proposal.md:30, docs/HOMELAB_REPO_SWITCH.md:264, docs/HOMELAB_REPO_SWITCH.md:282] - Which environment checks does the refactor(k8s): read the environment tree from the infra repo #5131 list move?: The
k8srow ofdevops ciwith itstests/gate/k8s_checksmodules (the Argo CD Applications check included), the manifest part of the k8s manifests test, the environment alert and dashboard tests, the cloudflared Deployment check, and the k8s managers of.github/renovate.json. The product basek8s/devopsand its checks stay. [sources: openspec/changes/archive/2026-11-13-5131-environment-root-from-the-infra-repo/proposal.md:31, tests/gate/k8s.py:7] - Which way does the item take: a pytest project in dan-petty/homelab or generic environment checks as
devopsproduct commands?: Neither. Homelab runs its ownscripts/k8s-checks.pyfrom itsk8s.ymlworkflow, and the person who refused the earlier plan reports the work complete there and not buildable in devops-cli. This item adds no second harness and no product command. (best practice) [sources: openspec/changes/archive/2026-11-22-5408-pr-ready-no-workflow/proposal.md:30, docs/HOMELAB_REPO_SWITCH.md:264]- Rejected: A pytest project in dan-petty/homelab. homelab already runs its own script and holds no Python test harness, so a second harness would duplicate the checks and drift.
- Rejected: Product commands of
devopsthat resolve the environment tree. the person who refused the earlier plan returned that design, because the work belongs in homelab and is complete there. - Chosen: Homelab's own
scripts/k8s-checks.py. the homelabk8s.ymlworkflow already runs this script underpathsfilters, so this item adds no check code.
- What does the owner decision of 2026-11-13 require of dan-petty/homelab?: homelab is the development environment. It keeps the branch and pull request conventions and gets
.pre-commit-config.yamlwith the pre-commit-hooks hookno-commit-to-branchonmain. It gets no branch protection, no ruleset and no required check; the Step 16 checks are advisory, report on each pull request and block no merge and no apply. (best practice) [sources: docs/HOMELAB_REPO_SWITCH.md:268, .pre-commit-config.yaml:8, docs/adr/0012-releases-are-derived-by-release-please-from-trunk-and-milestones-are-planning-buckets.md:222]- Chosen: Advisory checks with no required check. the owner decision of 2026-11-13 names the Step 16 checks as advisory, and the runbook says they never block a merge or an apply.
- Rejected: Required checks and a ruleset. the owner decision refuses each gate that blocks or delays work in homelab.
- Which change does devops-cli keep for Step 16 now that homelab CI runs the checks?:
docs/HOMELAB_REPO_SWITCH.mdStep 16 names the homelab workflow.github/workflows/k8s.yml, the scriptscripts/k8s-checks.pyand the live checkgh run list --repo dan-petty/homelab --workflow k8s.yml, so a reader can run the check that Step 17 waits on. (best practice) [sources: docs/HOMELAB_REPO_SWITCH.md:264, docs/HOMELAB_REPO_SWITCH.md:270, docs/HOMELAB_REPO_SWITCH.md:282, openspec/changes/archive/2026-11-22-5408-pr-ready-no-workflow/proposal.md:30]- Chosen: Record the homelab workflow, script and live check in Step 16. Step 17 starts only when Step 16 is merged, and the check of Step 16 names no command, so the record is the one devops-cli change that makes the precondition verifiable.
- Rejected: Close the item with no devops-cli change. the stage job opens a pull request in devops-cli, so an item with no change has nothing to deliver.
- Rejected: Add the checks as
devopsproduct commands. the person who refused the earlier plan returned that design; the checks are delivered in homelab.
- What does devops-cli do with its environment paths now?: The
k8srow ofdevops ciholdsenvironment_freeze, which refuses a branch that changes an environment path until feat(argocd): read the environment from the homelab repo #5134 step 6 deletes it, and its test checks the pathspec without starting git. [sources: tests/gate/k8s.py:7, docs/HOMELAB_REPO_SWITCH.md:184, tests/invariants/test_environment_freeze_check.py:47] - What do homelab#80, feat(ai): dynamic package introspection and multi-source docs ingestion engine #82 and fix(review): remediate session 20260909-122649 findings and enhance feedback self-improvement review loop #87 require of the checks?: The item names them as homelab-side requirements: accept
https://github.com/dan-petty/infraat avtag as a git source, resolve a values template of infra ($infrarefs) withSourceTrees.value_file, and build Kustomize remote bases and components at?ref=tags. devops-cli already does the last two for its own readers:SourceTrees.value_fileresolves$<ref>/<path>and the deploy builds a remote base or component at the revision of its source. No source in this run reads the homelab issue text, so the homelab side stays unverified here. [sources: src/devops_cli/k8s/app_sources.py:127, k8s/README.md:25] - Should a person close feat(k8s): run the environment checks in homelab CI #5296 as delivered?: Yes, once the Step 16 record merges: homelab CI runs the moved checks and reports them as advisory, and feat(argocd): read the environment from the homelab repo #5134 step 6 owns the deletion of the devops-cli environment files and checks. A person merges the record and closes the item. (a person decides)
Open questions
- Should a person close feat(k8s): run the environment checks in homelab CI #5296 as delivered? (a person decides)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both target homelab k8s infrastructure; #4542 sets domain env values while the candidate adds CI checks for moved tests.refactor(k8s): read the environment tree from the infra repo (#5334)
devops-cli-service commentedon Nov 16, 2026
Alternatives check: in-use
Reason: The searches found pytest plus dedicated Kubernetes manifest/rule validators (kube-linter, kubeconform, promtool), and the issue's own "Existing Tool Considered" already names pytest, kustomize, kube-linter, promtool and the
devopscommands as tools that cover the checks. pytest covers the test harness that runs the moved environment checks, but no single tool covers the homelab-specific CI workflow, the path filters and the changed invariants (prune flag, git source refs), so the coverage is only partial.The repository already uses this tool.
Tool: pytest (https://pypi.org/project/pytest)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 73743a2 (see proposed design in issue body).
Moved to new items: #6175, #6176.
dan-petty commentedon Nov 21, 2026
The environment checks in homelab CI must accept
https://github.com/dan-petty/infraat avtag as a git source, and must render Applications that read a values template of infra ($infrarefs, resolved bySourceTrees.value_file) and Kustomize remote bases and components at?ref=tags (dan-petty/homelab#80, dan-petty/homelab#82, dan-petty/homelab#87). Service Applications are generated in the cluster by the services ApplicationSet, so the checks see no service repository source. dan-petty/homelab#78 moves the plain manifest checks (kubeconform, kube-linter, Trivy) to the infra reusable workflow; keep the devops-cli checks of this item beside it.dan-petty commentedon Nov 24, 2026
This item cannot be built in devops-cli. The issue states that the work is in dan-petty/homelab. dan-petty/homelab#39 already implemented the environment checks in scripts/k8s-checks.py, the Makefile, and .github/workflows/k8s.yml on 2026-11-13. Subsequent pull requests dan-petty/homelab#78 and dan-petty/homelab#166 updated these checks for shared infra workflows and infra sources. devops-cli freezes environment paths under environment_freeze.py and holds no homelab CI workflow. Returning item because the work belongs in homelab and is already complete there.
devops-cli-service commentedon Nov 24, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 25, 2026
Step 16 is dan-petty/homelab#244: homelab CI now also builds each path source of the Argo CD Applications (
devops k8s lint). Its other validators already ran there.Scope decision, for the owner to accept with that merge: the
k8sgate checks that assert a value of a manifest are not ported. The owner ordered the removal of such checks on 2026-11-25 (#7231), and step 17 deletes them with the environment files. This replaces the first line of the check of this item ("each check that the #5131 list moves").After the merge of dan-petty/homelab#244, close this item.
dan-petty commentedon Nov 25, 2026
Done with dan-petty/homelab#244 (merged, main green). The scope decision of the comment above stands: no value check was ported.