Skip to content

refactor: make rockcraft-pack follow new call conventions - #73

Merged
bepri merged 6 commits into
mainfrom
work/consolidate-rockcraft
Jul 8, 2026
Merged

refactor: make rockcraft-pack follow new call conventions#73
bepri merged 6 commits into
mainfrom
work/consolidate-rockcraft

Conversation

@bepri

@bepri bepri commented Jul 7, 2026

Copy link
Copy Markdown
Member

This PR moves towards the ideal project structure moving forward. It mirrors the conventions being added in canonical/starflow#155.

  • Each tool's actions will be contained in <tool>/<action>
  • Tests and dists live alongside their action
  • Shared behaviors live in common/ (this will replace _common/ once the composite actions are gone)

@bepri bepri self-assigned this Jul 7, 2026
Copilot AI review requested due to automatic review settings July 7, 2026 13:38

Copilot AI 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.

Pull request overview

This PR refactors the Rockcraft pack action to follow the new “<tool>/<action> + shared common/” conventions, introducing a common workspace package and moving shared builder/action logic there.

Changes:

  • Introduces a new common/ workspace package that centralizes shared tooling (tools.ts), builder logic (craft-builder.ts), and a generic pack runner (pack-action.ts) with unit tests.
  • Adds a new Node action at rockcraft/pack and updates the existing rockcraft-pack entry action to be a composite wrapper that checks out and calls rockcraft/pack.
  • Converts the repo build/test scripts and workspace configuration to a pnpm monorepo layout.

Reviewed changes

Copilot reviewed 8 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsconfig.json Updates TS project includes to focus on common/ and rockcraft/pack/ and excludes dist/.
rockcraft/pack/tests/rockcraft-pack.test.ts Updates Rockcraft pack tests to use the new common package imports and new index entrypoint.
rockcraft/pack/src/index.ts Switches Rockcraft pack implementation to reuse shared common builder/action helpers.
rockcraft/pack/package.json Adds a workspace package definition and build/test scripts for the Rockcraft pack action.
rockcraft/pack/action.yaml Adds the new Node action definition for rockcraft/pack.
rockcraft-pack/action.yml Converts rockcraft-pack into a composite wrapper that checks out and calls rockcraft/pack, and wires outputs.
pnpm-workspace.yaml Declares the workspace packages (common, rockcraft/pack).
pnpm-lock.yaml Updates lockfile to include new workspace importers and dependencies.
package.json Changes root scripts to run build/test recursively in the workspace.
common/tests/tools.test.ts Adds unit tests for new shared tooling helpers in common/src/tools.ts.
common/tests/pack-action.test.ts Adds unit tests for shared input parsing and pack runner behavior.
common/tests/craft-builder.test.ts Adds unit tests for the shared builder base class behavior.
common/src/tools.ts Adds shared environment/tooling helpers (snapd/LXD/tool install + networking adjustments).
common/src/pack-action.ts Adds shared input parsing and a generic “run pack action” helper.
common/src/craft-builder.ts Adds shared builder base class used by tool-specific builders (e.g., Rockcraft).
common/package.json Adds the new @craft-actions/common workspace package with exports.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment thread rockcraft-pack/action.yml
@bepri
bepri requested a review from mr-cal July 7, 2026 13:59
@bepri
bepri marked this pull request as ready for review July 7, 2026 13:59

@alesancor1 alesancor1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, it's great. Just a small note on the comment for rockcraft-pack, see below:

Comment thread rockcraft-pack/action.yml
@bepri
bepri merged commit 2049c56 into main Jul 8, 2026
7 checks passed
@bepri
bepri deleted the work/consolidate-rockcraft branch July 8, 2026 19:19
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.

4 participants