Require an Astro config in the bun-astro rule #68

Closed
opened 2026-11-19 19:20:05 +00:00 by martin · 4 comments
Owner

Goal

Stop the global bun-astro rule from matching non-Astro Bun repositories by requiring an Astro config file in addition to bun.lock and package.json.

Context

The rule currently matches any repository whose root contains bun.lock and package.json:

[rules.bun-astro]
match_patterns = ["bun.lock", "package.json"]
workflows = ["bun-verify", "bun-push", "bun-deploy"]

Personal/backstage has package.json and is adopting bun.lock in #42, so it now matches even though it is a Backstage app, not Astro. The injected Bun workflow (bun-verify) runs Astro-only commands and fails.

The extension already ANDs every match_patterns entry against root file names and supports globs, so this is a repository-owned config change. No woodpecker-extension release or repository-local opt-out is needed.

Scope

  • Add an Astro config pattern to rules.bun-astro.match_patterns in shared/base/modules/services/woodpecker/woodpecker-extension.nix.
  • Prefer astro.config.* so .ts, .mjs, and .js projects still match; astro.config.ts alone would miss Astro's default .mjs variant.
  • Keep bun.lock and package.json so the rule remains Bun-specific.
  • Deploy the updated extension configuration and verify the resolved global workflows.
  • Do not add a woodpecker.toml opt-out or a label-based rule exclusion.

Acceptance criteria

  • rules.bun-astro.match_patterns requires bun.lock, package.json, and an Astro config (astro.config.*, or astro.config.ts if every Astro repo here uses TypeScript).
  • Personal/backstage no longer matches the rule and receives none of the Bun global workflows (bun-verify/bun-push/bun-deploy, or their global-bun-* names if #69 lands first).
  • At least one known Astro repository still matches and receives all three Bun workflows.
  • A Bun repository without an Astro config no longer matches.
  • The extension service starts cleanly and the global endpoint returns the updated rule.
  • PR Personal/backstage#42 can merge and its next push pipeline no longer contains the Bun verify workflow (bun-verify, or global-bun-verify after #69).
## Goal Stop the global `bun-astro` rule from matching non-Astro Bun repositories by requiring an Astro config file in addition to `bun.lock` and `package.json`. ## Context The rule currently matches any repository whose root contains `bun.lock` and `package.json`: ```toml [rules.bun-astro] match_patterns = ["bun.lock", "package.json"] workflows = ["bun-verify", "bun-push", "bun-deploy"] ``` `Personal/backstage` has `package.json` and is adopting `bun.lock` in #42, so it now matches even though it is a Backstage app, not Astro. The injected Bun workflow (`bun-verify`) runs Astro-only commands and fails. The extension already ANDs every `match_patterns` entry against root file names and supports globs, so this is a repository-owned config change. No `woodpecker-extension` release or repository-local opt-out is needed. ## Scope - Add an Astro config pattern to `rules.bun-astro.match_patterns` in `shared/base/modules/services/woodpecker/woodpecker-extension.nix`. - Prefer `astro.config.*` so `.ts`, `.mjs`, and `.js` projects still match; `astro.config.ts` alone would miss Astro's default `.mjs` variant. - Keep `bun.lock` and `package.json` so the rule remains Bun-specific. - Deploy the updated extension configuration and verify the resolved global workflows. - Do not add a `woodpecker.toml` opt-out or a label-based rule exclusion. ## Acceptance criteria - [x] `rules.bun-astro.match_patterns` requires `bun.lock`, `package.json`, and an Astro config (`astro.config.*`, or `astro.config.ts` if every Astro repo here uses TypeScript). - [x] `Personal/backstage` no longer matches the rule and receives none of the Bun global workflows (`bun-verify`/`bun-push`/`bun-deploy`, or their `global-bun-*` names if #69 lands first). - [x] At least one known Astro repository still matches and receives all three Bun workflows. - [x] A Bun repository without an Astro config no longer matches. - [x] The extension service starts cleanly and the global endpoint returns the updated rule. - [x] PR Personal/backstage#42 can merge and its next push pipeline no longer contains the Bun verify workflow (`bun-verify`, or `global-bun-verify` after #69). ## Related - Personal/backstage#20 and Personal/backstage#42 - Personal/backstage#44 (closed as superseded; no `woodpecker.toml` opt-out) - Personal/woodpecker-extension#50 (general enhancement; no longer blocks this work) - #69 (global workflow name prefix; changes the workflow names, not this matcher change) - Replaces the earlier extension-bump and label-rule scope of this issue.
Author
Owner

Decision: use the direct ignored_workflows feature from Personal/woodpecker-extension#50. This issue is now scoped to bumping and deploying the extension after #50 ships; the match_not_labels rule change is dropped.

Decision: use the direct `ignored_workflows` feature from Personal/woodpecker-extension#50. This issue is now scoped to bumping and deploying the extension after #50 ships; the `match_not_labels` rule change is dropped.
martin changed title from Bump woodpecker-extension and add a label opt-out to the bun-astro rule to Bump woodpecker-extension to the release with ignored_workflows support 2026-11-20 19:00:41 +00:00
martin changed title from Bump woodpecker-extension to the release with ignored_workflows support to Require an Astro config in the bun-astro rule 2026-11-20 20:02:31 +00:00
Author
Owner

Scope changed after review: rather than bumping the extension and adding an opt-out, narrow bun-astro so it requires an Astro config. The rule currently matches any root with bun.lock + package.json, which is why Personal/backstage is a false positive. This is now a one-line match_patterns change in this repository; no extension release or woodpecker.toml file is needed.

Scope changed after review: rather than bumping the extension and adding an opt-out, narrow `bun-astro` so it requires an Astro config. The rule currently matches any root with `bun.lock` + `package.json`, which is why Personal/backstage is a false positive. This is now a one-line `match_patterns` change in this repository; no extension release or `woodpecker.toml` file is needed.
Author
Owner

Concrete change:

bun-astro = {
  description = "Bun + Astro fullstack application";
  match_patterns = [
    "astro.config.*"
    "bun.lock"
    "package.json"
  ];
  workflows = [
    "bun-verify"
    "bun-push"
    "bun-deploy"
  ];
};

match_patterns is ANDed and matched against root file names, so all three must exist. Using astro.config.* covers .ts, .mjs, and .js; if every Astro repository here uses TypeScript, astro.config.ts is equivalent. After deployment, a Backstage push pipeline should contain only the repository-owned application-checks workflow and no Bun verify workflow.

If #69 lands first, the workflow keys and workflows entries above become global-bun-verify, global-bun-push, and global-bun-deploy; the match_patterns change is unaffected.

Concrete change: ```nix bun-astro = { description = "Bun + Astro fullstack application"; match_patterns = [ "astro.config.*" "bun.lock" "package.json" ]; workflows = [ "bun-verify" "bun-push" "bun-deploy" ]; }; ``` `match_patterns` is ANDed and matched against root file names, so all three must exist. Using `astro.config.*` covers `.ts`, `.mjs`, and `.js`; if every Astro repository here uses TypeScript, `astro.config.ts` is equivalent. After deployment, a Backstage push pipeline should contain only the repository-owned `application-checks` workflow and no Bun verify workflow. If #69 lands first, the workflow keys and `workflows` entries above become `global-bun-verify`, `global-bun-push`, and `global-bun-deploy`; the `match_patterns` change is unaffected.
Author
Owner

Progress

  • Added astro.config.* to rules.bun-astro.match_patterns in shared/base/modules/services/woodpecker/woodpecker-extension.nix (commit 4d2e812, pushed to main).
  • Deployed on nidaros; woodpecker-extension.service active with the updated rule in /etc/woodpecker-extension/config.toml.

Validation

  • Personal/martials.no pipeline #261 (post-deploy push): resolved bun-verify, bun-push, and bun-deploy. bun-verify ran and failed on the renovate dependency build, unrelated to the matcher.
  • Personal/backstage pipeline #123 (PR, head 61ebe6c = PR #42): resolved only flake-check, renovate-lint, pr-review, global-forgejo-release, and application-checks. No bun-* workflow was injected.
  • Backstage #123 has bun.lock and package.json but no Astro config, covering the Bun-without-Astro case.
  • PR Personal/backstage#42 reports mergeable: true.

All acceptance criteria are satisfied.

## Progress - Added `astro.config.*` to `rules.bun-astro.match_patterns` in `shared/base/modules/services/woodpecker/woodpecker-extension.nix` (commit 4d2e812, pushed to `main`). - Deployed on `nidaros`; `woodpecker-extension.service` active with the updated rule in `/etc/woodpecker-extension/config.toml`. ## Validation - `Personal/martials.no` pipeline #261 (post-deploy push): resolved `bun-verify`, `bun-push`, and `bun-deploy`. `bun-verify` ran and failed on the renovate dependency build, unrelated to the matcher. - `Personal/backstage` pipeline #123 (PR, head `61ebe6c` = PR #42): resolved only `flake-check`, `renovate-lint`, `pr-review`, `global-forgejo-release`, and `application-checks`. No `bun-*` workflow was injected. - Backstage #123 has `bun.lock` and `package.json` but no Astro config, covering the Bun-without-Astro case. - PR Personal/backstage#42 reports `mergeable: true`. All acceptance criteria are satisfied.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Personal/nixos-configuration#68
No description provided.