Skip to content

Enable installing bd canary - #11

Merged
zerebos merged 5 commits into
app-asar-injectionfrom
feat/bd-canary
Aug 4, 2026
Merged

Enable installing bd canary#11
zerebos merged 5 commits into
app-asar-injectionfrom
feat/bd-canary

Conversation

@zerebos

@zerebos zerebos commented Aug 3, 2026

Copy link
Copy Markdown
Member

This pull request introduces support for installing and updating the development (canary) build of BetterDiscord via a new --dev CLI flag or the BDCLI_DEV_BUILD environment 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:

  • Added a --dev flag and BDCLI_DEV_BUILD environment 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]
  • Updated the install and update commands to pass the useDevBuild option, ensuring the correct build is downloaded and installed. (cmd/install.go [1] cmd/update.go [2] internal/discord/install.go [3]
  • The download logic now fetches the canary release from GitHub when requested, never falling back to stable if the dev build fails, and provides improved logging. (internal/betterdiscord/download.go [1] [2] [3] [4] internal/betterdiscord/install.go [5]

Testing improvements:

  • Added comprehensive tests to verify that the dev build path fetches only from the canary endpoint, does not fall back to stable, and handles errors correctly. Also added helpers for overriding URLs in tests. (internal/betterdiscord/download_test.go [1] [2] [3] [4] [5]

Test clarity and minor fixes:

  • Improved test case descriptions and error messages for Discord channel path detection to clarify expected behavior. (internal/discord/paths_test.go [1] [2]

@zerebos
zerebos requested a review from Copilot August 3, 2026 07:08
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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.

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 --dev flag and BDCLI_DEV_BUILD env var to select the development build.
  • Updates install/update code paths to pass a UseDevBuild option 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.

Comment thread internal/betterdiscord/download.go Outdated
Comment thread cmd/update.go

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.

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, but update is explicitly stable-only here and later hardcodes bdinstall.Download(false). Either adjust the PR description/scope, or add a --dev (and env var) path for update (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))

Comment thread internal/discord/process.go
@zerebos
zerebos merged commit 62d94c5 into app-asar-injection Aug 4, 2026
@zerebos
zerebos deleted the feat/bd-canary branch August 4, 2026 05:24
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.

2 participants