Skip to content

Build without the Onde credentials, and say so in the features that need them - #56

Merged
setoelkahfi merged 2 commits into
developmentfrom
feature/optional-credentials
Nov 18, 2026
Merged

setoelkahfi merged 2 commits into
developmentfrom
feature/optional-credentials

Conversation

@setoelkahfi

Copy link
Copy Markdown
Collaborator

build.rs stopped the build when ONDE_APP_ID, ONDE_APP_SECRET, GRESIQ_API_KEY or GRESIQ_API_SECRET was missing. So nobody without Onde's secrets could build the repo. It also means cargo install onde-cli, which the README advertises, cannot have worked: that command compiles build.rs on the user's own machine. I read the published 0.6.1 build.rs to 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

  • A missing credential now builds with an empty value and a cargo warning.
  • Official builds must still carry the credentials. All seven release workflows that build with them set 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, not an empty secret sent to the server: TUI sign-in and sign-up (and 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.
  • docs/install.md has a "Build from source" section, the README says a cargo install build has cloud sign-in off, and the agent notes no longer say the variables are required.

Testing

  • fmt, clippy with -D warnings, cargo test --locked and cargo check --no-default-features --lib pass, 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, since development does not compile without them.
  • Build with no .env: succeeds with the warning. With ONDE_REQUIRE_CREDENTIALS=1 and 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.
  • actionlint passes on the workflows.
  • Not tested: clicking through the guards at runtime in the TUI and the desktop app, and the release workflows themselves. The flag only takes effect on the next real release, so check that run.

Not changed

CI already falls back to ci-placeholder for each credential, so fork CI was never blocked. The problem was local and cargo install builds.

Official binaries still contain the credentials in plaintext, and this does not change that. They need to be rotated or scoped separately.

@setoelkahfi setoelkahfi self-assigned this Nov 18, 2026
@setoelkahfi
setoelkahfi requested a review from paydii November 18, 2026 07:33

@sigit-code-review sigit-code-review Bot 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.

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

Comment thread build.rs Resolved
Comment thread src/config.rs Resolved

@sigit-code-review sigit-code-review Bot 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.

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

setoelkahfi and others added 2 commits November 18, 2026 20:38
…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>
@setoelkahfi
setoelkahfi force-pushed the feature/optional-credentials branch from eef042b to 7bd08fd Compare November 18, 2026 19:39

@sigit-code-review sigit-code-review Bot 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.

Looks good to me.

@setoelkahfi
setoelkahfi merged commit 53c1709 into development Nov 18, 2026
7 checks passed
@setoelkahfi
setoelkahfi deleted the feature/optional-credentials branch November 18, 2026 21:07
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.

3 participants