-
Notifications
You must be signed in to change notification settings - Fork 7.8k
tweak: DevEx to run changelog independently #5774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 changelog generation logic to enable it to run independently as a standalone script, while also fixing an issue where the opencode server process held scripts open after completion.
Key changes:
- Extracted changelog generation logic from
publish.tsinto a new reusablescript/changelog.tsmodule with a standalone CLI runner - Made
server.close()and TUIclose()methods return promises that properly await process termination - Updated documentation to reflect the new async
close()API
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
script/changelog.ts |
New module that extracts all changelog generation logic with a standalone runner that accepts previous/current git refs as CLI arguments |
script/publish.ts |
Simplified to delegate changelog generation to the new module, removing ~150 lines of inline logic |
packages/sdk/js/src/server.ts |
Changed close() methods to return promises that resolve when the process exits, fixing the hanging process issue |
packages/web/src/content/docs/sdk.mdx |
Updated documentation example to await the now-async close() method |
Comments suppressed due to low confidence (2)
packages/sdk/js/src/server.ts:92
- The close method could hang indefinitely if the process fails to exit after kill() is called. Consider adding a timeout to forcefully resolve the promise or use SIGKILL as a fallback after a grace period.
close() {
proc.kill("SIGKILL")
},
}
}
export function createOpencodeTui(options?: TuiOptions) {
const args = []
packages/sdk/js/src/server.ts:131
- The close method could hang indefinitely if the process fails to exit after kill() is called. Consider adding a timeout to forcefully resolve the promise or use SIGKILL as a fallback after a grace period.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const compare = | ||
| await $`gh api "/repos/sst/opencode/compare/${previous}...${current}" --jq '.commits[] | {sha: .sha, login: .author.login, message: .commit.message}'` | ||
| .text() | ||
| .catch(() => "") |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silently catching and ignoring GitHub API errors could lead to generating an incomplete changelog with missing author information. Consider logging the error or handling the failure more explicitly, especially since this affects the quality of the generated changelog.
| .catch(() => "") | |
| .catch((error) => { | |
| console.error( | |
| `Failed to fetch commit authors from GitHub API for changelog generation between ${previous} and ${current}:`, | |
| error, | |
| ) | |
| return "" | |
| }) |
This reverts commit 7f8e799.
This reverts commit 7f8e799.
I wasn't happy that we couldn't reuse the test script so I refactored a bit
the opencode server seemed to hold the process open and I had to ctrl+c to exit. the change fixes that too.