Skip to content

PYTHON-6071 Fix ML-KEM OCSP tests and run min-deps OCSP task on PRs - #3037

Merged
blink1073 merged 2 commits into
mongodb:mainfrom
blink1073:claude/evergreen-build-failure-338b08
Sep 4, 2026
Merged

PYTHON-6071 Fix ML-KEM OCSP tests and run min-deps OCSP task on PRs#3037
blink1073 merged 2 commits into
mongodb:mainfrom
blink1073:claude/evergreen-build-failure-338b08

Conversation

@blink1073

@blink1073 blink1073 commented Sep 3, 2026

Copy link
Copy Markdown
Member

PYTHON-6071

Changes in this PR

  • Replaced real ML-KEM key generation in two OCSP tests with MagicMock(spec=...), so they no longer depend on cryptography's backend supporting ML-KEM.
  • Added a min-deps stapled OCSP task to the PR-triggered Evergreen variant, alongside the existing latest-CPython one.
  • Scoped both PR-gated OCSP tasks to one algorithm (ecdsa) to keep PR CI at two tasks instead of four.

Test Plan

  • pytest test/test_ocsp_support.py::TestVerifySignature -m ocsp: 9 passed, including under a min-deps (cryptography==47.0.0) environment where they previously failed with UnsupportedAlgorithm.
  • just lint and just typing: clean.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)? Not needed (test/CI-only fix).
  • Is there test coverage? Yes, and it now runs on every PR.
  • Is any followup work tracked in a JIRA ticket? If so, add link(s). None; PYTHON-6071 is caused-by PYTHON-6032.

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

@blink1073
blink1073 force-pushed the claude/evergreen-build-failure-338b08 branch from 6466dd8 to 136cc31 Compare September 3, 2026 11:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are narrowly scoped to tests and CI configuration, and the updated mocking approach and task tagging align with the intended OCSP behavior without introducing functional driver risk.

Pull request overview

This PR fixes OCSP signature-verification tests that were failing under the min-deps CI environment due to cryptography’s OpenSSL build lacking ML-KEM support, and updates Evergreen config generation so PR CI runs a minimal, targeted set of stapled-OCSP tasks (including min-deps) to catch backend regressions before merge.

Changes:

  • Updated ML-KEM “fails closed” OCSP unit tests to use MagicMock(spec=MLKEM*PublicKey) instead of generating real ML-KEM keys.
  • Added a PR-only Evergreen build variant that runs stapled OCSP tasks selected by the .pr tag.
  • Adjusted OCSP task tagging so PR CI runs exactly two stapled OCSP tasks (ECDSA only): one min-deps (4.4) and one latest-CPython (latest, with coverage).
File summaries
File Description
test/test_ocsp_support.py Reworks ML-KEM OCSP signature tests to avoid relying on runtime ML-KEM support in the local cryptography/OpenSSL build.
.evergreen/scripts/generate_config.py Generates a PR-only “OCSP Staples” variant and tags only the intended ECDSA stapled OCSP tasks for PR execution (min-deps + latest).
.evergreen/generated_configs/variants.yml Adds the generated PR build variant for stapled OCSP tasks on the default host.
.evergreen/generated_configs/tasks.yml Reflects the new PR tagging behavior (adds PR tag for the selected ECDSA tasks; removes PR tagging/coverage from RSA stapled task).
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are consistent with the PR description, appear internally coherent (tests + config generation + generated outputs), and reduce CI fragility without altering runtime driver behavior.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@blink1073
blink1073 marked this pull request as ready for review September 3, 2026 11:36
@blink1073
blink1073 requested a review from a team as a code owner September 3, 2026 11:36
@blink1073
blink1073 requested a review from NoahStapp September 3, 2026 11:36
@codeowners-service-app

Copy link
Copy Markdown

Assigned caseyclements for team dbx-python because NoahStapp is out of office.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@caseyclements caseyclements left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@blink1073
blink1073 merged commit 0f6da1c into mongodb:main Sep 4, 2026
88 of 91 checks passed
@blink1073
blink1073 deleted the claude/evergreen-build-failure-338b08 branch September 4, 2026 15:42
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