Skip to content

PYTHON-6114 Run the mod_wsgi tests on GitHub Actions - #3069

Merged
blink1073 merged 6 commits into
mongodb:mainfrom
blink1073:PYTHON-6114
Sep 28, 2026
Merged

blink1073 merged 6 commits into
mongodb:mainfrom
blink1073:PYTHON-6114

Conversation

@blink1073

@blink1073 blink1073 commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

PYTHON-6114

Replaces #3059, rebased on main including the merged subinterpreter support (#3061).

Changes in this PR

  • Reinstate the mod_wsgi infrastructure that was removed in PYTHON-6104 - remove mod wsgi from evergreen #3060.
  • Add the ability to run mod_wsgi locally on Linux and in a container otherwise.
  • Add GitHub Actions tests covering apache and httpd, min and max cpython, min and max server (6.0 is the lowest supported on the runner), and embedded and standalone modes.

Test Plan

  • just smoke-mod-wsgi passes both modes in an ubuntu:24.04 container; the tester cycle was also verified natively on Linux.
  • just lint-manual and the monitor, pooling, and uri_parser suites pass on Python 3.14 against MongoDB 8.0.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is there test coverage?
  • Is any followup work tracked in a JIRA ticket? If so, add link(s). (Upstream mod_wsgi issue for the child-exit crash pending; tracked in the PYTHON-6114 pitfalls.)

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?

Comment thread .github/workflows/test-python.yml Fixed
Comment thread .github/workflows/test-python.yml Fixed
Comment thread .github/workflows/test-python.yml Fixed
Comment thread .github/workflows/test-python.yml Fixed
@semgrep-code-mongodb

Copy link
Copy Markdown

Semgrep found 2 github-actions-mutable-action-tag findings:

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.

🛟 Help? Slack #semgrep-help or go/semgrep-help.

Resolution Options:

  • Fix the code
  • Reply /fp $reason (if security gap doesn’t exist)
  • Reply /ar $reason (if gap is valid but intentional; add mitigations/monitoring)
  • Reply /other $reason (e.g., test-only)

Comment thread pymongo/auth_shared.py Fixed
@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
Comment thread .github/workflows/test-mod-wsgi.yml Fixed
@blink1073
blink1073 force-pushed the PYTHON-6114 branch 2 times, most recently from d2fdbd9 to 97bc775 Compare September 25, 2026 12:24
@blink1073
blink1073 marked this pull request as ready for review September 25, 2026 13:32
@blink1073
blink1073 requested a review from a team as a code owner September 25, 2026 13:32
@blink1073
blink1073 requested review from NoahStapp and a lite review from Copilot September 25, 2026 13:32
@blink1073 blink1073 changed the title PYTHON-6114 Move mod_wsgi tests from Evergreen to GitHub Actions Run the mod_wsgi tests on GitHub Actions Sep 25, 2026

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.

Copilot review overview

🟡 Changes recommended

Unresolved critical workflow and test-orchestration issues block reliable execution.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 5 High severity · 1 Medium severity · 2 Low severity

Open (8)
What changed in this PR

Moves mod_wsgi integration tests from Evergreen to GitHub Actions with shared local/CI tooling, dependency setup, and updated Apache configurations.

Changes:

  • Adds dedicated minimum- and latest-dependency workflows.
  • Adds mod_wsgi orchestration, version-matrix, and smoke-test tooling.
  • Updates documentation and removes obsolete Apache 2.2 configurations.
File Description
uv.lock Locks mod_wsgi and updated dependency metadata.
test/​mod_wsgi_test/​README.rst Documents CI and local testing.
test/​mod_wsgi_test/​httpd24fedora.conf Adds Fedora Apache configuration.
test/​mod_wsgi_test/​apache24ubuntu161404.conf Removes obsolete configuration.
test/​mod_wsgi_test/​apache24ubuntu.conf Adds Ubuntu Apache configuration.
test/​mod_wsgi_test/​apache22ubuntu1204.conf Removes obsolete configuration.
test/​mod_wsgi_test/​apache22amazon.conf Removes obsolete configuration.
pyproject.toml Adds the mod_wsgi dependency group.
justfile Adds smoke testing and dispatch integration.
CONTRIBUTING.md Documents running mod_wsgi tests.
.gitignore Ignores Apache logs.
.github/​workflows/​test-mod-wsgi.yml Defines GitHub Actions jobs.
.github/​actions/​mod-wsgi-versions/​action.yml Computes test versions.
.evergreen/​scripts/​mod_wsgi.sh Orchestrates native and container tests.
.evergreen/​scripts/​mod_wsgi_tester.py Manages Apache and test execution.
.evergreen/​scripts/​mod_wsgi_matrix.py Defines the version matrix.
.evergreen/​scripts/​dispatch.sh Dispatches shared test recipes.

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

Comment thread .evergreen/scripts/mod_wsgi.sh
Comment thread .evergreen/scripts/mod_wsgi.sh
Comment thread .evergreen/scripts/mod_wsgi.sh Outdated
Comment thread .github/workflows/test-mod-wsgi.yml
Comment thread test/mod_wsgi_test/httpd24fedora.conf Outdated
Comment thread .github/workflows/test-mod-wsgi.yml
Comment thread CONTRIBUTING.md Outdated
Comment thread test/mod_wsgi_test/README.rst Outdated
@blink1073
blink1073 marked this pull request as draft September 25, 2026 13:43
@blink1073 blink1073 closed this Sep 25, 2026
@blink1073 blink1073 reopened this Sep 25, 2026
@blink1073
blink1073 requested a balanced review from Copilot September 25, 2026 14:08

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.

Comment thread .evergreen/scripts/mod_wsgi_tester.py Outdated
Comment thread .evergreen/scripts/mod_wsgi.sh Outdated
Comment thread .evergreen/scripts/mod_wsgi.sh Outdated
@blink1073
blink1073 force-pushed the PYTHON-6114 branch 2 times, most recently from b832734 to 3a6cf7e Compare September 25, 2026 15:49
@blink1073
blink1073 requested a balanced review from Copilot September 25, 2026 15:49

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.

Comment thread .evergreen/scripts/mod_wsgi_tester.py Outdated
Comment thread .evergreen/scripts/mod_wsgi_tester.py Outdated
Comment thread test/mod_wsgi_test/README.rst Outdated

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.

Copilot review overview

🟡 Changes recommended

Failed setup can bypass mod_wsgi teardown and leave Apache or Docker resources running.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (1)

Comment thread .evergreen/scripts/mod_wsgi.sh

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.

Copilot review overview

🟡 Changes recommended

Both new CI jobs use malformed local-action references, so neither reaches the mod_wsgi tests.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (2)

Comment thread CONTRIBUTING.md Outdated
Move the mod_wsgi tests to a dedicated test-mod-wsgi.yml workflow: a
min-deps job (Fedora container, httpd) and a latest job (Ubuntu,
apache2), each running standalone and embedded rounds, triggered when
mod_wsgi-relevant files change. The mod-wsgi-versions action computes
the CPython and MongoDB versions from the Evergreen config lists.

Add .evergreen/scripts/mod_wsgi.sh with dispatch.sh routing the just
recipes, so just setup-tests mod_wsgi <mode>, just run-tests, and just
teardown-tests run the tests against the host's Apache on Linux and
inside an ubuntu container with its own replica set otherwise (just
smoke-mod-wsgi runs both modes). mod_wsgi_tester.py drives Apache and
verifies readiness; mod_wsgi_matrix.py defines the version matrix.
Document the workflow and the local commands in CONTRIBUTING.md.

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.

Copilot review overview

🟡 Changes recommended

Both CI jobs use invalid repository-local action paths and therefore cannot start.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Comment thread .github/workflows/test-mod-wsgi.yml

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.

Copilot review overview

🟡 Changes recommended

Invalid local-action paths prevent both CI jobs from starting, and partial container initialization cannot recover automatically.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
Resolved since last review (1)

Comment thread .github/workflows/test-mod-wsgi.yml
Comment thread .evergreen/scripts/mod_wsgi.sh
Comment thread .github/workflows/test-mod-wsgi.yml Fixed

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.

Copilot review overview

🟡 Changes recommended

Unresolved workflow and setup defects prevent reliable CI execution.

Review effort: Lite
Findings: 3 High severity

Open (3)
Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Avoid primary server selection timeout during replica set probing

.evergreen/​scripts/​mod_wsgi.sh:199

On a fresh container, mongod is started with --replSet but has no primary yet. MongoClient().admin.command("hello") uses the default primary server selection, so this probe waits for PyMongo's default server-selection timeout before the initiation branch runs, adding roughly 30 seconds to every fresh/recreated container bootstrap. Probe replSetGetStatus through a direct connection instead; it returns immediately for both initialized and uninitialized replica sets.

Comment thread .evergreen/scripts/mod_wsgi_tester.py Outdated
Comment thread .github/workflows/test-mod-wsgi.yml Outdated
Comment thread .github/workflows/test-mod-wsgi.yml

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.

Copilot review overview

🟡 Changes recommended

Unresolved workflow validation, process-management, and process-targeting issues remain.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (3)

Comment thread .evergreen/scripts/mod_wsgi_tester.py Outdated
@blink1073
blink1073 marked this pull request as ready for review September 28, 2026 11:32
@blink1073

Copy link
Copy Markdown
Member Author

@NoahStapp ready for real this time

@blink1073
blink1073 merged commit ac8ae76 into mongodb:main Sep 28, 2026
115 of 120 checks passed
@blink1073
blink1073 deleted the PYTHON-6114 branch September 28, 2026 15:25
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.

4 participants