Skip to content

fix(ci): unbreak lint/test by decoupling optional guardrails extra#279

Merged
Hackshaven merged 2 commits into
mainfrom
hotfix/ci-guardrails-unfetchable
Jun 1, 2026
Merged

fix(ci): unbreak lint/test by decoupling optional guardrails extra#279
Hackshaven merged 2 commits into
mainfrom
hotfix/ci-guardrails-unfetchable

Conversation

@Hackshaven

Copy link
Copy Markdown
Collaborator

The Run Tests workflow was failing at install time on guardrails-ai (0.8.2) because the entire guardrails-ai project is quarantined on PyPI — https://pypi.org/simple/guardrails-ai/ returns pypi:project-status: quarantined with zero file links, so neither the locked 0.8.2 nor any other version (0.8.0, 0.8.1, 0.10.x) can be resolved or downloaded.

Workflow changes (hotfix scope only):

  • Lint job: drop -E guardrails. The job only runs ruff format --check and ruff check; ruff is a dev-group dependency and never needed the runtime extra.
  • Core test job: drop -E guardrails and run pytest -m "not guardrails" so upstream churn in the optional extra cannot red the blocking coverage gate. Install remains --with dev -E api.
  • New test-guardrails job: installs --with dev -E api -E guardrails, runs pytest -m guardrails with coverage, and is continue-on-error: true. Mirrors the existing job's Python 3.10 pin, Poetry install, caching, and env. While the upstream quarantine persists this job will be yellow but non-blocking.
  • Cache key prefix bumped from poetry-${{ runner.os }}- to poetry-v2-${{ runner.os }}- in all three jobs so the first post-fix run does not restore stale PyPI index metadata.

Not changed:

  • pyproject.toml: the guardrails-ai = "^0.8.0" optional dep and guardrails extra remain (the source-level import guardrails is already wrapped in a try/except and degrades to NullGuardrailsAdapter when missing).
  • poetry.lock: poetry lock --regenerate --no-cache fails with "Because zyra depends on guardrails-ai (^0.8.0) which doesn't match any versions, version solving failed" — and the same with ^0.10.0 — because PyPI exposes zero candidates. The existing lock entry (0.8.2) is only consulted when the guardrails extra is enabled, which is now exclusively the non-blocking job.

Pull Request Template

Summary

Provide a short summary of the changes in this PR.

Related Issue

Closes # (or Links to: #)

Issue Type

  • Bug
  • Feature
  • Workflow Gap
  • Task

Changes

  • Implemented functionality in src/zyra/
  • Added/updated tests in tests/
  • Verified comprehensive docstrings for auto-generated documentation
  • Added/updated example in sample workflows

Type of Change

  • Bug fix
  • Feature
  • Workflow Gap implementation
  • 🧹 Task (maintenance/refactor/CI/docs)
  • Docs only / CI only
  • Refactor (no functional change)

Impact / Risk

Describe impact, blast radius, and any rollback considerations.

Validation Steps

List steps for reviewers to verify this change (commands, expected results).

Checklist

  • Code follows project style guidelines
  • All tests pass locally
  • Documentation builds cleanly from docstrings
  • I have linked this PR to a relevant issue (Bug/Feature/Workflow Gap/Task)
  • No secrets or credentials added; follows repo guardrails
  • All commits in this PR are Signed-off-by (DCO)

The Run Tests workflow was failing at install time on `guardrails-ai
(0.8.2)` because the entire `guardrails-ai` project is quarantined on
PyPI — `https://pypi.org/simple/guardrails-ai/` returns
`pypi:project-status: quarantined` with zero file links, so neither
the locked 0.8.2 nor any other version (0.8.0, 0.8.1, 0.10.x) can be
resolved or downloaded.

Workflow changes (hotfix scope only):

- Lint job: drop `-E guardrails`. The job only runs `ruff format
  --check` and `ruff check`; ruff is a dev-group dependency and never
  needed the runtime extra.
- Core test job: drop `-E guardrails` and run `pytest -m "not
  guardrails"` so upstream churn in the optional extra cannot red the
  blocking coverage gate. Install remains `--with dev -E api`.
- New `test-guardrails` job: installs `--with dev -E api -E
  guardrails`, runs `pytest -m guardrails` with coverage, and is
  `continue-on-error: true`. Mirrors the existing job's Python 3.10
  pin, Poetry install, caching, and env. While the upstream
  quarantine persists this job will be yellow but non-blocking.
- Cache key prefix bumped from `poetry-${{ runner.os }}-` to
  `poetry-v2-${{ runner.os }}-` in all three jobs so the first
  post-fix run does not restore stale PyPI index metadata.

Not changed:
- pyproject.toml: the `guardrails-ai = "^0.8.0"` optional dep and
  `guardrails` extra remain (the source-level `import guardrails` is
  already wrapped in a try/except and degrades to NullGuardrailsAdapter
  when missing).
- poetry.lock: `poetry lock --regenerate --no-cache` fails with
  "Because zyra depends on guardrails-ai (^0.8.0) which doesn't match
  any versions, version solving failed" — and the same with ^0.10.0 —
  because PyPI exposes zero candidates. The existing lock entry
  (0.8.2) is only consulted when the `guardrails` extra is enabled,
  which is now exclusively the non-blocking job.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Eric Hackathorn <erichackathorn@gmail.com>
@Hackshaven Hackshaven self-assigned this Jun 1, 2026
…error to step level

`continue-on-error: true` at the JOB level prevents the failure from
cascading to the workflow conclusion, but the job itself still shows
as a red ❌ on the PR check list. Moving the flag onto the install and
pytest steps makes failed steps render as yellow ⚠ warnings while the
job's overall conclusion is success/green — accurate signal that the
optional extra is upstream-broken without the visual noise of a red
required-looking check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Eric Hackathorn <erichackathorn@gmail.com>

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

Hotfix to unbreak the Run Tests workflow that has been failing at install because the guardrails-ai package is currently quarantined on PyPI. The change decouples the optional guardrails extra from the blocking lint/test jobs and isolates it in a new non-blocking job, while bumping the Poetry cache key so stale PyPI index metadata is not restored.

Changes:

  • Drop -E guardrails from the lint job and from the core test job (the latter also now runs pytest -m "not guardrails").
  • Add a new test-guardrails job that installs -E api -E guardrails, runs pytest -m guardrails, and uses step-level continue-on-error: true so upstream PyPI outages stay yellow.
  • Bump the Poetry cache key prefix from poetry- to poetry-v2- across all three jobs.

@Hackshaven Hackshaven merged commit b796a71 into main Jun 1, 2026
11 checks passed
@Hackshaven Hackshaven deleted the hotfix/ci-guardrails-unfetchable branch June 1, 2026 18:32
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