Skip to content

ci: cross-platform test matrix (ubuntu, macos, windows × py3.11/3.12)#132

Merged
Gradata merged 2 commits into
mainfrom
ci/matrix-from-origin
Apr 21, 2026
Merged

ci: cross-platform test matrix (ubuntu, macos, windows × py3.11/3.12)#132
Gradata merged 2 commits into
mainfrom
ci/matrix-from-origin

Conversation

@Gradata
Copy link
Copy Markdown
Owner

@Gradata Gradata commented Apr 21, 2026

Summary

Why

sdk-publish.yml only runs on tag push and only builds — no tests. Before this PR, platform-specific code paths (fcntl vs msvcrt in platform_lock) were only verified on one developer's local machine. macOS parity was assumed.

Test plan

  • Workflow YAML validates
  • Green on this PR (CI will confirm)
  • Expected skip counts documented: 2 on Windows (POSIX fcntl), 2 on macOS/Linux (Windows msvcrt)

Out of scope

  • Coverage gates
  • Lint / type check jobs (separate workflow)
  • Branch protection to require this workflow — repo settings change, deferred

Generated with Gradata

Closes #131.

The existing sdk-publish.yml only runs on v* tag push and doesn't run
pytest at all, so regressions land on main with no machine-verified
signal and platform-specific code paths (fcntl on POSIX, msvcrt on
Windows) only ever run on one developer's local box.

This workflow runs on push to main and pull_request to main. 6 jobs:
3 OSes × 2 Python versions, fail-fast disabled so a Windows-only bug
doesn't hide a macOS-only one.

Co-Authored-By: Gradata <noreply@gradata.ai>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough
  • Added .github/workflows/test.yml to run pytest on push to main and on PRs targeting main.
  • Matrix: 3 OSes (ubuntu-latest, macos-latest, windows-latest) × 2 Python versions (3.11, 3.12) = 6 jobs; fail-fast: false.
  • Job steps: checkout, setup Python, install uv (pinned astral-sh/setup-uv@v0.11.7), cd Gradata && uv sync --all-extras --dev, then uv run pytest tests/ -q --tb=short -m "not integration".
  • Workflow-level permissions set to contents: read; concurrency configured to cancel in-progress runs.
  • Intentionally exercises platform-specific code paths (e.g., POSIX fcntl vs Windows msvcrt in platform_lock); documented expected skips (2 POSIX skips on Windows; 2 Windows-only skips on macOS/Linux).
  • CI validation: workflow YAML validated locally; CI green on this PR pending. Closes #131.
  • No breaking changes, no security fixes, and no public API or exported-entity changes.
  • Diff size: +46/–0. Estimated review effort: Low.

Walkthrough

Adds a new GitHub Actions workflow .github/workflows/test.yml that runs pytest on push and pull_request events targeting main across a 3-OS (ubuntu, macOS, windows) × 2-Python (3.11, 3.12) matrix, using uv to sync dependencies in the Gradata directory.

Changes

Cohort / File(s) Summary
GitHub Actions Test Workflow
​.github/workflows/test.yml
New workflow triggered on push and pull_request targeting main. Sets minimal permissions, concurrency (tests-${{ github.ref }} with cancel-in-progress), and a matrix job across ubuntu-latest, macos-latest, windows-latest × Python 3.11, 3.12. Steps: checkout, setup-python, install uv@0.11.7, cd Gradata && uv sync --all-extras --dev, then uv run pytest tests/ -q --tb=short -m "not integration".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a cross-platform test matrix for CI.
Description check ✅ Passed The description is directly related to the changeset, providing context about why the workflow was added and what it tests.
Linked Issues check ✅ Passed The PR implements all coding requirements from issue #131: workflow triggers, OS/Python matrix, dependencies sync, pytest execution, and integration test exclusion.
Out of Scope Changes check ✅ Passed All changes are within scope of issue #131. The PR adds only the test workflow file and explicitly defers coverage gates, additional CI jobs, and branch protection.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/matrix-from-origin

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the feature label Apr 21, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/test.yml:
- Around line 1-13: Add a top-level permissions block to this workflow so it
runs with least privilege: add permissions: contents: read at the workflow root
(alongside name, on, concurrency, jobs) so the actions/checkout step has the
required read-only access and the workflow does not inherit broader default
token scopes.
- Around line 41-43: The CI step named "Run pytest" currently executes all tests
(working-directory: Gradata, run: uv run pytest tests/ -q --tb=short); update
that run command to explicitly exclude integration tests by adding a pytest
marker filter (e.g., append -m "not integration") so tests marked with
`@pytest.mark.integration` are skipped in CI. Locate the "Run pytest" step and
modify its run string to include the marker exclusion.
- Around line 32-36: Replace the non-deterministic GitHub Actions input using
version: "latest" for the astral-sh/setup-uv@v4 step with a pinned, tested uv
release (e.g., "0.11.7"); update the workflow step that uses
astral-sh/setup-uv@v4 and change the version key from "latest" to the chosen
stable version string so CI runs are reproducible and won't break on future uv
releases.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4703316e-91c9-4694-a149-206bd9ebf7a0

📥 Commits

Reviewing files that changed from the base of the PR and between 5ef1a1e and 8b50bb8.

📒 Files selected for processing (1)
  • .github/workflows/test.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: pytest ubuntu-latest / py3.12
  • GitHub Check: pytest windows-latest / py3.12
  • GitHub Check: pytest macos-latest / py3.11
  • GitHub Check: pytest windows-latest / py3.11
  • GitHub Check: pytest ubuntu-latest / py3.11
  • GitHub Check: pytest macos-latest / py3.12
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Gradata
Repo: Gradata/gradata PR: 0
File: :0-0
Timestamp: 2026-04-17T17:18:07.439Z
Learning: In PR `#102` (gradata/gradata), Round 2 addressed: cli.py env-first brain resolution (GRADATA_BRAIN > --brain-dir > cwd), _tenant.py corrupt .tenant_id overwrite, _env_int default clamping to minimum, and _events.py tenant-scoped fallback SELECT for dedup. All ruff and 99 tests green after these fixes.
🔇 Additional comments (1)
.github/workflows/test.yml (1)

3-22: Matrix and trigger coverage matches the stated CI objective.

This correctly sets up the 3×2 OS/Python matrix on push to main and pull_request to main, with fail-fast: false for full signal.

Comment thread .github/workflows/test.yml
Comment thread .github/workflows/test.yml
Comment thread .github/workflows/test.yml Outdated
- add workflow-level permissions: contents: read (least privilege)
- pin astral-sh/setup-uv@v4 version from "latest" to "0.11.7" (reproducibility)
- exclude integration tests in CI via -m "not integration"

Co-Authored-By: Gradata <noreply@gradata.ai>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/test.yml:
- Around line 17-19: The CI job named "test" can hang indefinitely; add a
timeout to the job configuration by setting the timeout-minutes property on the
"test" job (the job block whose name is "pytest ${{ matrix.os }} / py${{
matrix.python }}") to a reasonable limit (e.g., 10–30 minutes) so GitHub Actions
will cancel stuck runs; update the "test" job definition to include
timeout-minutes: <minutes> alongside runs-on and name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 95ec12c8-c79b-4948-8be9-49c4a5920b00

📥 Commits

Reviewing files that changed from the base of the PR and between 8b50bb8 and a6c4a07.

📒 Files selected for processing (1)
  • .github/workflows/test.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: pytest windows-latest / py3.11
  • GitHub Check: pytest macos-latest / py3.11
  • GitHub Check: pytest macos-latest / py3.12
  • GitHub Check: pytest windows-latest / py3.12
  • GitHub Check: pytest ubuntu-latest / py3.11
  • GitHub Check: pytest ubuntu-latest / py3.12
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Gradata
Repo: Gradata/gradata PR: 0
File: :0-0
Timestamp: 2026-04-17T17:18:07.439Z
Learning: In PR `#102` (gradata/gradata), Round 2 addressed: cli.py env-first brain resolution (GRADATA_BRAIN > --brain-dir > cwd), _tenant.py corrupt .tenant_id overwrite, _env_int default clamping to minimum, and _events.py tenant-scoped fallback SELECT for dedup. All ruff and 99 tests green after these fixes.
🔇 Additional comments (3)
.github/workflows/test.yml (3)

9-14: Good security baseline and sane concurrency control.

Workflow-level least privilege (contents: read) and cancel-in-progress are correctly set. This matches a test-only workflow and prevents stale duplicate runs.


20-24: Matrix configuration is correct and matches the PR objective.

ubuntu/macos/windows × 3.11/3.12 with fail-fast: false is a solid cross-platform coverage setup.


44-46: Pytest invocation is aligned with repo test strategy.

Running tests/ with -m "not integration" is consistent with the configured integration marker and keeps CI cost-safe.

Comment on lines +17 to +19
test:
name: pytest ${{ matrix.os }} / py${{ matrix.python }}
runs-on: ${{ matrix.os }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Add a job timeout to avoid hung CI runners.

Consider setting timeout-minutes on the test job so intermittent hangs do not burn CI minutes indefinitely.

Suggested change
   test:
     name: pytest ${{ matrix.os }} / py${{ matrix.python }}
     runs-on: ${{ matrix.os }}
+    timeout-minutes: 20
     strategy:
       fail-fast: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
test:
name: pytest ${{ matrix.os }} / py${{ matrix.python }}
runs-on: ${{ matrix.os }}
test:
name: pytest ${{ matrix.os }} / py${{ matrix.python }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/test.yml around lines 17 - 19, The CI job named "test" can
hang indefinitely; add a timeout to the job configuration by setting the
timeout-minutes property on the "test" job (the job block whose name is "pytest
${{ matrix.os }} / py${{ matrix.python }}") to a reasonable limit (e.g., 10–30
minutes) so GitHub Actions will cancel stuck runs; update the "test" job
definition to include timeout-minutes: <minutes> alongside runs-on and name.

@Gradata Gradata merged commit 48f3bb6 into main Apr 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add cross-platform test matrix (ubuntu, macos, windows × py3.11, py3.12)

1 participant