Skip to content

Pass config as a command flag for newer EasyP v1 images - #1

Merged
ZergsLaw merged 1 commit into
masterfrom
feat/command-local-config
Oct 12, 2026
Merged

ZergsLaw merged 1 commit into
masterfrom
feat/command-local-config

Conversation

@ZergsLaw

Copy link
Copy Markdown
Contributor

Summary

easyp-tech/easyp#241 removes the global --cfg flag and the EASYP_CFG variable. In their place, lint, breaking, generate, and validate-config each get their own --config, placed after the command name.

Both actions currently pass the config input as a global --cfg=…, in front of mod download and in front of the command. With an image built from that change, any workflow that sets config fails in the very first step, Download dependencies:

Incorrect Usage: flag provided but not defined: -cfg

Change

Both actions get a new step, Detect config flag placement. It runs only when config is set, and it calls <command> --help in the selected image:

Image Help lists --config lint/breaking get mod download gets
v0.x, v1 nightlies ≤ 20261009.1 no global --cfg=… (as before) global --cfg=… (as before)
v1 builds with easyp#241 yes <command> --config=… nothing: v1 reads protobuf.mod/protobuf.lock, not the policy
config unset — nothing nothing

Some implementation details:

  • The help text is first captured into a variable and only then searched with grep. Piping straight into grep -q under pipefail could misfire on SIGPIPE.
  • The existing --format fallback is kept. The command-local config flag is carried into both attempts.
  • READMEs explain the placement and that, with v1, the input should point to a policy file (easyp.yaml / *.easyp.yaml).

Test plan

Tested locally with a small runner that executes the action.yml steps the way GitHub does. It substitutes inputs.*, github.workspace and steps.*.outputs.*, and runs each step with bash -eo pipefail.

Fixtures were real git repos with an origin, a main branch, and a feature commit. The commit adds a lint violation (BadName) and deletes a field. The config is named so that it cannot be discovered without the input: ci.yaml for v0, ci.easyp.yaml for v1.

Action Image Placement Result
lint v0.17.0 global FIELD_LOWER_SNAKE_CASE annotation, exit 1 ✅
lint v1.0.0-nightly.20261009.1 global 2 annotations, exit 1 ✅
lint local build of easyp#241 command 2 annotations, exit 1 ✅
breaking v0.17.0 global field-deleted annotation, exit 1 ✅
breaking v1.0.0-nightly.20261009.1 global FIELD_NO_DELETE annotation, exit 1 ✅
breaking local build of easyp#241 command FIELD_NO_DELETE annotation, exit 1 ✅
lint (no config) local build of easyp#241 none discovers easyp.yaml, exit 1 with annotations ✅
old lint/action.yml local build of easyp#241 — fails in Download dependencies with a --cfg usage error ❌ (confirms the regression)

Breaking runs on Docker Desktop for macOS occasionally exited 2 with Repository does not exist in current directory. Both the nightly image and the new build hit this. It happens right after the host git fetch rewrites .git, so it is a file-sharing artifact of the local environment, not of this change. GitHub's Linux runners use direct bind mounts.

Merge after or together with easyp-tech/easyp#241. The change is safe to merge first, because older images keep the global form.

🤖 Generated with Claude Code

Newer EasyP v1 builds remove the global --cfg flag and take --config
after lint/breaking. Detect the placement from the command help in the
selected image: keep the global --cfg for v0 and early v1 nightlies,
and pass --config after the command otherwise. mod download only gets
the config with the global form, since v1 reads protobuf.mod instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ZergsLaw
ZergsLaw merged commit 2b9724d into master Oct 12, 2026
@ZergsLaw
ZergsLaw deleted the feat/command-local-config branch October 12, 2026 20:38
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