feat: fail clearly instead of prompting in non-interactive/CI environ… - #829
Open
Awosdot wants to merge 4 commits into
Open
feat: fail clearly instead of prompting in non-interactive/CI environ…#829Awosdot wants to merge 4 commits into
Awosdot wants to merge 4 commits into
Conversation
…ments Prompting helpers (wallet/backup password & passphrase entry, confirmation prompts, registry login/signup) used to block forever when run in CI or any other non-interactive context. They now detect that up front and fail fast with a clear error, pointing at a secure headless alternative: - New utils::interactive module: detects `--non-interactive`, `$CI`, `$STARFORGE_NON_INTERACTIVE`, or non-tty stdin, and centralizes the fail-fast error via ensure_interactive(). - Global `--non-interactive` CLI flag wired in main(). - crypto::prompt_password / prompt_passphrase fall back to $STARFORGE_PASSWORD / $STARFORGE_PASSPHRASE (new passphrases still get validated against length/strength rules without the interactive retry loop). - confirmation::confirm_operation now requires --yes in non-interactive mode instead of blocking on stdin. - registry login/signup accept --email/--username plus $STARFORGE_REGISTRY_EMAIL/_USERNAME/_PASSWORD. Also fixes small pre-existing build breaks that blocked verification (missing thiserror dependency, a rusqlite::Transaction mutability mismatch in database.rs, and two ai_doc_qa modules present on disk but never declared in mod.rs). Adds 20 unit tests covering the CI failure case and the fallback success case for each guarded prompt, plus boundary cases (empty env value, strict-mode validation on a fallback passphrase, --yes/dry-run bypassing the check). Documents the new behavior, detection rules, and migration notes in CI_CD_DEPLOYMENT.md. Closes Nanle-code#673
|
@Awosdot Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Collaborator
|
@Awosdot Please fix all CI issues |
added 2 commits
August 26, 2026 19:56
…ests cargo test compiles the whole crate's #[cfg(test)] code as one lib test binary, so ~22 pre-existing, unrelated compile errors (stale struct literals missing newly-added TemplateEntry/PluginManifest fields, a duplicate read_spec_entries/ci_passed definition, a missing PartialEq derive on ComplianceSeverity, an immutable CircuitBreaker borrow, and tests exercising an already-removed InstalledPlugin::description API) were preventing the lib test binary from building at all, blocking CI from ever reaching the non-interactive/CI prompt-handling tests added for Nanle-code#673. Fixes are mechanical: added missing fields/derives, fixed mismatched types, removed duplicate definitions, and dropped 3 tests for the removed plugin description API. No behavioral changes to the Nanle-code#673 feature itself (utils::interactive, utils::confirmation, utils::crypto, commands::registry) — its 33 tests pass individually and in the full suite, both with default parallelism and with --test-threads=1 (as ci.yml runs). A separate set of ~65 unrelated test failures (database migrations, feature_flags, ai_* modules, compliance risk scoring, etc.) remain and are pre-existing logic bugs outside this issue's scope. closes Nanle-code#673
Author
Summary of ChangesImplements robust, CI-safe prompt handling to resolve issue #673. Prevents interactive prompts from hanging in headless CI pipelines and provides secure input alternatives. Key Details:
Closes #673 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Implements robust, CI-safe prompt handling to resolve issue #673. Prevents interactive prompts from hanging in headless CI pipelines and provides secure input alternatives.
Key Details:
CIenvironment variable and non-TTY stream validation) to reliably detect non-interactive execution contexts.Closes #673