Skip to content

refactor: Extract shared PnP processor verify steps into a composite action - #400

Open
EvgheniPopusoi wants to merge 4 commits into
masterfrom
refactor/pnp-processor-verify-composite-action
Open

EvgheniPopusoi wants to merge 4 commits into
masterfrom
refactor/pnp-processor-verify-composite-action

Conversation

@EvgheniPopusoi

@EvgheniPopusoi EvgheniPopusoi commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • pnp-build-autopilot-processor-nested.yml and pnp-processor-build-image.yml duplicated the same setup/verify/lint prefix almost line-for-line: checkout, gcp-secret-manager, setup-gcloud, JDK setup (old/new toggle), Determine version, mvn verify, and the 5-step Kafka Streams Detekt lint block
  • Extracted that shared prefix into composite-actions/pnp/verify-processor, following this repo's existing composite-actions/<clan>/<name> convention. It exposes the determined version as an output so downstream steps (native image packaging, Docker build) can still reference it via steps.verify.outputs.version
  • Both workflows now call the composite action instead of duplicating those steps, then continue with their own Sonar/native-image/pact/Docker/Trivy/attest steps, which differ enough between the two (Trivy scan only in the nested workflow, different Sonar invocation, different native-image master-gating) that I left them un-merged rather than force them into one shape
  • Extended the same refactor to the native workflows' test jobs: pnp-build-native-autopilot-processor-nested.yml and pnp-processor-build-native-image.yml (the latter added in feat: Add pnp-processor-build-native-image workflow for native builds #399, now merged to master — this branch is synced with master and the resulting add/add conflict on that file was resolved in favor of the composite-action version). Neither native workflow had the use-old-setup-java toggle; the composite action already defaults it to false, so no input is needed there.

Non-goals / what I deliberately left alone

  • Sonar analysis step: invocation differs between files (explicit maven-args vs implicit) — left as-is in each caller rather than risk changing Sonar plugin behavior for existing consumers
  • Native image packaging, Docker build/push, Trivy scan, attest: master-gating and -DskipTests differ between files — left in each caller unchanged
  • The separate build-image/release/deploy-staging jobs in the native workflows keep their own Determine version steps unchanged, since composite action outputs don't cross job boundaries

Test plan

  • python3 -c "import yaml; yaml.safe_load(...)" on all changed/added files
  • Consume all four workflows from a real PnP processor repo and confirm the test/build/build-image jobs still pass and produce the same image tags

🤖 Generated with Claude Code

EvgheniPopusoi and others added 4 commits September 11, 2026 11:48
…action

pnp-build-autopilot-processor-nested.yml and pnp-processor-build-image.yml
duplicated the same setup/verify/lint prefix (checkout, secrets, gcloud,
JDK setup, version, mvn verify, Kafka Streams Detekt lint). Extracts that
into composite-actions/pnp/verify-processor and has both workflows call it,
exposing the determined version as a step output for the remaining
native-image/docker/pact/sonar steps that differ between the two.

No behavior change: step order, conditions, and args are preserved in both
callers; only the identical prefix moved into the composite action.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adopts pnp-processor-build-image.yml for GraalVM native image builds,
following the same pattern used to derive
pnp-build-native-autopilot-processor-nested.yml from
pnp-build-autopilot-processor-nested.yml: splits test and native
build-image into separate jobs (native compile runs on a 4-core
runner with an 80 minute timeout), adds graalvm-version/distribution
inputs, and bumps the default java-version to 25.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…kflows too

Applies the same deduplication to pnp-build-native-autopilot-processor-nested.yml
and pnp-processor-build-native-image.yml: their "test" jobs duplicated the same
checkout/secrets/gcloud/JDK/version/verify/Kafka-lint prefix now extracted into
composite-actions/pnp/verify-processor. Neither native workflow has the
use-old-setup-java toggle, which the composite already defaults to false, so no
input needed there. The separate build-image/release/deploy-staging jobs keep
their own "Determine version" steps unchanged, since composite outputs don't
cross job boundaries.

No behavior change: step order, conditions, and args are preserved.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…sor-verify-composite-action

# Conflicts:
#	.github/workflows/pnp-processor-build-native-image.yml
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