ci: separate validation and document HTTP transport - #261
Merged
Conversation
Make deterministic offline tests the normal CI gate, move live MLB API tests to a manual/scheduled workflow, remove automatic publishing workflows, and document HTTP transport behavior for 0.8.0. Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Mattsface
marked this pull request as ready for review
August 1, 2026 07:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Separates deterministic offline CI from live MLB API validation, removes automatic TestPyPI/PyPI publishing from normal pushes, and documents the HTTP transport features introduced for version 0.8.0.
Why offline and live tests were separated
Live MLB API tests can fail because of service availability, seasonal data changes, or undocumented payload changes. Deterministic offline tests are the normal pull-request gate. Live validation remains available manually and on a weekly schedule.
Offline CI
Offline CI(.github/workflows/build-and-test.yml)needs: offline-tests) and does not publishmain/release/0.8.0, plusworkflow_dispatchExternal tests
External MLB API Tests(.github/workflows/external-tests.yml)workflow_dispatchand weekly cron (0 12 * * 1, Monday 12:00 UTC)Publishing workflows removed
Deleted:
.github/workflows/build-and-test-mlbstatsapi-test.yml(TestPyPI ondevelopmentpushes).github/workflows/build-and-test-mlbstatsapi-prd.yml(PyPI onmainpushes)Normal pushes and pull requests no longer publish packages. Active workflows do not reference PyPI credentials or
pypa/gh-action-pypi-publish.HTTP transport documentation
Documented in README (
HTTP Reliability and Configuration) anddocs/http-transport.md:Mlb()usageclose()(3.05, 30.0)and custom timeoutsMlbTransportError,MlbTimeoutError,MlbHttpError,MlbDecodeError)None/[]/{})Documentation matches the merged transport code on
release/0.8.0. Production Python files were not modified in this PR.Branch protection recommendation
Select these as required checks:
Offline tests - Python 3.10Offline tests - Python 3.11Offline tests - Python 3.12Build package(optional but useful)Do not require
External MLB API tests - Python 3.12as a pull-request check.Validation results
Offline tests
Command:
poetry run pytest tests/ --ignore=tests/external_testsExternal tests
Command:
poetry run pytest tests/external_tests/ -vSkipped:
tests/external_tests/mlb/test_mlb.py::TestMlbDataApi::test_mlb_adapter_500(existing skip; no MLB API outage or response-change failure observed)Full local suite
Command:
poetry run pytest tests/Package build
Command:
poetry buildSafety checks
gh-action-pypi-publish/PYPI_API_TOKEN/TEST_PYPI_API_TOKENin active workflowsgit diff --checkcleanactionlintnot installed; skippedSafety confirmations
mlbstatsapi/not in diff)0.7.2)Note (out of scope)
While reviewing transport docs against production code,
Mlb.__init__still callsself._logger.setLevel(logging.DEBUG). That is outside this CI/docs PR and was not changed here.