Skip to content

feat: add required default_build_context / default_dockerfile_path inputs#1

Open
eliran-ops wants to merge 2 commits into
mainfrom
ship-main
Open

feat: add required default_build_context / default_dockerfile_path inputs#1
eliran-ops wants to merge 2 commits into
mainfrom
ship-main

Conversation

@eliran-ops

@eliran-ops eliran-ops commented May 5, 2026

Copy link
Copy Markdown

Summary

Adds two required inputs to the action: default_build_context and default_dockerfile_path. Whenever the action would otherwise emit an empty build_context or dockerfile_path (YAML field absent, config file missing, or service missing), the corresponding default flows through. If the relevant default is empty when needed, the action exits 1 with a clear error pointing at the offending input(s) — uniform rule, no asymmetry.

  • ::notice:: is emitted when a default is applied for an otherwise-found service (informational; the YAML simply omitted the field).
  • ::warning:: is emitted when the entire config file or service is missing (more prominent — usually a misconfiguration).

The consuming workflow can drop || fallbacks:

context: code/${{ steps.config.outputs.build_context }}
dockerfile: code/${{ steps.config.outputs.dockerfile_path }}

Test plan

  • bash tests/parse_test.sh — 57/57 PASS locally
  • bash tests/metadata_test.sh — PASS
  • Local simulation of new cfg3 smoke step (service-missing fallback) — outputs match assertions
  • Local simulation of fail-fast (not-found + empty default) — exits 1 with ::error::
  • CI matrix (ubuntu-latest, macos-latest) — verify on the PR run
  • Smoke job — verify all three uses: ./ steps (existing service, default-context fallback, missing-service fallback) succeed

Made with Cursor


Note

Medium Risk
Breaking change for workflows that omitted the new required inputs or relied on empty build outputs; behavior affects all Docker build callers but improves explicit, fail-fast configuration.

Overview
Makes default_build_context and default_dockerfile_path required action inputs and changes how build_context / dockerfile_path are produced: whenever YAML omits them, config/service is missing, or values are empty/null, the action emits the caller’s defaults instead of empty strings or implicit ".".

scripts/parse.sh enforces a uniform fail-fast rule—if a default would be used and the matching input is empty, the step exits 1 with ::error:: (including batched errors when both defaults are needed on not-found paths). Successful fallback paths log ::notice:: (per-field YAML absent) or ::warning:: (missing config or service). On success, consumers can rely on non-empty build outputs and drop workflow || fallbacks.

action.yml, README, smoke workflow, and tests/parse_test.sh are updated for the new contract (required inputs, expanded fail-fast/notice/warning coverage, metadata checks).

Reviewed by Cursor Bugbot for commit 4bd920f. Bugbot is set up for automated code reviews on this repo. Configure here.

…puts

The action requires callers to pass two non-empty defaults for build_context
and dockerfile_path. Whenever a default would be applied (YAML field absent,
config file missing, or service missing), the corresponding default input is
emitted. If a default is needed and the input is empty, the action exits 1
with a clear error pointing at the offending input(s).

Logging:
- ::notice:: when a default is applied for an otherwise-found service
  (the YAML simply omitted the field; informational)
- ::warning:: when the entire config or service is missing and defaults
  flow through (more prominent - usually a misconfiguration)

Tests cover per-field fail-fast, both-empty collect-all error, ::warning::
prefix on not-found paths, and a regression guard that defaults do not leak
when the YAML provides a value (57 PASS).

Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts:
#	.github/workflows/test.yml
#	README.md
#	action.yml
#	scripts/parse.sh
#	tests/parse_test.sh

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4bd920f. Configure here.

echo "default-context outputs OK (empty fallback)"
echo "default-context outputs OK"

- name: Run action with caller-supplied default_* fallbacks

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI test asserts empty but default will be applied

High Severity

The cfg2 step passes default_build_context: '.' and the fixture smoke-default-context has no buildContext in YAML, so parse.sh will apply the default and emit build_context = ".". But the assertion still expects build_context to be empty (""). The step name was updated to reflect the new behavior ("default_build_context applied"), but the assertion and comments were left unchanged from the old behavior. This will cause the smoke CI job to fail on every PR.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4bd920f. Configure here.

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.

2 participants