Repository navigation
Build without the Onde credentials, and say so in the features that need them - #56
Conversation
There was a problem hiding this comment.
Third of the open-source readiness changes: build.rs no longer hard-fails on a missing ONDE_APP_ID/ONDE_APP_SECRET/GRESIQ_API_KEY/GRESIQ_API_SECRET, baking in an empty value with a cargo:warning instead, while a new ONDE_REQUIRE_CREDENTIALS flag (set in all seven release workflows) restores the hard failure for official builds. Runtime guards back this up: config::is_connected()/gresiq_connected() detect the empty bake-in, and every cloud entry point now short-circuits with config::NOT_CONNECTED — TUI sign-in/submit and session restore, MCP login/me, all GresIQ calls via the new keys() helper, and the desktop app's sign-in/sign-up/OAuth/restore via ensure_connected(). Docs and agent notes are updated to say the variables are optional and what a credential-free build can do. The approach is sound; two edge cases below are worth a look, otherwise this looks ready.
Automated review by siGit Code Review · commit 7426452 · see the review dashboard
There was a problem hiding this comment.
Re-review of the follow-up commit. Both earlier threads are addressed: build.rs now treats an empty credential value as missing (so ONDE_REQUIRE_CREDENTIALS=1 rejects ONDE_APP_ID= and empty CI secrets), and the messaging is split — NOT_CONNECTED_GRESIQ is a new constant used by gresiq::keys() that only claims publishing and app assignment are off, while the build warning names the features the missing group actually gates (the any(starts_with("ONDE_")) branch correctly covers the both-groups-missing case, since publishing sits behind sign-in). The unwrap_or_default refactor is behavior-preserving for the non-empty path and keeps invalid-UTF-8 values in the missing bucket as before. No new issues found.
Automated review by siGit Code Review · commit eef042b · changes since 7426452 · see the review dashboard
…eed them build.rs stopped the build when ONDE_APP_ID, ONDE_APP_SECRET, GRESIQ_API_KEY or GRESIQ_API_SECRET was missing. That meant nobody without Onde's secrets could build the repo, and `cargo install onde-cli`, which the README advertises, compiles build.rs on the user's own machine, so it could not have worked for anyone. A missing value now builds with an empty one and a cargo warning. Official builds must not ship without the credentials, so every release workflow sets ONDE_REQUIRE_CREDENTIALS=1, which turns a missing value back into an error. The local release scripts already refuse to build without them. A build with no credentials still fine-tunes, merges, exports and evaluates. The places that talk to Onde check config::is_connected() first and answer with config::NOT_CONNECTED instead of sending an empty secret to the server: TUI sign-in and sign-up (and not restoring a saved session), the MCP login and me tools, every GresIQ call, and the desktop app's password, sign-up and browser sign-in and session restore. Checked by building with no .env: it builds with the warning. With the flag set and nothing else it fails and names the missing variables. With the flag and all four set it builds without a warning. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
An env var set to an empty string (ONDE_APP_ID= in .env, or an empty CI secret) used to take the Ok arm in build.rs and bake in an empty value without being counted as missing, so ONDE_REQUIRE_CREDENTIALS let the build through and could ship a release that cannot reach the backend. An empty value now counts the same as an absent one. The not-connected message said sign-in, publishing and app assignment were all off whenever any variable was missing. The Onde auth keys gate sign-in; the GresIQ keys gate publishing and app assignment on their own. The build warning now names only the features the missing group affects, and GresIQ failures use their own message that does not claim sign-in is off, since reaching that code means the user already signed in. cargo fmt, clippy and test pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
eef042b to
7bd08fd
Compare
build.rsstopped the build whenONDE_APP_ID,ONDE_APP_SECRET,GRESIQ_API_KEYorGRESIQ_API_SECRETwas missing. So nobody without Onde's secrets could build the repo. It also meanscargo install onde-cli, which the README advertises, cannot have worked: that command compilesbuild.rson the user's own machine. I read the published 0.6.1build.rsto confirm this and did not run the install.Third of the open-source readiness changes, after #54 and #55. It is independent of them.
What changed
ONDE_REQUIRE_CREDENTIALS=1, which turns a missing value back into an error. The local release scripts already refuse to build without them.config::is_connected()first and answer withconfig::NOT_CONNECTED, not an empty secret sent to the server: TUI sign-in and sign-up (and restoring a saved session), the MCPloginandmetools, every GresIQ call, and the desktop app's password, sign-up and browser sign-in and session restore.docs/install.mdhas a "Build from source" section, the README says acargo installbuild has cloud sign-in off, and the agent notes no longer say the variables are required.Testing
-D warnings,cargo test --lockedandcargo check --no-default-features --libpass, from a worktree with no.env. The desktop crate's clippy and tests pass too, with app: save the PNG icons with an alpha channel #49's icons applied locally, sincedevelopmentdoes not compile without them..env: succeeds with the warning. WithONDE_REQUIRE_CREDENTIALS=1and no credentials: fails and names the four variables. With the flag and all four set: succeeds with no warning. An empty flag counts as unset.actionlintpasses on the workflows.Not changed
CI already falls back to
ci-placeholderfor each credential, so fork CI was never blocked. The problem was local andcargo installbuilds.Official binaries still contain the credentials in plaintext, and this does not change that. They need to be rotated or scoped separately.