Skip to content

Improved CI#2079

Open
bfoley12 wants to merge 10 commits into
devfrom
api-server-ci
Open

Improved CI#2079
bfoley12 wants to merge 10 commits into
devfrom
api-server-ci

Conversation

@bfoley12

@bfoley12 bfoley12 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Note

  • Summary says + 5,000 LOC, >4,600 lines are from uv.lock, and will be slimmed down further by fastapi-conversion, since that branch removed a lot of obsolete dependencies.
  • This branch was taken off of main, so some other changes are being brought into dev

Summary

Updated CI to include mpcontribs-api and allow different tech stacks/versions across the sub-repos.

File Changes

  • dependabot: included checking uv packages for updates; included checks for github action updates
  • _python_ci.yml: a reusable abstraction for sub-repos to use for linting, type checking, and testing
  • ci.yml: what is inspected by github to determine a ci success. As we update the other repos, we should create a justfile with the required commands and register the sub-repo here
  • justfile: a command runner for the mpcontribs-api repo. This is an improvement on the fastapi-conversion branch's justfile, it adds commands for CI to use

@bfoley12 bfoley12 requested a review from tsmathis June 22, 2026 23:27
@bfoley12 bfoley12 self-assigned this Jun 22, 2026
Comment thread .github/workflows/ci.yml
Comment on lines +40 to +57
run: |
# Map of migrated package -> optional python-version override
# ("" = use the package's .python-version pin). Only packages whose
# filter reported a change are emitted into the matrix.
python3 - "$CHANGES" <<'PY' >> "$GITHUB_OUTPUT"
import json, sys
changes = json.loads(sys.argv[1])
config = {
"mpcontribs-api": {"python-version": ""},
# "mpcontribs-client": {"python-version": ""}, # add when migrated
}
include = [
{"package": pkg, **cfg}
for pkg, cfg in config.items()
if changes.get(pkg) == "true"
]
print("packages=" + json.dumps(include))
PY

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Provides packages on a "new" stack (uv, justfile) alongside a potential python version override to further CI steps

Comment thread .github/workflows/ci.yml
Comment on lines +58 to +70

ci:
needs: discover
if: ${{ needs.discover.outputs.packages != '[]' }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.discover.outputs.packages) }}
uses: ./.github/workflows/_python_ci.yml
with:
package: ${{ matrix.package }}
python-version: ${{ matrix.python-version }}
coverage-artifact: coverage-${{ matrix.package }}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Runs a unified CI workflow for each discovered repo. Provides which package is being ran, which version of python to use (defaults to the repos specified version), and where to put the test coverage artifact

Comment thread .github/workflows/ci.yml
Comment on lines +73 to +88
gate:
name: ci-success
if: always()
needs: [discover, ci]
runs-on: ubuntu-latest
steps:
- name: Verify CI result
run: |
result="${{ needs.ci.result }}"
# 'skipped' is success here: it means no migrated package needed checking.
if [ "$result" = "success" ] || [ "$result" = "skipped" ]; then
echo "CI gate passed (ci job: $result)"
exit 0
fi
echo "CI gate failed (ci job: $result)"
exit 1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

What actually gets depended on by the repo rules. Should require a status check where context = "ci-success"

@bfoley12 bfoley12 marked this pull request as ready for review June 22, 2026 23: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.

2 participants