Skip to content

Prevent push from hanging on public datasets - #259

Merged
neuromechanist merged 4 commits into
devfrom
fix/issue-257-push-error-clarity
Mar 8, 2026
Merged

neuromechanist merged 4 commits into
devfrom
fix/issue-257-push-error-clarity

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

  • Add GIT_TERMINAL_PROMPT=0 to runCommand() to prevent git from blocking on credential prompts (root cause of Modified a dataset #257 hang)
  • Add optional timeout parameter to runCommand() as safety net
  • Add proactive visibility check in push command: detect public datasets and block direct push to main with actionable guidance
  • Detect branch protection errors (GH006) in push failure path and show clear suggestions (update or push --pr)
  • Add checkPrerequisitesForCommand("push") to push command
  • Replace inline git/gh checks in update and release commands with centralized checkPrerequisitesForCommand() calls
  • Add "update" and "release" to NemarCommand type

Closes #257

Test plan

  • bun run build compiles successfully
  • bun run typecheck passes
  • Manual: nemar dataset push in a public dataset clone shows error immediately with suggestions
  • Manual: nemar dataset push in a private dataset works as before
  • Manual: nemar dataset push --pr on a feature branch of a public dataset works

Adopt Bun-style colors, fix SSH->HTTPS help text
- Add GIT_TERMINAL_PROMPT=0 to runCommand() to prevent git from
  blocking on credential prompts (root cause of #257 hang)
- Add optional timeout parameter to runCommand() as safety net
- Add proactive visibility check in push command: detect public
  datasets and block direct push to main with actionable guidance
- Detect branch protection errors (GH006) in push failure path
  and show clear suggestions (use update or push --pr)
- Add checkPrerequisitesForCommand("push") to push command
- Replace inline git/gh checks in update and release commands
  with centralized checkPrerequisitesForCommand() calls
- Add "update" and "release" to NemarCommand type

Closes #257
@github-actions

github-actions Bot commented Mar 7, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR259

Version: 0.7.13-PR259.d598975
Commit: d598975


🤖 Updated on each push.

- Don't treat null branch name as "on main" (could block
  legitimate pushes from feature branches)
- Extract printBranchProtectionSuggestions() to deduplicate
  suggestion text between proactive check and fallback handler
- Improve catch comment accuracy
@neuromechanist

Copy link
Copy Markdown
Contributor Author

PR Review Summary

Ran 4 review agents in parallel: code-reviewer, silent-failure-hunter, code-simplifier, comment-analyzer.

Critical Issues (1 found, fixed)

  • silent-failure-hunter: null branch name was treated as "on main" (dataset.ts:3437), which could block legitimate pushes from feature branches with a misleading error. Fixed in 227c67f by only matching explicit "main" or "master".

Important Issues (1 found, fixed)

  • code-simplifier: Duplicated suggestion text between the proactive check and fallback error handler. Fixed in 227c67f by extracting printBranchProtectionSuggestions() helper.

Suggestions (3 found, 2 addressed)

  • comment-analyzer: Catch comment "API unreachable or not authorized" was imprecise. Reworded to "API call failed (network, 404, etc.)". Fixed in 227c67f.
  • comment-analyzer: JSDoc for runCommand() should mention timeout return-value behavior. Fixed in follow-up commit.
  • silent-failure-hunter: Detect "terminal prompts disabled" in push error handler (since we added GIT_TERMINAL_PROMPT=0). Fixed in follow-up commit.

Not Addressed

  • silent-failure-hunter: Consider SIGKILL instead of SIGTERM for timeout kill. Skipped because the timeout feature has no callers yet; can revisit when it's used.

Strengths Noted

  • Root cause fix (GIT_TERMINAL_PROMPT=0) directly addresses the hang
  • Defense in depth: proactive visibility check + fallback error detection
  • Clean prerequisite centralization removes code duplication
  • Timeout implementation has proper cleanup

- Document timeout return-value behavior in runCommand() JSDoc
- Detect "terminal prompts disabled" in push error handler and
  point users to 'nemar auth setup-ssh'
@neuromechanist
neuromechanist merged commit fb37f2e into dev Mar 8, 2026
8 checks passed
This was referenced Mar 8, 2026
@neuromechanist
neuromechanist deleted the fix/issue-257-push-error-clarity branch March 10, 2026 01:52

This branch was previously deployed

1 inactive deployment
npm — d5989759 Deployed Mar 8, 2026 by neuromechanist via publish #432
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.

1 participant