Skip to content

feat(config): add --intent-rollback flag for intentional rollback via config bounce#82

Merged
shigechika merged 3 commits into
mainfrom
feat/no-commit-option
May 8, 2026
Merged

feat(config): add --intent-rollback flag for intentional rollback via config bounce#82
shigechika merged 3 commits into
mainfrom
feat/no-commit-option

Conversation

@shigechika
Copy link
Copy Markdown
Owner

@shigechika shigechika commented May 8, 2026

Summary

  • Add --intent-rollback option to the config subcommand
  • Applies set commands with commit confirmed N but intentionally skips the final commit — JUNOS auto-rolls back after N minutes (default: 1)
  • Useful for restarting services that lack a request ... restart command (e.g. syslog on EX3400 after firmware upgrade: deactivate system syslog; commit confirmed 1 bounces the process)
  • --intent-rollback and --no-confirm are mutually exclusive (returns exit code 1 with error message)
  • Fix rpm.yml: gh release create fallback passes --repo to avoid git discovery failure in rockylinux:9 container

Files changed

File Change
junos_ops/cli.py Add --intent-rollback argument, mutual exclusion check, default value
junos_ops/upgrade.py Add elif intent_rollback: branch in load_config() — sends commit confirmed N, skips health check and final commit
tests/test_config_push.py Add TestIntentRollback class (4 tests including mutual exclusion)
docs/config.md / docs/config.ja.md Add --intent-rollback to options table and new "Intentional Rollback" section
README.md / README.ja.md Mention --intent-rollback in config subcommand description
.github/workflows/rpm.yml Pass --repo to gh release create fallback

Test plan

  • pytest tests/ -v --tb=short — 293 tests pass
  • --intent-rollback skips final commit (only commit(confirm=N) is called)
  • --intent-rollback --no-confirm is rejected with exit code 1
  • confirm_timeout is passed through to commit(confirm=N)

🤖 Generated with Claude Code

shigechika and others added 2 commits May 8, 2026 16:18
…g bounce

Add --no-commit option to the config subcommand. When specified, applies the
set commands with commit confirmed but intentionally skips the final commit,
allowing JUNOS to auto-rollback after --confirm minutes. Useful for restarting
services (e.g. syslog on EX3400 post-upgrade) that lack a request...restart
command.

--no-commit and --no-confirm are mutually exclusive. Tests and docs updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…st, fix rpm.yml release create

- Rename --no-commit / no_commit -> --intent-rollback / intent_rollback
  throughout (cli.py, upgrade.py, tests, docs en/ja, README en/ja)
- Add test for --intent-rollback + --no-confirm mutual exclusion (exit 1)
- Fix confirm_timeout docstring: applies to "confirmed" and "intent_rollback"
- rpm.yml: pass --repo to gh release create fallback to fix git discovery
  failure inside rockylinux:9 container

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shigechika shigechika changed the title feat(config): add --no-commit flag for intentional rollback via config bounce feat(config): add --intent-rollback flag for intentional rollback via config bounce May 8, 2026
@shigechika shigechika merged commit 794ac54 into main May 8, 2026
2 checks passed
@shigechika shigechika deleted the feat/no-commit-option branch May 8, 2026 07:27
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