feat: add include_env input and environments output#2
Open
eliran-ops wants to merge 2 commits into
Open
Conversation
Adds two new action inputs and one output, gated by `include_env`: - `include_env` (default `false`): when `true`, emit the local skyhook.yaml `environments:` block on the new `environments` output. - `git_token` (default `''`): reserved for a future external-repository fetch path; currently unused. - `environments` output: YAML block, multi-line, passed back via the $GITHUB_OUTPUT heredoc form so quotes / $ / backticks round-trip intact when consumed via env-passthrough. Behavior (per the spec "return it if in the yaml, else 'Not supported yet'"): - `include_env=true` + block present -> emit (incl. `[]` pass-through). - `include_env=true` + block missing (key absent, `null` / `Null` / `NULL` / `~` / bare `environments:`) -> exit 1 "Not supported yet". - `include_env=true` + config file missing -> exit 1 "Not supported yet". - `include_env=false` or unset -> emit empty (backwards compatible). Null detection uses yq's `tag` (`!!null`) so every YAML null spelling is caught - the original textual `"null"` check only matched lowercase. Tests: +24 cases in parse_test.sh covering happy path, every null spelling, `[]` pass-through, missing-config, missing-service-but-env- present orthogonality, log-line assertions, and an `INCLUDE_ENV` unset regression guard. CI smoke job gains an `include_env=true` happy-path contract and a `continue-on-error` "Not supported yet" failure contract using a new `tests/fixtures-no-env/` fixture. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
macOS runners queue for hours on GitHub's hosted pool while ubuntu-latest finishes in 6s. The shell unit suite is OS-independent (bash + yq behave identically across runners), so the macOS leg adds wall-clock latency without proportional coverage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
include_env+git_tokeninputs and theenvironmentsoutput to the action, so callers can read the localenvironments:block fromskyhook.yamlin the same step that resolves service config.include_env=true+ block present → emit (YAML, heredoc-safe;[]passes through)include_env=true+ block missing (key absent, any YAML null spelling, bare key, or whole file missing) → exit 1Not supported yetinclude_env=falseor unset → emit empty (backwards compatible)git_tokendeclared but unused — reserved placeholder for the future external-repository fetch pathNull detection uses
yq … | tag == "!!null"so all four null spellings (null/Null/NULL/~) and bareenvironments:are caught uniformly.Reviewer guide
Order to read:
action.yml— new inputs, new output, env wiring.scripts/parse.sh— newemit_environments()helper + two new exit branches (config-missing-with-include_env, env-block-missing). Existing service-lookup paths unchanged.tests/parse_test.sh— 24 new assertions: happy path, every null spelling,[]pass-through, regression guard forinclude_env=false, log-line guards, orthogonality between env emission and service lookup.tests/fixtures-no-env/— small fixture for the new CI smoke "Not supported yet" contract step..github/workflows/test.yml— two new smoke steps (happy + continue-on-error failure contract).README.md— new inputs/outputs in the tables, env-passthrough usage example, expanded behavior matrix.What's risky:
continue-on-error: true. If the action ever silently succeeded when it should have failed, the immediately-followingoutcome != "failure"assertion catches it.environmentsvalue relies on the existingwrite_outputhelper (16-hex random delimiter, pre-existing pattern).What's mechanical:
action.ymldescription text — they were kept in sync after each iteration of review (any drift was flagged and corrected)./review --deep+ 1 cycle of/pre-pr(DEEP DEEP) ran on this branch before opening. Every actionable item was addressed and re-verified.Test plan
bash tests/metadata_test.sh— passes locallybash tests/parse_test.sh— 81 PASS, 0 FAILshellcheck -S warning scripts/parse.sh tests/parse_test.sh tests/metadata_test.sh— cleanyq e '.' action.ymland both fixture skyhook.yaml files — valid YAMLinclude_envstepsDepends on: #1 (
feat: add required default_build_context / default_dockerfile_path inputs) — this PR targetsship-mainso the diff is exactly the include_env work; rebase tomainafter #1 lands.🤖 Generated with Claude Code
Note
Medium Risk
Adds a new output and new failure modes when
include_env=true(including failing on missing config/environments), which can break workflows that opt into the flag. Core service parsing remains largely unchanged, lowering risk for existing users who keep defaults.Overview
Adds optional
include_env/git_tokeninputs and a newenvironmentsoutput so the action can return the top-levelenvironments:block from the localskyhook.yaml(heredoc-safe, including pass-through ofenvironments: []).Updates
scripts/parse.shto emitenvironmentswhen enabled and to fail fast withNot supported yetwheninclude_env=truebut the config file is missing orenvironmentsis absent/null(detected viayqtag to cover all YAML null spellings).Expands CI and docs: new smoke steps and fixtures for the happy-path and expected-failure contract, plus extensive unit tests covering the new flag behavior and regressions when
include_env=false.Reviewed by Cursor Bugbot for commit 0110e19. Bugbot is set up for automated code reviews on this repo. Configure here.