Skip to content

[draft] split publishing crates in two steps, core crates then cli#2256

Draft
victornicolet wants to merge 6 commits intomainfrom
victornicolet/release-workflow-split-cli-and-core
Draft

[draft] split publishing crates in two steps, core crates then cli#2256
victornicolet wants to merge 6 commits intomainfrom
victornicolet/release-workflow-split-cli-and-core

Conversation

@victornicolet
Copy link
Copy Markdown
Contributor

@victornicolet victornicolet commented Mar 25, 2026

Description of changes

Merges workflow for publishing core crates and symcc into one workflow with different targets:

  • core for all core crates (i.e. not symcc and cli)
  • symcc
  • cli for only the cli.
  • all for publishing all crates at once.
    The workflow requires a tag to decide where to publish from and at least the version of the core crates to check what is being published, or validate what core version symcc is being published on.

It requires explicit versions for what is being published depending on the target, on top of the tag that specifies what code to checkout for publishing.

Issue #, if available

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

  • A change "invisible" to users (e.g., documentation, changes to "internal" crates like cedar-policy-core, cedar

I confirm that this PR (choose one, and delete the other options):

  • Does not update the CHANGELOG because my change does not significantly impact released code.

I confirm that cedar-spec (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar language specification.

Signed-off-by: Victor Nicolet <victornl@amazon.com>
Signed-off-by: Victor Nicolet <victornl@amazon.com>
@victornicolet victornicolet force-pushed the victornicolet/release-workflow-split-cli-and-core branch from fa31d1b to ce4fe29 Compare March 25, 2026 19:05
@victornicolet victornicolet requested a review from Copilot March 25, 2026 19:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 release automation by moving repeated publish/validation logic into a reusable GitHub Actions workflow, and splitting CLI publishing into its own workflow so symcc can be published independently between the base crates and the CLI.

Changes:

  • Replace duplicated validation/publish steps in publish.yml and publish_symcc.yml with a new reusable workflow (publish_reusable.yml).
  • Add a new publish_cli.yml workflow to publish cedar-policy-cli separately from the base crates.
  • Update base and symcc publish workflows to call the reusable workflow with appropriate tag/version settings.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/publish.yml Switches base-crate publishing to the reusable workflow and removes CLI publishing from this workflow.
.github/workflows/publish_symcc.yml Switches SymCC publishing to the reusable workflow.
.github/workflows/publish_cli.yml Adds a new standalone CLI publishing workflow that uses the reusable workflow.
.github/workflows/publish_reusable.yml Introduces a reusable workflow encapsulating validation, version checks, and publishing logic.

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

Signed-off-by: Victor Nicolet <victornl@amazon.com>
@github-actions

This comment was marked as outdated.

@victornicolet victornicolet marked this pull request as ready for review March 25, 2026 19:37
Signed-off-by: Victor Nicolet <victornl@amazon.com>
@cedar-policy cedar-policy deleted a comment from github-actions bot Mar 26, 2026
@cedar-policy cedar-policy deleted a comment from github-actions bot Mar 26, 2026
@victornicolet victornicolet force-pushed the victornicolet/release-workflow-split-cli-and-core branch 2 times, most recently from 25bc50f to ddab8cb Compare March 26, 2026 14:53
Signed-off-by: Victor Nicolet <victornl@amazon.com>
@victornicolet victornicolet force-pushed the victornicolet/release-workflow-split-cli-and-core branch from ddab8cb to a8153fb Compare March 26, 2026 14:54
@github-actions
Copy link
Copy Markdown

Coverage Report

Head Commit: a8153fb2666048e7affbeededb10e907e4b9871f

Base Commit: cf399c60743153481d1a479ec6af0302b5566778

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 100.00%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 86.81%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% 92.55%
cedar-policy 🟡 3995/5344 74.76% 74.76%
cedar-policy-cli 🟡 1120/1565 71.57% 71.57%
cedar-policy-core 🟢 23741/27110 87.57% 87.57%
cedar-policy-formatter 🟢 914/1088 84.01% 84.01%
cedar-policy-symcc 🟢 6752/7273 92.84% 92.84%
cedar-wasm 🔴 0/28 0.00% 0.00%

@cedar-policy cedar-policy deleted a comment from github-actions bot Mar 26, 2026
@cedar-policy cedar-policy deleted a comment from github-actions bot Mar 26, 2026
@cedar-policy cedar-policy deleted a comment from github-actions bot Mar 26, 2026
description: "The GitHub tag to be released. Must be of the form 'v<MAJOR>.<MINOR>.<PATCH>'"

description: "The core SDK tag. Must be of the form 'v<MAJOR>.<MINOR>.<PATCH>'. Required for core, cli, and all."
symcc_tag:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it makes more sense to have one tag and all of the crates to be published come from checking out that tag. If publishing core or all the tag should be of the form v<MAJOR>.<MINOR>.<PATCH>. If publishing just one crate (symcc or the cli) the tag should be <CRATE>-v<MAJOR>.<MINOR>.<PATCH>.

Then, if the target is "all" you need to specify the version of symcc and cli since they can't be extracted from the tag.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree the current version is a little cumbersome because it forces you to always give the tag for core and sometimes the tag to symcc (if you're publishing symcc or all of them).

In the current workflow, all jobs will do at least a validate-core step. We could make the validation for the core tag more meaningful in symcc publishing by making symcc validate that the provided core tag is the version of the core on the provided symcc tag, according to the Cargo.toml.

I think having less implicit things (i.e. having to specify explicit tags, and two of them in some cases where you might only need one) is not necessarily a bad thing. But happy to change and make it easier to run

-p cedar-policy \
-p cedar-policy-cli
fi
# Order matters: dependencies must be listed before dependents.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think the order actually matters if you specify packages in a single cargo publish command.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I cannot find clear documentation that says that it does or it doesn't, and I can find some suggestions that it does. The previous workflow had the crates specified in the dependency order, so unless I'm proven wrong I'll leave it here.

- core
- symcc
- cli
- all
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It may make sense to have "all" be a separate workflow for all and put the shared logic in a composite GitHub action.

Copy link
Copy Markdown
Contributor Author

@victornicolet victornicolet Mar 26, 2026

Choose a reason for hiding this comment

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

Would that mean each main publish workflow is a composite Github action triggered by workflow_dispatch? Otherwise I don't know how well composite actions and workflow_dispatch mix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AFAIK composite actions can be called in the same way any action can. https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action
The advantage of this over a reusable workflow is that it will run in the same job using the same runner as the caller. So you can have it do things like configure the environment.

Copy link
Copy Markdown
Contributor Author

@victornicolet victornicolet Mar 27, 2026

Choose a reason for hiding this comment

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

Pushed another "proposal" that still has all targets, each target runs 2 jobs, no reusable workflow. We could use composite action to remove the copy-pasted parts between each publish job?

@victornicolet victornicolet changed the title split publishing crates in two steps, core crates then cli [draft] split publishing crates in two steps, core crates then cli Mar 26, 2026
@victornicolet victornicolet marked this pull request as draft March 26, 2026 19:09
Signed-off-by: Victor Nicolet <victornl@amazon.com>
@victornicolet victornicolet force-pushed the victornicolet/release-workflow-split-cli-and-core branch from 3e5bfe2 to 3944f43 Compare March 27, 2026 20:54
@github-actions
Copy link
Copy Markdown

Coverage Report

Head Commit: 3944f4386d000a7ce5fa3cbd932a5c53c857dce3

Base Commit: 00d11f2f2f0d87c434afca2872549f61acf21e49

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 100.00%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 86.81%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% --
cedar-policy 🟡 3995/5344 74.76% --
cedar-policy-cli 🟡 1120/1565 71.57% --
cedar-policy-core 🟢 23738/27107 87.57% --
cedar-policy-formatter 🟢 914/1088 84.01% --
cedar-policy-symcc 🟢 6740/7260 92.84% --
cedar-wasm 🔴 0/28 0.00% --

@github-actions
Copy link
Copy Markdown

Coverage Report

Head Commit: 3e5bfe2a8e2e8d004dad57819f373f9aa1da8baf

Base Commit: cf399c60743153481d1a479ec6af0302b5566778

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 100.00%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 86.81%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% 92.55%
cedar-policy 🟡 3995/5344 74.76% 74.76%
cedar-policy-cli 🟡 1120/1565 71.57% 71.57%
cedar-policy-core 🟢 23738/27107 87.57% 87.57%
cedar-policy-formatter 🟢 914/1088 84.01% 84.01%
cedar-policy-symcc 🟢 6740/7260 92.84% 92.84%
cedar-wasm 🔴 0/28 0.00% 0.00%

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