Skip to content

Fix input contract: user-provided context/dockerfile override service_name resolution - #5

Merged
eliran-ops merged 1 commit into
mainfrom
feat/fix-input-contract
Apr 30, 2026
Merged

Fix input contract: user-provided context/dockerfile override service_name resolution#5
eliran-ops merged 1 commit into
mainfrom
feat/fix-input-contract

Conversation

@eliran-ops

@eliran-ops eliran-ops commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix the input contract so user-provided context/dockerfile actually take effect when service_name is also set.
  • Stop the resolve step from always emitting resolved_context=code, which was making inputs.context dead code.
  • Flip build-step precedence to inputs.X || resolved_X || default.

Reviewer guide

Where to start: action.yml is the only changed file.

  • action.yml:45-50 - dropped default: '.' and default: 'Dockerfile' from context/dockerfile inputs so empty == "not provided". Defaults still apply via the build-step fallback below.
  • action.yml:195-253 - resolve step now gated on service_name != '' && (context == '' || dockerfile == ''). Each resolved_* output is only emitted when the corresponding user input is empty.
  • action.yml:347-348 - build step precedence flipped: inputs.X || resolved_X || 'default'.
  • action.yml:399-422 - step summary mirrors the same precedence; source tag is now _(from input)_ vs _(from config)_.

What's risky: the resolved_context=code safety-net previously emitted on early exit (commit 56d501c) is gone. If a caller passes service_name but the config file or service is missing, the build now falls back to inputs.context || '.' instead of the implicit code/. The existing warning ("Falling back to input parameters") now matches behavior; previously it lied. Callers in that state should either fix their config or pass explicit context: code.

What's mechanical: the description text on the two inputs.

Test plan

  • Caller with service_name only and valid config -> resolves from .skyhook/skyhook.yaml (existing behavior).
  • Caller with service_name + explicit context/dockerfile -> user inputs win (the bug being fixed).
  • Caller with no service_name and no inputs -> defaults to ./Dockerfile.
  • Caller with service_name but missing config -> warning + falls back to inputs (or defaults).

🤖 Generated with Claude Code


Note

Medium Risk
Changes how build context/file are selected, which can alter what gets built for existing workflows (especially when service_name is set but config is missing/mismatched). Scope is limited to action.yml but impacts all callers of the composite action.

Overview
Fixes the composite action’s input contract so user-provided context/dockerfile take precedence over values derived from service_name (and defaults apply only when neither input nor config provides a value).

The .skyhook/skyhook.yaml resolve step now runs only when needed and only emits resolved_context/resolved_dockerfile when the corresponding input is empty, and the job summary now reports whether each value came from input vs config.

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

…_name resolution

The resolve step always emitted resolved_context=code (even with no service_name
or as a safety-net on early exit), which made the build step's
`steps.skyhook_config.outputs.resolved_context || inputs.context` chain ignore
inputs.context entirely.

Changes:
- Drop default values from `context` and `dockerfile` inputs so empty means
  "not provided" (defaults still effective via build-step fallback).
- Gate the resolve step on service_name being set AND at least one of
  context/dockerfile being unset.
- Only emit resolved_context/resolved_dockerfile when actually resolved from
  skyhook.yaml (no `code` safety-net on early exit).
- Flip build step precedence to `inputs.X || resolved_X || default` so
  user-provided inputs win over service_name-derived values.
- Update step summary to reflect the same precedence and tag the source.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@eliran-ops
eliran-ops merged commit 1fdb7ba into main Apr 30, 2026
8 of 12 checks passed
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.5.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants