Skip to content

test(workbench): share setup for scan targets and ownership transfers - #1404

Merged
mldangelo-oai merged 1 commit into
mainfrom
mdangelo/codex/reuse-native-target-handoff-fixtures
Oct 7, 2026
Merged

mldangelo-oai merged 1 commit into
mainfrom
mdangelo/codex/reuse-native-target-handoff-fixtures

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Simplify tests for selecting a scan target, starting a saved scan, and transferring its ownership to a continuation thread. Reuse the shared workbench command helpers while keeping each scenario's identifiers, settings, operation order, and expected errors explicit.

Changes

  • Reuse workspace, scan, coverage, and completion helpers in the database, handoff, and setup tests.
  • Preserve environment overrides, literal target paths, expected failures, and the existing assertions at each call site.

Testing

Recorded validation on Python 3.12 exercises the same real workbench subprocesses and temporary SQLite databases through the shared helpers. Concurrent scan-start calls must return the same scan ID and leave exactly one running database row. Concurrent handoff-delivery calls must retain the same ownership token and initial progress state.

Target cases retain checks for literal Git paths, changed working-tree contents, dirty or mismatched submodules, and scopes that escape the selected repository. Ownership cases still reject access from another thread and preserve the rules for releasing and reclaiming a scan.

To repeat, run python -m pytest plugins/codex-security/tests/test_workbench_db.py plugins/codex-security/tests/test_workbench_handoff.py plugins/codex-security/tests/test_workbench_setup_and_migrations.py from the repository root with the Python test dependencies installed.

Risk and rollout

Depends on #1400, which supplies the shared workspace and scan-lifecycle fixtures. This is a test-only refactor. Production target selection, ownership rules, database behavior, and CLI syntax are unchanged; subprocess execution and existing assertions remain in place.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T05:24:44.601144Z c4e0cda New commits
🔒 Security Review ✅ Completed 2026-10-07T05:25:19.947377Z c4e0cda New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mldangelo-oai mldangelo-oai changed the title test(workbench): reuse target setup and handoff fixtures test(workbench): share setup for scan targets and ownership transfers Oct 7, 2026

@zcrab-oai zcrab-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the diff and relevant surrounding code at 67d8e99, with an independent second pass. No obvious correctness or regression issues found. Full local platform suites were not rerun. CI still has failed or unfinished checks; those results remain separate from this source-review approval.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/reuse-native-workspace-command-fixtures branch from a84c177 to a997fc1 Compare October 7, 2026 04:42
Base automatically changed from mdangelo/codex/reuse-native-workspace-command-fixtures to main October 7, 2026 04:57
@github-actions github-actions Bot added the skip-release-notes Omit internal changes from generated release notes label Oct 7, 2026
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/reuse-native-target-handoff-fixtures branch from 67d8e99 to 3c78102 Compare October 7, 2026 05:00
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/reuse-native-target-handoff-fixtures branch from 3c78102 to c4e0cda Compare October 7, 2026 05:21
@mldangelo-oai
mldangelo-oai merged commit 9911573 into main Oct 7, 2026
64 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/reuse-native-target-handoff-fixtures branch October 7, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-release-notes Omit internal changes from generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants