refactor: make rockcraft-pack follow new call conventions - #73
Merged
Conversation
There was a problem hiding this comment.
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/packand updates the existingrockcraft-packentry action to be a composite wrapper that checks out and callsrockcraft/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.
bepri
marked this pull request as ready for review
July 7, 2026 13:59
alesancor1
approved these changes
Jul 8, 2026
mr-cal
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves towards the ideal project structure moving forward. It mirrors the conventions being added in canonical/starflow#155.
<tool>/<action>common/(this will replace_common/once the composite actions are gone)