Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
],
"labels": ["type/chore", "scope/ci"],
"commitMessagePrefix": "chore(deps):",
"kubernetes": {
"managerFilePatterns": ["/^k8s/.+\\.ya?ml$/"]
},
"packageRules": [
{
"matchManagers": ["pep621", "pip_requirements", "pip-compile", "setup-cfg"],
Expand All @@ -18,6 +21,10 @@
"matchManagers": ["dockerfile", "docker-compose"],
"labels": ["type/chore", "scope/infra"]
},
{
"matchManagers": ["kubernetes"],
"labels": ["type/chore", "scope/infra"]
},
{
"matchManagers": ["github-actions"],
"labels": ["type/chore", "scope/ci"]
Expand Down
2 changes: 1 addition & 1 deletion docs/SDLC.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ gitGraph
- **Concise, Effect-Driven Commit Messages**: Commit messages MUST be concise and simply state the direct effect of the specific change. Avoid verbose summaries, compound multi-clause sentences, redundant narrative preambles, or sprawling lists in commit subjects.
- **No Internal References or Numeric IDs**: Never include internal review session timestamps (e.g. `164259`, `003105`), review IDs, subagent IDs, or arbitrary numbers.
- **Declarative Code Ownership (`.github/CODEOWNERS`)**: Pull requests automatically assign reviews based on touched file paths (Core CLI, AI/MCP, K8s, Security, CI/CD).
- **Automated Dependency Updates (`.github/renovate.json`)**: The configuration has Renovate propose `github-actions` and `docker` updates with mandatory `type/chore` taxonomy labels. An update of a base image in the service image's `Dockerfile` has the prefix `fix(deps)`, so that it adds a changelog line to the next release pull request. Every other update has the prefix `chore(deps)`. Renovate acts only where its GitHub App is installed for the repository. Python and `uv` dependencies are updated deliberately as part of the project workflow with synchronized `uv.lock`.
- **Automated Dependency Updates (`.github/renovate.json`)**: The configuration has Renovate propose `github-actions`, `docker` and `kubernetes` updates with mandatory `type/chore` taxonomy labels. An update of a base image in the service image's `Dockerfile` has the prefix `fix(deps)`, so that it adds a changelog line to the next release pull request. Every other update has the prefix `chore(deps)`. The `kubernetes` manager matches no file by default, so the configuration gives it the pattern `^k8s/.+\.ya?ml$`: Renovate opens one pull request for each image tag that a manifest under `k8s/` pins. The `tools.lock` pins and the Helm chart values stay deliberate bumps. Renovate acts only where its GitHub App is installed for the repository. Python and `uv` dependencies are updated deliberately as part of the project workflow with synchronized `uv.lock`.
- **GitHub Project Governance, Views & Labeling Standards**:
- **Declarative Taxonomy (`.github/labels.yml`)**: Every PR must carry `type/*` and `scope/*` labels, audited manually via `devops gh labels audit` (not enforced in CI).
- **GitHub-Sourced Roadmap (ADR 0001)**: Issues are the roadmap's items, milestones are planning buckets that a person sets, and the project board holds their Status and Priority.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
schema: spec-driven
created: 2026-10-26
skip_specs: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Design

## Where the rule lives

`.github/renovate.json` holds the one pattern. The manager has no default pattern, so a pattern is the only way to enable it.

## Rejected alternatives

- **Pattern for single files** (`deployment.yaml` only): rejected. Images sit in `cronjob.yaml`, `valkey.yaml` and `ollama-profiles.yaml` too.
- **Group per namespace**: rejected for now. The issue gives the count of pull requests to a person, and a group can be added later with one rule.
- **Custom manager for `tools.lock`**: rejected. Each entry holds a `sha256` that a bump must change, and the hosted app runs no post-upgrade task.

## Test

`tests/test_renovate_config.py` reads the tracked files under `k8s/` and fails when a file that pins `image: name:tag` matches no pattern.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Proposal

## Why

Issue #2323: Renovate never proposes an update for an image tag in a manifest under `k8s/`.
The `kubernetes` manager of Renovate has no default `managerFilePatterns`, and `.github/renovate.json` sets none.
A person must notice each new release of a pinned image.

## What Changes

- Add `kubernetes.managerFilePatterns` with `^k8s/.+\.ya?ml$` to `.github/renovate.json`.
- Add a package rule that gives the `kubernetes` manager the labels `type/chore` and `scope/infra`. The global `chore(deps):` prefix applies.
- Add `tests/test_renovate_config.py`. It checks that every manifest that pins an image tag matches a pattern.
- Update the Renovate paragraph of `docs/SDLC.md`.
- The change sets `skip_specs: true`: it changes no command, option, message, manifest or service behavior.
- Each image gets its own pull request. No group is set, because the issue leaves the count to a person.
- `tools.lock` stays a manual bump. A `sha256` change needs a post-upgrade task that Renovate cannot run on the hosted app.
- This change fits in one pull request.

## Capabilities

### New Capabilities

None.

### Modified Capabilities

None.

## Impact

- `.github/renovate.json`, `docs/SDLC.md`, `tests/test_renovate_config.py`.

## Feasibility

- The Renovate documents for the `kubernetes` manager (https://docs.renovatebot.com/modules/manager/kubernetes/) state that it has no default `managerFilePatterns`.
- `.github/renovate.json` before the change has no `kubernetes` key: the new test fails on it.
- The manager reads only a file that holds `apiVersion` and `kind`, so Helm values files under `k8s/` yield no update.
- The service image (`ghcr.io/dan-petty/devops-cli/service`) has no tag in the manifests, so Renovate skips it.

## Existing Tool Considered

Renovate, already in use. No code is built and no internal code is deleted.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Tasks

## 1. Renovate configuration

- [x] Add the failing test `tests/test_renovate_config.py`
- Verification: `uv run devops ci test tests/test_renovate_config.py`
- [x] Add the `kubernetes` pattern and the label rule to `.github/renovate.json`
- Verification: `uv run devops ci test tests/test_renovate_config.py`
- [x] Update the Renovate paragraph in `docs/SDLC.md`
- Verification: `git diff docs/SDLC.md`

- Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD).
59 changes: 59 additions & 0 deletions tests/test_renovate_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"""The Renovate configuration covers the image tags that the manifests under `k8s/` pin."""

from __future__ import annotations

import json
import re
import subprocess
from typing import Any

from tests.support.paths import REPO_ROOT

_IMAGE_WITH_TAG = re.compile(r"^\s*-?\s*image:\s*\S+:[\w][\w.-]*\s*$", re.MULTILINE)


def _renovate() -> dict[str, Any]:
return json.loads((REPO_ROOT / ".github" / "renovate.json").read_text(encoding="utf-8"))


def _tracked_k8s_yaml() -> list[str]:
out = subprocess.run(
["git", "ls-files", "k8s"],
cwd=REPO_ROOT,
capture_output=True,
text=True,
check=True,
).stdout
return [name for name in out.splitlines() if name.endswith((".yaml", ".yml"))]


def test_kubernetes_manager_has_a_file_pattern() -> None:
"""The `kubernetes` manager matches no file by default, so the config must name `k8s/`."""
patterns = _renovate().get("kubernetes", {}).get("managerFilePatterns", [])

assert patterns == ["/^k8s/.+\\.ya?ml$/"]


def test_every_manifest_that_pins_an_image_tag_matches_a_pattern() -> None:
patterns = [
re.compile(p.strip("/"))
for p in _renovate().get("kubernetes", {}).get("managerFilePatterns", [])
]
pinned = [
name
for name in _tracked_k8s_yaml()
if _IMAGE_WITH_TAG.search((REPO_ROOT / name).read_text(encoding="utf-8"))
]
unmatched = [name for name in pinned if not any(p.search(name) for p in patterns)]

assert (bool(pinned), unmatched) == (True, [])


def test_kubernetes_updates_carry_the_infra_label_and_the_chore_prefix() -> None:
renovate = _renovate()
rules = [r for r in renovate["packageRules"] if r.get("matchManagers") == ["kubernetes"]]

assert (renovate["commitMessagePrefix"], [r["labels"] for r in rules]) == (
"chore(deps):",
[["type/chore", "scope/infra"]],
)
Loading