Skip to content

feat(advanced-retrigger-jobs): Convert bash to Python with typer - #756

Open
okurz wants to merge 1 commit into
os-autoinst:masterfrom
okurz:feature/openqa_advanced_retrigger_python_2026_version
Open

okurz wants to merge 1 commit into
os-autoinst:masterfrom
okurz:feature/openqa_advanced_retrigger_python_2026_version

Conversation

@okurz

@okurz okurz commented Oct 9, 2026

Copy link
Copy Markdown
Member

Motivation:
The bash script built SQL and ssh command lines by string
interpolation, which is hard to test and easy to break.

Design Choices:
Options keep the old environment variable names via typer envvar
so existing cron invocations keep working. Job IDs are sent with
openqa_client instead of shelling out to openqa-cli, reusing the
shared client config and retries.

Benefits:
Importable module with 100% statement and branch coverage, ruff
and ty clean without broad file level exclusions, and faster
startup than the previous shell implementation.

Motivation:
The bash script built SQL and ssh command lines by string
interpolation, which is hard to test and easy to break.

Design Choices:
Options keep the old environment variable names via typer envvar
so existing cron invocations keep working.  Job IDs are sent with
openqa_client instead of shelling out to openqa-cli, reusing the
shared client config and retries.

Benefits:
Importable module with 100% statement and branch coverage, ruff
and ty clean without broad file level exclusions, and faster
startup than the previous shell implementation.

@plusky plusky 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.

dry_run=1 used to echo the command, but the note is now log.info, invisible at default WARNING: without -v nothing prints, contradicting "Only print what would be done". Log at warning level or document -v.

Also, ssh/psql stderr is now swallowed: capture_output=True keeps it in err.stderr, but the handler only logs the exception, so auth/SQL errors vanish where bash printed them. Log err.stderr before exiting.

Parity otherwise verified: identical SQL, batching, JOB_IDS parsing, scheme default, 24 tests pass, ruff clean.

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