Skip to content

feat: rename pathoscope_bowtie to pathoscope everywhere#3422

Merged
igboyes merged 2 commits intomainfrom
igboyes/vir-2310-rename-pathoscope_bowtie-to-pathoscope-everywhere
Apr 29, 2026
Merged

feat: rename pathoscope_bowtie to pathoscope everywhere#3422
igboyes merged 2 commits intomainfrom
igboyes/vir-2310-rename-pathoscope_bowtie-to-pathoscope-everywhere

Conversation

@igboyes
Copy link
Copy Markdown
Member

@igboyes igboyes commented Apr 29, 2026

Summary

  • Removes all pathoscope_bowtie shims and aliases now that the backfill migration has been written, leaving pathoscope as the single canonical workflow name across PostgreSQL jobs, user settings (JSONB), MongoDB analyses, enums, and API models
  • Adds an idempotent Virtool migration (rev_3g8rzbqj6k69) that renames any remaining pathoscope_bowtie values in the three data stores so the shims can be safely dropped
  • Cleans up the Workflow._missing_ compatibility hook, the PATHOSCOPE_TASK_NAMES list, the get_workflow_name helper, the job-claim alias query, and the corresponding test coverage for those shims

Backfill jobs.workflow, users.settings.quick_analyze_workflow, and
mongo analyses.workflow, then remove the Workflow._missing_ alias,
the claim-time pathoscope_bowtie fallback, and PATHOSCOPE_TASK_NAMES
shims.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 29, 2026

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request renames the legacy pathoscope_bowtie workflow to pathoscope across the codebase. It includes a migration script to update existing records in PostgreSQL and MongoDB, alongside updates to models, utilities, and test snapshots. Feedback was provided regarding the migration tests, specifically recommending the use of bind parameters instead of f-string interpolation for SQL queries to improve security and robustness.

Comment on lines +27 to +47
settings = (
'{"quick_analyze_workflow": "' + quick_analyze_workflow + '"}'
if quick_analyze_workflow is not None
else "{}"
)
async with AsyncSession(ctx.pg) as session:
result = await session.execute(
text(
f"""
INSERT INTO users (
handle, active, email, force_reset,
invalidate_sessions, last_password_change, password, settings
)
VALUES (
:handle, true, '', false, false, :now, :pw, '{settings}'::jsonb
)
RETURNING id
""",
),
{"handle": handle, "now": arrow.utcnow().naive, "pw": b"hashed"},
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The manual construction of the JSON string and its interpolation into the SQL query using an f-string is fragile and prone to errors (e.g., if the workflow name contains quotes). It is better to use bind parameters for the settings field and let the database driver handle the serialization. This also avoids potential SQL injection issues, even if this is only a test file.

Replace the f-string-interpolated JSON with a CAST(:settings AS jsonb)
bind so the helper handles arbitrary workflow names without quoting
hazards.
@igboyes igboyes merged commit 918c40c into main Apr 29, 2026
8 checks passed
@igboyes igboyes deleted the igboyes/vir-2310-rename-pathoscope_bowtie-to-pathoscope-everywhere branch April 29, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant