Skip to content

feat: detect kapi.yaml recipe (kapi 1.2) alongside legacy *.kapi#6

Merged
asgeirf merged 1 commit into
mainfrom
chore/kapi-yaml
Jul 20, 2026
Merged

feat: detect kapi.yaml recipe (kapi 1.2) alongside legacy *.kapi#6
asgeirf merged 1 commit into
mainfrom
chore/kapi-yaml

Conversation

@asgeirf

@asgeirf asgeirf commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

kapi 1.2 renames the project recipe from a directory-named <name>.kapi to the fixed basename kapi.yaml (discovery now matches kapi.yaml exactly). This makes the TM-cache project detection recognize the new fixed name and the legacy *.kapi glob — transitional and non-breaking for existing users.

Changes

  • action.yml — the detect-project step now matches both names.
  • action.yml / README.mdcache-tm and project-dir descriptions and the "Restore project TM cache" step note now say "a kapi.yaml recipe (or legacy *.kapi)".

⚠️ Deviation from the suggested one-liner (please review)

The suggested change was a single ls with two operands:

if ls "${PROJECT_DIR}"/kapi.yaml "${PROJECT_DIR}"/*.kapi >/dev/null 2>&1; then

That does not achieve the intended "detect either name". ls exits non-zero if any operand is missing, so with bash it returns:

dir contents ls a b intended
only kapi.yaml false true
only *.kapi false true
both true true
neither false false

i.e. it would only fire when both a kapi.yaml and a legacy *.kapi exist — breaking the new default case and existing users. I implemented the OR form instead, which yields the intended true/true/true/false:

if ls "${PROJECT_DIR}"/kapi.yaml >/dev/null 2>&1 || ls "${PROJECT_DIR}"/*.kapi >/dev/null 2>&1; then

(Verified empirically under bash for all four cases.)

Untouched

.kapi/ state-dir references are left as-is.

⚠️ Pin set to 1.2.0 — adjust to the actual kapi.yaml-aware release version once cut (kapi.yaml is not yet in a released build). (No version pin exists in this repo; noted for consistency across the kapi 1.2 rename PRs.)

kapi 1.2 renames the project recipe to the fixed basename kapi.yaml
(discovery matches it exactly). Make the TM-cache project detection
recognize both the new kapi.yaml and the legacy *.kapi glob, so the
change is transitional and non-breaking for existing users. Update the
input descriptions and README accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@asgeirf
asgeirf merged commit e9f1a40 into main Jul 20, 2026
10 checks passed
@asgeirf
asgeirf deleted the chore/kapi-yaml branch July 20, 2026 06:22
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