Skip to content

Support OpenCode 1.x and 2.x on version branches - #52

Merged
dmitry-lyfar merged 3 commits into
mainfrom
feat/version-branches-1-2
Oct 7, 2026
Merged

dmitry-lyfar merged 3 commits into
mainfrom
feat/version-branches-1-2

Conversation

@dmitry-lyfar

@dmitry-lyfar dmitry-lyfar commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Converts the OpenCode SDK from a single latest track to two major-version
tracks, 1 and 2, each maintained on its own version branch.

Channels

Channel OpenCode
1/stable 1.x
2/stable 2.x
latest/stable 1.x (promoted from 1, until 2.x becomes the default)

Ran spread tests locally for 2.*.

Follow-ups (not in this PR)

  1. Create version branches 1 (VERSION=1.18.33) and 2 (VERSION=<2.x>) off
    main after merge.
  2. Update terraform long_term_branches to ["1","2"] and branch protection
    (build / build + Renovate bypass) in canonical-repo-automation.
  3. Retire the old latest branch once 1/2 are live.

Move from the single `latest` branch to major-version branches `1` and `2`,
published to the `1` and `2` Store tracks. Track `1` is also promoted to
`latest/stable`, so existing consumers keep getting OpenCode 1.x.

- Download OpenCode 2.x from the `@opencode/cli-linux-*` npm packages,
  verified against the registry's sha512 integrity; 2.x is not published
  as GitHub release assets. 1.x keeps the GitHub release download.
- Stage the version in the SDK so hooks can apply major-specific setup.
- OpenCode 2.x no longer reads /etc/opencode, so export OPENCODE_CONFIG
  pointing at the SDK config. The workshop prompt is still not applied on
  2.x because of anomalyco/opencode#51341; it takes effect once a fixed
  release is picked up.
- Renovate: one regex manager per major (github-releases for 1.x, npm
  @opencode/cli for 2.x), each pinned to its branch.
- Workflows: build/upload on `[0-9]+` branches, track from the branch name.
- Spread: add a 2.x config test, skipped on 1.x.
Drop the base64->hex conversion for npm's sha512 SRI. 1.x keeps GitHub's
sha256 (hex, via sha256sum -c); 2.x compares npm's sha512 SRI directly
(openssl dgst -sha512 -binary | base64). Removes the ACTUAL_CMD indirection,
format guards, and temp-file handling; adds openssl to build-packages.

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.

Copilot review overview

🟢 Approval recommended

The version-specific packaging, publishing, configuration, and tests are consistent and complete.

Review effort: Balanced
Findings: None

What changed in this PR

Adds separate OpenCode 1.x and 2.x release tracks with version-specific packaging, configuration, testing, and dependency updates.

Changes:

  • Adds major-version-aware download and setup logic.
  • Publishes numeric version branches and promotes track 1 to latest.
  • Adds Renovate configuration, documentation, and 2.x config tests.
File Description
sdkcraft.yaml Packages appropriate 1.x or 2.x artifacts.
hooks/​setup-base Configures the 2.x system config path.
renovate.json Updates each version branch independently.
.github/​workflows/​build.yml Builds pull requests targeting version branches.
.github/​workflows/​upload.yml Publishes version tracks and promotes track 1.
tests/​spread.yaml Exposes the tested major version.
tests/​main/​v2-config/​task.yaml Verifies 2.x configuration loading.
tests/​main/​v2-config/​workshop.yaml.in Defines the test workshop.
README.md Documents available tracks and the 2.x limitation.

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

Comment thread .github/workflows/upload.yml Resolved
Comment thread sdkcraft.yaml Resolved
Co-authored-by: Jonathan Conder <[email protected]>
Signed-off-by: Dmitry Lyfar <[email protected]>
@dmitry-lyfar
dmitry-lyfar merged commit f69eef9 into main Oct 7, 2026
1 check passed
@dmitry-lyfar
dmitry-lyfar deleted the feat/version-branches-1-2 branch October 7, 2026 04:03
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