Skip to content

Adding testing evironment to the lint and build yaml files for github actions#72

Merged
vratins merged 2 commits into
mainfrom
dev_tests
Mar 26, 2026
Merged

Adding testing evironment to the lint and build yaml files for github actions#72
vratins merged 2 commits into
mainfrom
dev_tests

Conversation

@vratins

@vratins vratins commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

The testing environment would require approval before linting or running builds on PRs or PR updates.

Summary by CodeRabbit

  • Chores
    • Updated CI workflows to associate build and lint jobs with a designated "testing" environment for clearer separation and management.
    • Simplified tool setup in the build pipeline to rely on the project's tool runtime configuration rather than specifying the language runtime directly; test execution remains unchanged.

Copilot AI review requested due to automatic review settings March 25, 2026 17:53
@coderabbitai

coderabbitai Bot commented Mar 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d0bb84ea-3beb-4fed-a9be-ed2e06a792f9

📥 Commits

Reviewing files that changed from the base of the PR and between 8ae7b2c and f7d1a5a.

📒 Files selected for processing (1)
  • .github/workflows/build.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/build.yml

📝 Walkthrough

Walkthrough

Added environment: testing to build, ruff, and ty jobs; removed the Python version matrix and the with.python-version input from the build job; renamed the build step from “Setup UV and python version” to “Setup UV”. Test and lint step commands were unchanged.

Changes

Cohort / File(s) Summary
CI: Build workflow
.github/workflows/build.yml
Added environment: testing to the build job; removed strategy.matrix.python-version: [3.12]; renamed step “Setup UV and python version” → “Setup UV” and removed with.python-version (left version: "0.10.6"). No test commands changed.
CI: Lint workflow
.github/workflows/lint.yml
Added environment: testing to the ruff and ty jobs. No other job steps or commands were modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰
I hopped through YAML, tidy and brisk,
One tiny line — a testing whisk.
Steps stayed steady, names trimmed neat,
Pipelines hum with softer feet. 🎋

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a testing environment to lint and build GitHub Actions workflows.
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 dev_tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@vratins vratins linked an issue Mar 25, 2026 that may be closed by this pull request

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.

Pull request overview

This PR adds a protected GitHub Actions environment (testing) to CI jobs to gate workflow execution behind environment approvals (as configured in repository settings), intended to require approval before linting/builds run on PR activity.

Changes:

  • Added environment: testing to the ruff and ty jobs in lint.yml.
  • Added environment: testing to the build job in build.yml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/lint.yml Adds testing environment gating to lint jobs (ruff, ty).
.github/workflows/build.yml Adds testing environment gating to the build/test job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build.yml Outdated
Comment on lines 17 to 20
build:
runs-on: ubuntu-latest
environment: testing
strategy:

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

environment: testing applies to this job for all triggers (including push to main and workflow_dispatch), not just pull_request. If the intent is only to require approvals for PRs/updates, consider splitting into separate jobs or using an if: condition so the protected environment is only used on pull_request runs; otherwise merges to main may stall waiting for approval.

Copilot uses AI. Check for mistakes.
Comment on lines 9 to 12
ruff:
runs-on: ubuntu-latest
environment: testing
permissions:

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

Adding environment: testing means this lint job will now wait for environment approval on every run, including workflow_dispatch. If the intent is to gate only PR-triggered executions, consider restricting the environment usage to pull_request runs (e.g., split jobs or conditionally run a gated variant).

Copilot uses AI. Check for mistakes.
Comment on lines 36 to 39
ty:
runs-on: ubuntu-latest
environment: testing

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

Same as above: environment: testing will require approval for this job on every trigger path. If you only want PR gating, avoid applying the protected environment to non-PR runs (e.g., workflow_dispatch).

Copilot uses AI. Check for mistakes.
@@ -16,6 +16,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

This change only causes a manual approval gate if the testing environment is configured in the repo settings with required reviewers/protection rules. If it isn’t configured (or doesn’t exist yet), the job will run without approval, so you may want to document/setup the environment as part of this PR (or add a note in the workflow/README).

Suggested change
runs-on: ubuntu-latest
runs-on: ubuntu-latest
# NOTE: This only enforces a manual approval gate if the `testing`
# environment is configured in the repository settings with required
# reviewers/protection rules. Otherwise, this job will run without
# manual approval.

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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/build.yml:
- Line 19: The build job is configured with "environment: testing" which will
require environment approval on both pull_request and push events; modify the
workflow so the testing environment only applies to PR runs — for the "build"
job add a conditional that limits the job (and thus the environment) to
pull_request events (e.g., an if using github.event_name == 'pull_request'), or
alternatively split into two jobs (one PR job with environment: testing and one
push job without it); update the job named "build" and remove or omit
environment: testing for push executions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 47dcb38f-9191-4d41-94bf-7a14bc9cbb66

📥 Commits

Reviewing files that changed from the base of the PR and between 99b3945 and 8ae7b2c.

📒 Files selected for processing (2)
  • .github/workflows/build.yml
  • .github/workflows/lint.yml

Comment thread .github/workflows/build.yml

@marcuscollins marcuscollins left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The CodeRabbit/Copilot comments are valid but not a critical issue I think. We can deal with the underlying issue later if for some reason it becomes a problem.

Comment thread .github/workflows/build.yml Outdated
environment: testing
strategy:
matrix:
python-version: [3.12]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think you actually use this. the matrix section is for testing different versions of parameters (like different conda or pixi environments, different versions of packages, etc...). If, as I'm assuming, you specify the python version in your pyproject.toml, and moreover you don't use this variable below in any step, I don't think it is doing anything.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah that makes sense, will let the toml file control the python version.

Comment thread .github/workflows/build.yml
@vratins
vratins merged commit c73d414 into main Mar 26, 2026
4 checks passed
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.

Adjust permissions for github actions

3 participants