Skip to content

refactor: use projen primitives for custom workflow definitions#1322

Merged
aws-cdk-automation merged 1 commit intomainfrom
mrgrain/chore/workflow-projen-primitives
Apr 8, 2026
Merged

refactor: use projen primitives for custom workflow definitions#1322
aws-cdk-automation merged 1 commit intomainfrom
mrgrain/chore/workflow-projen-primitives

Conversation

@mrgrain
Copy link
Copy Markdown
Contributor

@mrgrain mrgrain commented Apr 8, 2026

The custom GitHub workflow definitions in projenrc/ hardcode Node.js setup steps and shell commands like yarn workspaces run bump or npx tsx projenrc/publish-to-adc.task.ts. This means that whenever the project's package manager or tooling changes (e.g. migrating from Yarn Classic to Berry), every custom workflow needs to be manually updated to match. Meanwhile, projen-managed workflows already handle this automatically through renderWorkflowSetup() and runTaskCommand().

This refactoring replaces the manual step definitions with projen primitives across all three custom workflow files. In adc-publishing.ts, the hardcoded setup-node and yarn install steps are replaced with renderWorkflowSetup(), and the direct npx tsx invocation is wrapped in a proper publish-to-adc projen task that is then called via runTaskCommand(). In cdk-cli-integ-tests.ts, the same setup replacement is applied, and the hardcoded yarn workspaces run bump and npx projen build commands are replaced with their runTaskCommand() equivalents. In codecov.ts, the manual setup steps are similarly replaced with renderWorkflowSetup().

The regenerated workflow YAML files reflect these changes: actions/setup-node is updated from v4 to v6, the package-manager-cache setting is now explicitly configured, and all task invocations go through npx projen instead of direct tool calls. These are all consequences of using the projen primitives rather than manual changes.

Checklist

  • This change contains a major version upgrade for a dependency and I confirm all breaking changes are addressed
    • Release notes for the new version:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Replace hardcoded setup-node, install, and command steps in custom
workflow definitions with projen's renderWorkflowSetup() and
runTaskCommand() primitives. Create a proper publish-to-adc projen task.
@github-actions github-actions bot added the p2 label Apr 8, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 8, 2026 12:20
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.20%. Comparing base (30d50ce) to head (ff3a1f3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1322   +/-   ##
=======================================
  Coverage   88.19%   88.20%           
=======================================
  Files          73       73           
  Lines       10386    10386           
  Branches     1410     1409    -1     
=======================================
+ Hits         9160     9161    +1     
+ Misses       1199     1198    -1     
  Partials       27       27           
Flag Coverage Δ
suite.unit 88.20% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit 2a848bc Apr 8, 2026
47 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/chore/workflow-projen-primitives branch April 8, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants