Skip to content

[CLD-1980]: ci: setup release pipeline for operations-gen#930

Merged
graham-chainlink merged 1 commit intomainfrom
ggoh/cld-1980/release-ci
Apr 16, 2026
Merged

[CLD-1980]: ci: setup release pipeline for operations-gen#930
graham-chainlink merged 1 commit intomainfrom
ggoh/cld-1980/release-ci

Conversation

@graham-chainlink
Copy link
Copy Markdown
Collaborator

@graham-chainlink graham-chainlink commented Apr 15, 2026

Setup changeset config and go releaser config

Similar to chainlink-protos here, i have to override the ci:changeset:publish command with custom script. This is because changeset by default does not understand the tagging semantic for go.

Per the go mod docs,

If a module is defined in a subdirectory within the repository, that is, the module subdirectory portion of the module path is not empty, then each tag name must be prefixed with the module subdirectory, followed by a slash. For example, the module golang.org/x/tools/gopls is defined in the gopls subdirectory of the repository with root path golang.org/x/tools. The version v0.4.0 of that module must have the tag named gopls/v0.4.0 in that repository.

the tag has to be the format <path-to-gomod>/v0.4.0. eg instead of operations-gen@0.4.0 , we want tools/operations-gen/v0.4.0. This means we have to perform tagging ourselves

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-1980

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

⚠️ No Changeset found

Latest commit: 685bb79

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment thread package.json
"private": true,
"scripts": {
"ci:changeset:publish": "pnpm changeset publish",
"ci:changeset:publish": "node ./scripts/release/tag-releases.mjs",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Refer to PR description why we need to do this

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

Sets up a dedicated release stream for the tools/operations-gen Go submodule in this monorepo (Changesets metadata + GoReleaser config + tag-based CI), including Go subdirectory-module tagging (tools/operations-gen/vX.Y.Z) and surfacing release metadata in the CLI.

Changes:

  • Add a workspace/package metadata layer for Changesets (pnpm-workspace.yaml, tools/operations-gen/package.json) and document multi-package versioning guidance.
  • Add a custom CI tagging script (scripts/release/tag-releases.mjs) and wire it into ci:changeset:publish to create both vX.Y.Z and tools/operations-gen/vX.Y.Z tags.
  • Add operations-gen GoReleaser config + tag-triggered workflow, and add a -version flag to print build metadata.

Reviewed changes

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

Show a summary per file
File Description
tools/operations-gen/package.json Introduces Changesets package metadata for the operations-gen submodule.
tools/operations-gen/main.go Adds build metadata vars and -version flag output for releases.
tools/operations-gen/README.md Documents version output and install/release/tagging semantics.
tools/operations-gen/.goreleaser.yml Adds GoReleaser config for building/releasing operations-gen from subdir tags.
scripts/release/tag-releases.mjs Implements custom tag creation/push for root and operations-gen release tags.
pnpm-workspace.yaml Declares pnpm workspace packages (root + operations-gen).
package.json Replaces ci:changeset:publish with the custom tagging script.
VERSIONING.md Adds guidance for selecting packages + notes subdir tag format for operations-gen.
RELEASE.md Documents dual tag formats and operations-gen tag-triggered releases.
.github/workflows/push-tag-release-operations-gen.yml Triggers operations-gen GoReleaser on tools/operations-gen/v* tags.

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

Comment thread scripts/release/tag-releases.mjs Outdated
Comment thread tools/operations-gen/main.go Outdated
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1980/release-ci branch from 73ececa to ab51c67 Compare April 15, 2026 10:48
@graham-chainlink graham-chainlink marked this pull request as ready for review April 15, 2026 10:52
@graham-chainlink graham-chainlink requested a review from a team as a code owner April 15, 2026 10:53
Copilot AI review requested due to automatic review settings April 15, 2026 10:53
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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.


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

Comment thread tools/operations-gen/main_test.go
Comment thread scripts/release/tag-releases.mjs Outdated
Comment thread scripts/release/tag-releases.mjs Outdated
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1980/release-ci branch from ab51c67 to e5fda96 Compare April 15, 2026 11:05
Copilot AI review requested due to automatic review settings April 15, 2026 11:09
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1980/release-ci branch from e5fda96 to 685bb79 Compare April 15, 2026 11:09
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

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


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

Comment thread tools/operations-gen/.goreleaser.yml
@cl-sonarqube-production
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
1 Security Hotspot
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@@ -0,0 +1,6 @@
{
"name": "operations-gen",
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.

Is it possible to have the name as tools/operations-gen ? I am thinking if that works then we do not need the custom script in order to ensure that the release tag is valid for Go packages 🤔 Eg this could generate a tools/operations-gen/vx.y.z tag

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I tried it , it will generate the right name eg tools/operations-gen/0.4.0 but the version is missing v , and we want tools/operations-gen/v0.4.0, also when in this mono repo mode, changeset will also publish the root as chainlink-deployments-framework@0.94.1 instead of just v0.94.1
However when it is in single repo mode, it generates the v0.94.1 with v correctly, weird.

I jsut think that changeset doesnt work well with golang for go get

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 might be wrong but if you set the separator as /v it should have the correct format that is what we do in cld-action to get releases with the v format

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh nice, maybe that can fix the version format, but we still have the issue with the root go mod that changeset will try to publish chainlink-deployments-framework@v0.94.1 instead of just v0.94.1 once we configure the mono repo mode with workspace

Copy link
Copy Markdown
Collaborator Author

@graham-chainlink graham-chainlink Apr 15, 2026

Choose a reason for hiding this comment

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

You can also see that in cld-actions, the package on the root is release as cld-actions/vX.X.X instead of v.X.X.X that we want in cldf

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.

This is actually because we do not set this in cld-action https://github.com/smartcontractkit/.github/blob/4475ad7c475bacb1aefeccb132645149201ababd/actions/cicd-changesets/action.yml#L73-L78

So the release is using the full package name cld-action/vx.y.z

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For historical reference, pasting my findings here on why we can use cicd-changesets with current setup

i can get almost there, tags are correct but the workflow will failed because both changesets-tag-separator and changesets-root-version-package-path  do not seem to work together, there is a piece of logic in signed commit action that is not handling this scenario correctly

we would need to update signed commit action, the cicd changeset action and finally we can use them in our repo. But i will go with my script for now and may put it a bug fix for the .github actions when i get some time.

Screenshot 2026-04-16 at 4 36 33 pm

Copy link
Copy Markdown
Contributor

@DimitriosNaikopoulos DimitriosNaikopoulos left a comment

Choose a reason for hiding this comment

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

I left a suggestion that you might have already tried therefore I will approve this so you are not blocked. In general it would be better if we could avoid the custom logic around tags.

@@ -0,0 +1,6 @@
{
"name": "operations-gen",
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 might be wrong but if you set the separator as /v it should have the correct format that is what we do in cld-action to get releases with the v format

@graham-chainlink graham-chainlink added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit c1e86cc Apr 16, 2026
27 of 28 checks passed
@graham-chainlink graham-chainlink deleted the ggoh/cld-1980/release-ci branch April 16, 2026 06:43
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.

3 participants