Skip to content

fix(scaffold): gate CI on the project languages a repo declares in .vig-os - #1484

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1478-declare-project-languages
Aug 13, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1478-declare-project-languages

Conversation

@c-vigo

@c-vigo c-vigo commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

CI reported a green Tests check for a repo whose entire Python project had been
deleted. Two individually-correct leniencies composed into one blind spot: no
pyproject.toml -> the recipe body is skipped and exits 0; pyproject.toml
present but nothing collected -> pytest's exit 5 is swallowed (#1281). Together,
CI could not distinguish "no Python suite by design" from "the Python suite
vanished"
— and reported success for both. That is why #1466's damage travelled
as far as it did.

Type of Change

  • fix -- Bug fix

Modifiers

  • Breaking change

SemVer note: this is arguably minor, not patch — it adds a consumer-facing
.vig-os key and a new resolve-toolchain output, and it can turn a previously-green
repo red (by design). Milestone 1.8.1 may need the same rename 1.7.1 -> 1.8.0 got.

Changes Made

The key is a sticky DECLARATION, not a detection cache. A cache would not have
caught #1466: the deploy that deleted pyproject.toml re-ran the scaffold in the
same commit, so a cache would have been rewritten to empty and CI would still have
been green. So DEVKIT_LANGUAGES is seeded from detection, grows when a
language appears, and is never narrowed by the scaffold — removal is a
deliberate .vig-os hand-edit. A declared-but-undetected language prints a loud
scaffold notice rather than being silently reconciled.

  • .vig-os — new DEVKIT_LANGUAGES= key, shipped empty, documented in house style.
  • init-workspace.sh — read before the template overwrite (else an upgrade would
    erase the declaration); enum guard (unknown name aborts, DEVKIT_FEATURES_DISABLED
    shape); union with DETECTED_LANGUAGES; canonical ordering so the written-back
    value is deterministic and does not read as drift each upgrade.
  • resolve-toolchain — new languages output, always emitted (explicit empty
    string when nothing is declared), following the drift-check precedent.
  • ci.yml — one Check declared languages gate as a step of resolve-toolchain.
    Every toolchain job already needs: that job, so a failure stops lint/test/
    commit-checks before they start — which closes the identical lint/format blind
    spot (the issue's option 4) at the same time — and it costs no extra runner,
    container pull or needs: edge. The gate lives in managed ci.yml on purpose:
    justfile.project is a preserved file, so a recipe-only fix would never reach an
    existing consumer.
  • justfile.project — recipes now report the skip instead of no-oping silently,
    and exit 5 is swallowed only while there is no tests/ directory (the issue's
    options 2 and 3). The scaffold ships no tests/ directory, so a fresh scaffold
    stays green.

nix is declared and notified but never gated in CI: it has no single marker file
(flake.nix ships with every direnv scaffold), so its absence is not decidable from
a path. Stated in the manifest comment, the action output, ci.yml and MIGRATION.md.

A language-neutral repo stays green at all three levels — bare template line, explicit
empty output, gate prints "nothing to check" and exits 0. A consumer whose .vig-os
predates the key resolves to the seeded-from-detection default; no hard failure is
reachable from an absent key.

Changelog Entry

### Changed

- **Gate CI on the project languages a repo declares in .vig-os**
  ([#1478](https://github.com/vig-os/devkit/issues/1478))

(full entry with sub-bullets is in CHANGELOG.md)

Testing

  • RED first: uv run pytest tests/test_declared_languages.py -> 28 failed; bats filter -> 4 not ok
  • uv run pytest tests/test_declared_languages.py tests/test_vig_os_manifest.py -> 51 passed
  • uv run pytest (+ test_ci_runner, test_scaffold_drift, test_scaffold_lint, test_install_script, test_integration) -> 223 passed, 19 skipped
  • full suite -> 1372 passed, 20 skipped
  • just test-bats -> 511 ok, 0 not ok
  • prek run --all-files -> only check-expirations fails; .vulnixignore is byte-identical to dev on this branch. Fixed by fix(security): renew the glibc exception block to 2026-09-02 #1482 — merge that first.

Manual Testing Details

Reproduced #1466's shape end to end: scaffolded a Python repo, deleted
pyproject.toml, re-scaffolded — the declaration survived and the notices
printed; the real resolve-toolchain script then emitted languages=python and
the real ci.yml gate step exited 1 with the diagnosable error.

Closes #1478

Refs: #1478

@c-vigo
c-vigo force-pushed the bugfix/1478-declare-project-languages branch from b3f0189 to 7bc10f7 Compare August 13, 2026 08:05
@c-vigo
c-vigo merged commit bcc9214 into dev Aug 13, 2026
12 checks passed
@c-vigo
c-vigo deleted the bugfix/1478-declare-project-languages branch August 13, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant