Enable installing bd canary - #11
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
Pull request overview
Adds support for installing and updating the BetterDiscord development (“canary”) build via a new --dev flag and BDCLI_DEV_BUILD environment variable, wiring that choice through the install/update flows and updating tests to validate the canary-only download behavior.
Changes:
- Introduces a global
--devflag andBDCLI_DEV_BUILDenv var to select the development build. - Updates install/update code paths to pass a
UseDevBuildoption through to BetterDiscord download logic. - Refactors BetterDiscord download logic to support a dedicated canary GitHub release endpoint and adds tests ensuring no stable fallback occurs for dev builds.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
cmd/root.go |
Adds --dev flag + BDCLI_DEV_BUILD env handling and user-facing notice. |
cmd/install.go |
Passes UseDevBuild into install options. |
cmd/update.go |
Passes dev-build selection into the download step. |
internal/discord/install.go |
Forwards UseDevBuild into BetterDiscord download. |
internal/models/options.go |
Contains UseDevBuild in InstallOptions. |
internal/betterdiscord/install.go |
Changes Download() signature to accept dev-build selection. |
internal/betterdiscord/download.go |
Adds canary endpoint + refactors GitHub download logic into a helper. |
internal/betterdiscord/download_test.go |
Adds/updates tests for canary-only behavior and error handling. |
internal/discord/paths_test.go |
Improves test expectations/message clarity for channel detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 17 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
cmd/update.go:23
- The PR description says the dev (canary) build can be installed and updated via
--dev/BDCLI_DEV_BUILD, butupdateis explicitly stable-only here and later hardcodesbdinstall.Download(false). Either adjust the PR description/scope, or add a--dev(and env var) path forupdate(even if it just re-downloads canary without version comparison).
// This currently only checks for updates to the BetterDiscord loader (betterdiscord.asar).
// In the future, we may also want to check for updates to the CLI itself.
// This also only checks for updates to the stable release as the check is cheap (tag name)
// the canary version is a rolling release and is not versioned, so it is not as easily
// possible to check for updates to it.
cmd/update.go:74
- The update command reports success using the GitHub
latestVersion, but the downloaded asar may come from the website (or otherwise differ), so the message can be incorrect. Re-read build info after download and print the actual installed version.
if err := bdinstall.Download(false); err != nil {
return fmt.Errorf("failed to download update: %w", err)
}
output.Printf("✅ Successfully updated to %s\n\n", output.FormatVersion(latestVersion))
This pull request introduces support for installing and updating the development (canary) build of BetterDiscord via a new
--devCLI flag or theBDCLI_DEV_BUILDenvironment variable. It ensures that when the dev build is requested, only the canary release is fetched (never falling back to stable), and adds robust tests for this behavior. Additionally, it improves test coverage and clarity for download and path handling logic.Development build selection and download:
--devflag andBDCLI_DEV_BUILDenvironment variable to select the development (canary) build of BetterDiscord. The CLI now clearly indicates when the dev build is being used. (cmd/root.go[1] [2] [3]useDevBuildoption, ensuring the correct build is downloaded and installed. (cmd/install.go[1]cmd/update.go[2]internal/discord/install.go[3]internal/betterdiscord/download.go[1] [2] [3] [4]internal/betterdiscord/install.go[5]Testing improvements:
internal/betterdiscord/download_test.go[1] [2] [3] [4] [5]Test clarity and minor fixes:
internal/discord/paths_test.go[1] [2]