Skip to content

ci: allow PRs to merge when CI jobs are skipped#123

Merged
BYK merged 3 commits intomainfrom
ci/allow-merge-when-jobs-skip
Jan 30, 2026
Merged

ci: allow PRs to merge when CI jobs are skipped#123
BYK merged 3 commits intomainfrom
ci/allow-merge-when-jobs-skip

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Jan 30, 2026

Summary

Fixes the issue where PRs that don't change relevant files (e.g., only README.md) cannot be merged because required CI checks are skipped rather than passing.

Changes

  • Add changes job: Uses dorny/paths-filter (SHA-pinned to v3.0.2) to detect which files changed
  • Conditional job execution: First-tier jobs (check-skill, lint, test-unit) check the filter outputs; downstream jobs inherit skip behavior from their dependencies
  • Add ci-status job: Single required check that runs with if: always() and passes when jobs are skipped, fails if any job failed/cancelled
  • Release branch handling: Always run full CI on release/** branches regardless of changed paths

Post-Merge Action

Update branch protection rules for main:

  1. Remove individual job checks (lint, test-unit, build-binary, etc.)
  2. Add CI Status as the only required check

Add path-based filtering using dorny/paths-filter to detect relevant
changes and conditionally run CI jobs. This allows PRs that don't
affect code (e.g., README changes) to merge without waiting for
skipped required checks.

- Add 'changes' job to detect modified paths
- First-tier jobs (check-skill, lint, test-unit) gate on change detection
- Downstream jobs inherit skip behavior from dependencies
- Add 'ci-status' job as single required check that passes when jobs skip
- Always run full CI on release/** branches regardless of paths
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 30, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (docs) Add Sentry SDK for error tracking, replay, and metrics by betegon in #122

Bug Fixes 🐛

  • (npx) Suppress Node.js warnings in npm package by BYK in #115

Internal Changes 🔧

  • Allow PRs to merge when CI jobs are skipped by BYK in #123

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 30, 2026

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 1756 uncovered lines.
✅ Project coverage is 66.66%. Comparing base (base) to head (head).

Files with missing lines (24)
File Patch % Lines
human.ts 30.83% ⚠️ 673 Missing
resolve-target.ts 18.93% ⚠️ 257 Missing
oauth.ts 21.71% ⚠️ 202 Missing
resolver.ts 3.23% ⚠️ 120 Missing
errors.ts 5.94% ⚠️ 95 Missing
api-client.ts 68.77% ⚠️ 94 Missing
migration.ts 47.44% ⚠️ 82 Missing
api.ts 89.80% ⚠️ 47 Missing
seer.ts 75.54% ⚠️ 45 Missing
errors.ts 73.17% ⚠️ 33 Missing
seer.ts 76.15% ⚠️ 31 Missing
preload.ts 39.02% ⚠️ 25 Missing
detector.ts 87.79% ⚠️ 16 Missing
telemetry.ts 89.87% ⚠️ 8 Missing
auth.ts 93.69% ⚠️ 7 Missing
index.ts 95.06% ⚠️ 4 Missing
colors.ts 91.84% ⚠️ 4 Missing
env-file.ts 97.17% ⚠️ 3 Missing
utils.ts 98.64% ⚠️ 2 Missing
alias.ts 98.56% ⚠️ 2 Missing
project-aliases.ts 97.40% ⚠️ 2 Missing
schema.ts 90.00% ⚠️ 2 Missing
java.ts 97.22% ⚠️ 1 Missing
parser.ts 98.63% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    66.66%    66.66%        —%
==========================================
  Files           45        45         —
  Lines         5267      5267         —
  Branches         0         0         —
==========================================
+ Hits          3511      3511         —
- Misses        1756      1756         —
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK marked this pull request as ready for review January 30, 2026 12:59
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

When an upstream job like lint or test-unit fails, dependent jobs are
marked as 'skipped' rather than 'failure'. The ci-status job now detects
this scenario by checking if changes were detected but the expected jobs
were skipped, which indicates an upstream failure.
@BYK BYK merged commit d6ce733 into main Jan 30, 2026
24 checks passed
@BYK BYK deleted the ci/allow-merge-when-jobs-skip branch January 30, 2026 13:14
BYK added a commit that referenced this pull request Mar 18, 2026
…#456)

## Problem

The `ContextError` and `ResolutionError` classes produce structured
`Try: ... Or: ...` error messages, but they're misused in ~15 call
sites, producing confusing output. Real Sentry issues confirm this
affects hundreds of users:

- **CLI-7V** (127 events, 35 users): `Project is required. Specify it
using: No project 'patagonai' found...`
- **CLI-4A** (21 events, 13 users): `Project 'AGENT-API' not found is
required.`
- **CLI-EZ**: `Trace ID and span ID is required.` (grammar) + irrelevant
DSN alternatives

## Changes

**Error class fixes:**
- Fix grammar: `"X and Y is required"` → `"are required"` for compound
resources
- Convert 8 `ContextError` misuses to `ResolutionError` (org-list,
project/list, issue/list, project/create, resolve-team, project/view,
resolve-target)
- Convert pagination cursor error to `ValidationError`
- Pass `alternatives: []` at 14 sites where DSN hints are irrelevant
(Trace ID, Log ID, Event ID, Span ID)

**event view enhancement:**
- Issue URLs (`/issues/123/`) now fetch the latest event via
`getLatestEvent()` instead of throwing a confusing error about missing
event IDs

**Prevention measures:**
- Runtime assertion in `ContextError` constructor: `command` must be
single-line (throws on `\n`)
- CI check script (`script/check-error-patterns.ts`) scanning for
multiline ContextError commands and ad-hoc `Try:` patterns in `CliError`
- Added `check:errors` step to CI workflow
- Updated AGENTS.md with error class selection guidance

Fixes CLI-7V, CLI-4A, CLI-EZ, CLI-CC, CLI-DQ
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.

1 participant