Skip to content

chore(ENG-14534): send a release event to downstream repositories - #451

Merged
cloudsmith-iduffy merged 9 commits into
masterfrom
eng-14534-auto-release-cloudsmith-cli-action-on-every-cloudsmith-cli
Oct 19, 2026
Merged

cloudsmith-iduffy merged 9 commits into
masterfrom
eng-14534-auto-release-cloudsmith-cli-action-on-every-cloudsmith-cli

Conversation

@cloudsmith-iduffy

@cloudsmith-iduffy cloudsmith-iduffy commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Each CLI release has to update other repositories, such as the Homebrew tap and cloudsmith-cli-action, and more are planned. Before this PR, the release workflow held the bump logic for each of those repositories as inline YAML. The tap and action jobs were near duplicates, and you could not run either one outside a workflow run.

After this PR, each downstream repository owns its own change:

  • One event from the CLI. The new notify-downstream-repos job runs after publish-github. It sends a cloudsmith-cli-release event with the version to each repository in its matrix. To add a repository, add its name to the matrix.
  • One shared action for the PR. .github/actions/open-cli-bump-pr is a composite action that downstream workflows call. It clones the calling repository, runs that repository's bump command, and opens or updates a PR from cloudsmith-bot. It keeps the behaviour of the old jobs:
    • It uses one release/cloudsmith-cli branch.
    • A newer release replaces a bump that is not merged yet.
    • An older release never replaces a newer one.
    • With merge: "true", it squash-merges the PR when the checks pass.
  • Repository-specific logic stays in each repository. The tap gets scripts/bump-cli-version.py (feat(ENG-14534): bump the formula from the CLI release event homebrew-cloudsmith-cli#41). It reads the sha256 values from the release's SHA256SUMS and checks the downloads against them. The action uses its existing scripts/bump-cli-version.sh (feat(ENG-14534): pin the CLI version and release on each CLI bump cloudsmith-cli-action#49). Each repository can run its bump by hand through workflow_dispatch.

This PR removes publish-homebrew, publish-action, the Homebrew template, and the setup-cloudsmith-bot-git action that the earlier commits of this PR added.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Other (please describe)

Additional Notes

  • Merge order. Merge this PR first. Then repin the open-cli-bump-pr reference in feat(ENG-14534): bump the formula from the CLI release event homebrew-cloudsmith-cli#41 and feat(ENG-14534): pin the CLI version and release on each CLI bump cloudsmith-cli-action#49 to the merged commit on master, and merge those PRs before the next CLI release. If a release ships before they merge, run their Bump Cloudsmith CLI workflow by hand.
  • Secrets. DOWNSTREAM_RELEASE_PUSH_TOKEN must be able to send repository_dispatch to each downstream repository, which needs contents write access. The tap and the action repository also need DOWNSTREAM_RELEASE_PUSH_TOKEN and CLOUDSMITH_BOT_SSH_KEY as their own secrets. A PR opened with GITHUB_TOKEN does not start their checks. Without DOWNSTREAM_RELEASE_PUSH_TOKEN, the notify-downstream-repos job fails. After this merges, nothing uses TAP_PUSH_TOKEN.
  • Order change. The tap now updates after the GitHub release is published, not before. That lets the tap read SHA256SUMS without authentication.
  • Tests. The workflows have no tests. zizmor and pre-commit pass. actionlint 1.7.12 does not know the queue key in concurrency.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 1, 2026 21:49
@cloudsmith-iduffy
cloudsmith-iduffy requested a review from a team as a code owner October 1, 2026 21:49
Comment thread .github/workflows/release.yml Fixed
Comment thread .github/workflows/release.yml Fixed

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

Concurrent releases can generate duplicate action versions and prevent the later action release.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds automation to update cloudsmith-cli-action after each CLI release.

Changes:

  • Adds a release job that opens a signed version-bump PR.
  • Extracts shared bot signing setup into a composite action.
File Description
.github/​workflows/​release.yml Adds action-repository publishing and reuses signing setup.
.github/​actions/​setup-cloudsmith-bot-git/​action.yml Configures Cloudsmith Bot identity and SSH signing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/release.yml Outdated

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

Older release reruns can overwrite a newer unmerged action bump.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Low severity Add required copyright comment to new source file

.github/​actions/​setup-cloudsmith-bot-git/​action.yml:1

This new source file is missing the repository-required copyright comment near the top.

Comment thread .github/workflows/release.yml Outdated

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

Release queue replacement and a PR-merge race can cause action bumps to be lost.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
Resolved since last review (1)

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
@coillteoir

Copy link
Copy Markdown
Contributor

I think it would be better to let dependabot handle it. At the end of the day it is a downstream consumer.

@cloudsmith-iduffy

Copy link
Copy Markdown
Collaborator Author

I think it would be better to let dependabot handle it. At the end of the day it is a downstream consumer.

Interesting idea! let me look into this, I know we do similar with renovate over here https://github.com/cloudsmith-io/devops-live/blob/master/renovate.json

Likely we should update the homebrew formula to follow the same flow.

@cloudsmith-iduffy

Copy link
Copy Markdown
Collaborator Author

I think it would be better to let dependabot handle it. At the end of the day it is a downstream consumer.

Doesn't look to be possible with dependabot - no way to each it of custom file formats. We can do it with renovate though:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended"],
  "enabledManagers": ["custom.regex", "github-actions"],
  "customManagers": [
    {
      "customType": "regex",
      "fileMatch": ["^action\\.yml$"],
      "matchStrings": ["cli-version:[\\s\\S]*?default:\\s*\"(?<currentValue>[^\"]+)\""],
      "datasourceTemplate": "github-releases",
      "depNameTemplate": "cloudsmith-io/cloudsmith-cli",
      "extractVersionTemplate": "^v?(?<version>.*)$",
      "versioningTemplate": "semver"
    }
  ]
}

but this doesn't seem to have good outcomes for a few different reasons

  • Changelog wouldn't get updated
  • Renovate runs on its own cycle rather than insanely when we do a release

@UsmanGhias UsmanGhias 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.

Clean patch for cloudsmith-io/cloudsmith-cli.

Observations:

  • Code structure follows standard OCA guidelines and cleanly isolates the extension logic.

Ready for testing on standard environments.

Regards,
Usman
https://usmanghias.co.uk

@coillteoir

Copy link
Copy Markdown
Contributor

I think it would be better to let dependabot handle it. At the end of the day it is a downstream consumer.

Doesn't look to be possible with dependabot - no way to each it of custom file formats. We can do it with renovate though:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended"],
  "enabledManagers": ["custom.regex", "github-actions"],
  "customManagers": [
    {
      "customType": "regex",
      "fileMatch": ["^action\\.yml$"],
      "matchStrings": ["cli-version:[\\s\\S]*?default:\\s*\"(?<currentValue>[^\"]+)\""],
      "datasourceTemplate": "github-releases",
      "depNameTemplate": "cloudsmith-io/cloudsmith-cli",
      "extractVersionTemplate": "^v?(?<version>.*)$",
      "versioningTemplate": "semver"
    }
  ]
}

but this doesn't seem to have good outcomes for a few different reasons

  • Changelog wouldn't get updated
  • Renovate runs on its own cycle rather than insanely when we do a release

Yeah, renovate, etc. Could in theory solve this. Maybe we could look at some structural schemas for the cloudsmith CLI action. See if theres a way to get it installing using a dependabot supported package manager like homebrew or winget?

Otherwise I'm not going to block this solution. It would be nice to see if we can let dependabot pick up the changes though

@BartoszBlizniak BartoszBlizniak 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 - I've updated the token to be a more generic name DOWNSTREAM_RELEASE_PUSH_TOKEN and replaced the current TAP_PUSH token so that we can use it for both homebrew/gha (and anything else in the future).

@cloudsmith-iduffy cloudsmith-iduffy changed the title feat(ENG-14534): open a cloudsmith-cli-action bump PR on each release feat(ENG-14534): send a release event to downstream repositories Oct 19, 2026
cloudsmith-iduffy and others added 7 commits October 19, 2026 15:59
Add a publish-action release job. It clones cloudsmith-cli-action as
cloudsmith-bot and runs the action's scripts/bump-cli-version.sh. Then it
makes a signed commit and opens a pull request, as publish-homebrew does
for the tap. Without the ACTION_PUSH_TOKEN secret, the job skips.

Move the Cloudsmith Bot commit-signing setup into the
setup-cloudsmith-bot-git composite action, which both jobs use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebuild one release/cloudsmith-cli branch from the action master on each
CLI release, and update the open pull request. Two CLI releases before a
merge then cannot produce two pull requests with the same action version.
Run the job in one concurrency group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read the pin on the open release/cloudsmith-cli pull request before the
bump. When that pin is newer than this release, skip the job, so that a
re-run of an older CLI release cannot replace a newer pending bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep all pending publish-action jobs in the concurrency queue. A
re-run of an older tag no longer cancels a newer pending release.

Check the bump pull request after the push. When it closed during the
update, start the update again from the latest master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the publish-homebrew and publish-action jobs with one
notify-downstream-repos job. The job sends a cloudsmith-cli-release
event with the version to each repository in its matrix. Each
repository owns the change to its files and runs its own workflow.

Add the open-cli-bump-pr composite action for those workflows. It runs
the bump command of the repository in a clone and opens or updates a
pull request from Cloudsmith Bot. A newer release replaces a bump that
is not merged yet, and an older release never replaces a newer one.
The script also runs locally, with --dry-run to show the commit only.

Move the Homebrew formula template to the tap repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cloudsmith-iduffy and others added 2 commits October 19, 2026 15:59
Remove the --dry-run option and the retry when the bump pull request
closes during the update. Remove the test script of open-cli-bump-pr.

Remove the check for DOWNSTREAM_RELEASE_PUSH_TOKEN, so that a release
without the token fails instead of skipping the event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the eng-14534-auto-release-cloudsmith-cli-action-on-every-cloudsmith-cli branch from 3c062d1 to 8f9506d Compare October 19, 2026 15:01
@cloudsmith-iduffy cloudsmith-iduffy changed the title feat(ENG-14534): send a release event to downstream repositories chore(ENG-14534): send a release event to downstream repositories Oct 19, 2026
@cloudsmith-iduffy
cloudsmith-iduffy merged commit 34f5fd9 into master Oct 19, 2026
24 checks passed
@cloudsmith-iduffy
cloudsmith-iduffy deleted the eng-14534-auto-release-cloudsmith-cli-action-on-every-cloudsmith-cli branch October 19, 2026 15:57
cloudsmith-iduffy added a commit to cloudsmith-io/homebrew-cloudsmith-cli that referenced this pull request Oct 19, 2026
- Compare the versions before the script downloads SHA256SUMS. A re-run for
  the pinned version or an older one then does not need the release assets.
- Ignore __pycache__/. The import of render-formula-version writes bytecode,
  and the bump action stages all changes with git add --all.
- Try the download again on all OSError values. A read timeout raises
  TimeoutError, which is not a URLError.
- Pin open-cli-bump-pr to the merge commit of cloudsmith-io/cloudsmith-cli#451.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cloudsmith-iduffy added a commit to cloudsmith-io/homebrew-cloudsmith-cli that referenced this pull request Oct 19, 2026
* feat(ENG-14534): bump the formula from the CLI release event

Add the Bump Cloudsmith CLI workflow. It runs on the
cloudsmith-cli-release event that each CLI release sends, or by hand
with a version. It runs scripts/bump-cli-version.py through the
open-cli-bump-pr action of the CLI repository, which opens the pull
request from cloudsmith-bot and merges it when the checks pass.

The script reads the sha256 values from the SHA256SUMS asset of the CLI
release and verifies each published download against them. It changes
only the version, the sha256 values and the revision of the formula, so
a change to the formula in this repository now persists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ENG-14534): skip the fetch for a pinned version and ignore bytecode

- Compare the versions before the script downloads SHA256SUMS. A re-run for
  the pinned version or an older one then does not need the release assets.
- Ignore __pycache__/. The import of render-formula-version writes bytecode,
  and the bump action stages all changes with git add --all.
- Try the download again on all OSError values. A read timeout raises
  TimeoutError, which is not a URLError.
- Pin open-cli-bump-pr to the merge commit of cloudsmith-io/cloudsmith-cli#451.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants