Skip to content

feat(envd): automate version bumps with changesets#2973

Draft
mishushakov wants to merge 1 commit into
mainfrom
mishushakov/envd-go-changesets
Draft

feat(envd): automate version bumps with changesets#2973
mishushakov wants to merge 1 commit into
mainfrom
mishushakov/envd-go-changesets

Conversation

@mishushakov

Copy link
Copy Markdown
Member

Description

Replaces the manual pkg/version.go bump rule with a changesets-based release flow, using plain npm and a small shell script to sync the version into Go.

  • PRs touching packages/envd/ must now include a changeset (npx changeset, or npx changeset --empty for changes that can't affect the compiled binary) — enforced by a new envd-changeset PR check.
  • On merge to main, the new envd-release workflow runs npx changeset version, syncs the bumped version from packages/envd/package.json into pkg/version.go via scripts/sync-envd-version.sh, updates packages/envd/CHANGELOG.md, and commits the release back to main with the autofixer app.
  • Adds minimal npm workspace stubs (root package.json + packages/envd/package.json) whose only purpose is to give changesets a version to manage; docs updated in CLAUDE.md, packages/envd/README.md, and .changeset/README.md.

Note: the autofixer GitHub App needs permission to push to main (branch-protection bypass) for the release commit to land.

🤖 Generated with Claude Code

Replace the manual pkg/version.go bump rule with a changesets-based
release flow. PRs touching packages/envd must add a changeset
(npx changeset); on merge to main, the envd-release workflow consumes
pending changesets, bumps package.json and pkg/version.go (via
scripts/sync-envd-version.sh), updates CHANGELOG.md, and commits the
release back to main using the autofixer app. A new PR check enforces
that envd changes include a changeset.

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

cursor Bot commented Jun 10, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Release and CI tooling only; no runtime envd behavior changes, though the autofixer app must be allowed to push release commits to main.

Overview
This replaces manual bumps of pkg/version.go with a changesets-driven release for envd. Contributors add a changeset (or an empty one) when they change envd; PR CI verifies that. After merge to main, automation applies pending changesets, updates the npm version stub and changelog, syncs the version into Go via scripts/sync-envd-version.sh, and commits back to main using the autofixer app.

Reviewed by Cursor Bugbot for commit fb2e839. Bugbot is set up for automated code reviews on this repo. Configure here.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

The version validation and replacement regexes in scripts/sync-envd-version.sh do not support semver prerelease tags or build metadata, which can cause the script to fail when validating prerelease versions or locating the version constant in the Go file. Updating these regexes to allow optional prerelease suffixes ensures compatibility with all valid semver formats and prevents release blockages.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +15 to +25
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Unexpected version '$version' in $package_json" >&2
exit 1
fi

if ! grep -qE 'const Version = "[0-9]+\.[0-9]+\.[0-9]+"' "$version_go"; then
echo "❌ Could not find 'const Version = \"X.Y.Z\"' in $version_go" >&2
exit 1
fi

sed -E -i.bak "s/const Version = \"[0-9]+\.[0-9]+\.[0-9]+\"/const Version = \"$version\"/" "$version_go"

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.

high

The version validation and replacement regexes do not support semver prerelease tags or build metadata, which are standard features of changesets. If a prerelease version like 0.6.3-beta.0 is generated, the script will fail to validate the version or locate the constant in the Go file, blocking the release process. Updating the regexes to allow optional prerelease suffixes ensures compatibility with all valid semver formats.

Suggested change
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Unexpected version '$version' in $package_json" >&2
exit 1
fi
if ! grep -qE 'const Version = "[0-9]+\.[0-9]+\.[0-9]+"' "$version_go"; then
echo "❌ Could not find 'const Version = \"X.Y.Z\"' in $version_go" >&2
exit 1
fi
sed -E -i.bak "s/const Version = \"[0-9]+\.[0-9]+\.[0-9]+\"/const Version = \"$version\"/" "$version_go"
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then
echo "❌ Unexpected version '$version' in $package_json" >&2
exit 1
fi
if ! grep -qE 'const Version = "[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?"' "$version_go"; then
echo "❌ Could not find 'const Version = \"X.Y.Z\"' in $version_go" >&2
exit 1
fi
sed -E -i.bak "s/const Version = \"[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?\"/const Version = \"$version\"/" "$version_go"

cache: npm

- name: Install dependencies
run: npm ci

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Agentic Security Review
Severity: HIGH

This workflow runs npm ci after actions/checkout authenticated with a write-capable GitHub App token. Because checkout persists credentials by default, install-time lifecycle scripts from dependencies can read and exfiltrate that token.

Impact: a malicious dependency script can reuse the token to push unauthorized commits to main with the app's branch-protection bypass privileges.

Fix in Cursor Fix in Web

Reviewed by Cursor Security Reviewer for commit fb2e839. Configure here.

@jakubno jakubno marked this pull request as draft June 10, 2026 15:13
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2782 2 2780 5
View the top 1 failed test(s) by shortest run time
github.com/e2b-dev/infra/packages/api/internal/sandbox/storage/redis::TestSubscriptionManager_PubSubEndToEnd
Stack Traces | 13.7s run time
=== RUN   TestSubscriptionManager_PubSubEndToEnd
=== PAUSE TestSubscriptionManager_PubSubEndToEnd
=== CONT  TestSubscriptionManager_PubSubEndToEnd
    subscription_manager_test.go:245: 
        	Error Trace:	.../storage/redis/subscription_manager_test.go:245
        	Error:      	did not receive PubSub notification
        	Test:       	TestSubscriptionManager_PubSubEndToEnd
--- FAIL: TestSubscriptionManager_PubSubEndToEnd (13.66s)
View the full list of 2 ❄️ flaky test(s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity

Flake rate in main: 53.11% (Passed 989 times, Failed 1120 times)

Stack Traces | 62.2s run time
=== RUN   TestSandboxMemoryIntegrity
=== PAUSE TestSandboxMemoryIntegrity
=== CONT  TestSandboxMemoryIntegrity
    sandbox_memory_integrity_test.go:27: Build completed successfully
--- FAIL: TestSandboxMemoryIntegrity (62.23s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity/tmpfs_hash

Flake rate in main: 53.11% (Passed 979 times, Failed 1109 times)

Stack Traces | 189s run time
=== RUN   TestSandboxMemoryIntegrity/tmpfs_hash
=== PAUSE TestSandboxMemoryIntegrity/tmpfs_hash
=== CONT  TestSandboxMemoryIntegrity/tmpfs_hash
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{start:{pid:1258}}
Executing command bash in sandbox ioaqtlsdfluuw2uie0fri (user: root)
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Total memory: 985 MB\nUsed memory before tmpfs mount: 190 MB\nFree memory before tmpfs mount: 794 MB\nMemory to use in integrity test (60% of free, min 64MB): 476 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"476+0 records in\n476+0 records out\n499122176 bytes (499 MB, 476 MiB) copied, 2.16793 s, 230 MB/s\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\tCommand being timed: \"dd if=/dev/urandom of=/mnt/testfile bs=1M count=476\"\n\tUser time (seconds): 0.01\n\tSystem time (seconds): 2.16\n\tPercent of CPU this job got: 99%\n\tElapsed (wall clock) time (h:mm:ss or m:ss): 0:02.18\n\tAverage shared text size (kbytes): 0\n\tAverage unshared data size (kbytes): 0\n\tAverage stack size (kbytes): 0\n\tAverage total size (kbytes): 0\n\tMaximum resident set size (kbytes): 2628\n\tAverage resident set size (kbytes): 0\n\tMajor (requiring I/O) page faults: 2\n\tMinor (reclaiming a frame) page faults: 342\n\tVoluntary context switches: 3\n\tInvoluntary context switches: 26\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\tSwaps: 0\n\tFil"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"e sy"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"stem in"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"put"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"s: "}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"176\n\t"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"Fil"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"e sys"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"tem"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:" outputs: 0"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\n\tS"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"oc"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"ket m"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"ess"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"age"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"s s"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"ent"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:": 0\n\t"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"Soc"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"ke"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"t messages received: 0\n\tSignals delivered: 0\n\tPage size (bytes): 4096\n\tExit status: 0\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Used memory after tmpfs mount and file fill: 672 MB\n"}}
Executing command bash in sandbox ip902cn3hd4d48a0z4elb (user: root)
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    sandbox_memory_integrity_test.go:70: Command [bash] completed successfully in sandbox ie59e7fkybzlvvaka57kc
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{start:{pid:1274}}
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{data:{stdout:"0afc9994ff6626b965e32ec9203ca763f45d797450b03836eb46af83526f1fea\n"}}
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    sandbox_memory_integrity_test.go:80: Command [bash] completed successfully in sandbox ie59e7fkybzlvvaka57kc
Executing command bash in sandbox ip902cn3hd4d48a0z4elb (user: root)
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{start:{pid:1277}}
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
Executing command bash in sandbox ie59e7fkybzlvvaka57kc (user: root)
    sandbox_memory_integrity_test.go:110: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:81
        	            				.../hostedtoolcache/go/1.26.3.../src/runtime/asm_amd64.s:1771
        	Error:      	Received unexpected error:
        	            	failed to execute command bash in sandbox ie59e7fkybzlvvaka57kc: unavailable: HTTP status 502 Bad Gateway
    sandbox_memory_integrity_test.go:110: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:78
        	            				.../tests/orchestrator/sandbox_memory_integrity_test.go:110
        	Error:      	Condition never satisfied
        	Test:       	TestSandboxMemoryIntegrity/tmpfs_hash
--- FAIL: TestSandboxMemoryIntegrity/tmpfs_hash (189.05s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant