fix(cli): disable ora spinner in non-interactive environments#5376
Merged
agusayerza merged 1 commit intomasterfrom Feb 4, 2026
Merged
Conversation
bd32214 to
4dbd9b3
Compare
TBonnin
approved these changes
Feb 4, 2026
packages/cli/lib/zeroYaml/compile.ts
Outdated
| } | ||
| return this; | ||
| } | ||
| } as Ora; |
Collaborator
There was a problem hiding this comment.
isn't Ora supporting more methods? Would it makes sense to wrap it into a Proxy to catch any undefined methods and avoid runtime crash?
Contributor
Author
There was a problem hiding this comment.
Yes, that is what I'm actually doing locally, as well as replacing other ora usages on other CLI commands
Collaborator
There was a problem hiding this comment.
I see you went into supported all known methods. I would have done something simpler just to avoid crash without supporting everything we don't use (yet). ex:
const safeSpinner = new Proxy(new Spinner(), {
get(target, prop) {
if (typeof target[prop] === 'function') return target[prop].bind(target);
if (prop in target) return target[prop];
return (...args) => {
console.warn(`Method "${prop}" not found, called with:`, args);
return undefined;
};
}
});
4dbd9b3 to
f37ccdc
Compare
f37ccdc to
bf7ecd8
Compare
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.
Issue
nango compilehangs indefinitely when run via pre-commit hooks due to an upstream bug in ora'sstdin-discarderdependency (#5207). This is blocking a customer's CI/CD workflow.Root cause
The bug was fixed in
stdin-discarder@0.3.1, butora@9.1.0(latest) still depends onstdin-discarder@^0.2.2and hasn't released a patched version yet.Fix
Added a
createSpinner()wrapper that returns a no-op spinner when running in non-interactive environments (CI, pre-commit hooks, piped output, or when--no-interactiveflag is passed). The real ora spinner is only used when bothinteractive=trueANDprocess.stdout.isTTYis true.This workaround should be removed once
orareleases a patched versionI have opened a PR to actually bump the
stdin-discarderversion on theorarepo (sindresorhus/ora#251)Closes #5207
Add resilient spinner wrapper and propagate non-interactive handling across CLI
Introduces a centralized
Spinnerutility that wrapsora, falls back to text-based logging when either stdin/stdout is non-TTY, and is wired through compile, dev, deploy, migrations, init, clone, and test generation flows. Global CLI options now auto-disable interactivity in CI environments (isCIor--no-interactive), ensuring commands invoked from hooks or piped executions no longer hang, while also updatingorato9.2.0and related dependencies (e.g.,stdin-discarder@0.3.1).Key Changes
• Created
packages/cli/lib/utils/spinner.tsimplementing a Proxy-basedSpinnerclass that mirrors theOrainterface and prints textual status whenprocess.stdinorstdoutis non-TTY.• Replaced direct
orausage across CLI commands (compile,dev,deploy, zero-yaml migrations, init, clone, tests, etc.) with the newSpinner, addinginteractiveparameters where needed.• Updated
packages/cli/lib/index.tsglobal option handling to default to interactive mode, automatically disable it under CI, and pass the flag through to all commands.• Bumped
orato9.2.0inpackages/cli/package.jsonand lockfile, pulling in the fixedstdin-discarder@0.3.1plus new transitive dependencies.Affected Areas
• packages/cli/lib/utils/spinner.ts
• packages/cli/lib/zeroYaml/* (compile, dev, deploy, migrations, init, check)
• packages/cli/lib/services/{clone,test}.service.ts
• packages/cli/lib/index.ts
• packages/cli/package.json & package-lock.json
This summary was automatically generated by @propel-code-bot