Skip to content

🔧 build(ci): ensure CI runs on prepare-release PRs#641

Merged
codekiln merged 2 commits intomainfrom
claude/640-buildci-ensure-ci-runs-on-prepare-release-prs-rega
Dec 6, 2025
Merged

🔧 build(ci): ensure CI runs on prepare-release PRs#641
codekiln merged 2 commits intomainfrom
claude/640-buildci-ensure-ci-runs-on-prepare-release-prs-rega

Conversation

@codekiln
Copy link
Owner

@codekiln codekiln commented Dec 6, 2025

Summary

Fixes #640

Modifies the CI workflow to always run on release branches (release/v*) created by the prepare-release workflow, even when only documentation or changelog files are modified.

This resolves the issue where the Release workflow's verify-ci job fails because it expects CI checks (Check, Test, Clippy, Build) to have run, but they were skipped due to paths-ignore filters.

Changes

Workflow-Level Changes

  • Removed paths-ignore filters from workflow-level triggers (previously at lines 8-12, 16-22)
  • Replaced with job-level conditional execution for more fine-grained control

New changes Job

Added a new job that determines whether to run CI based on:

  1. Branch name pattern: Always runs CI for release/* branches (created by prepare-release workflow)
  2. Changed files: For regular PRs, skips CI if only these files changed:
    • **/*.md (markdown files)
    • docs/** (documentation directory)
    • *.txt (root-level text files)
    • .gitignore
  3. Push events: Always runs CI for pushes to main

Job Dependencies

  • All CI jobs now depend on the changes job
  • Jobs run conditionally: if: needs.changes.outputs.should_run == 'true'
  • Updated all-jobs aggregator to include changes in its needs list

Implementation Details

The changes job (lines 29-90):

  • Detects release branches using pattern matching: release/*
  • For PRs, uses gh pr view to get changed files and filters them
  • Sets output should_run to true/false based on the checks above

All downstream jobs check needs.changes.outputs.should_run == 'true' before running.

Why This Approach?

Alternative approaches considered:

  1. pull_request_target: Security implications (runs in base branch context)
  2. Multiple workflow triggers: GitHub Actions merges multiple pull_request entries
  3. Workflow-level conditionals: Can't access PR metadata if workflow is filtered out by paths-ignore

Job-level conditionals: Allows workflow to run, then conditionally execute jobs based on branch and file changes.

Testing

This PR will test the new logic:

  • Modified only .github/workflows/ci.yml
  • Should trigger full CI since it's a code file change
  • Once merged, release PRs will trigger CI even with only CHANGELOG.md changes

References

Test Plan

  • YAML syntax validated (via gh workflow view)
  • Commit follows conventional emoji commits
  • CI runs successfully on this PR (workflow file changed)
  • After merge: Test by creating a release PR with only CHANGELOG.md changes
  • Verify Release workflow succeeds when CI checks are present

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Fixes #640

Modifies CI workflow to always run on release branches (release/v*)
created by the prepare-release workflow, even when only docs/changelog
files are modified.

## Changes

- Removed workflow-level `paths-ignore` filters (lines 8-12, 16-22)
- Added new `changes` job that determines whether to run CI based on:
  * Branch name pattern (always run for release/* branches)
  * Changed files (skip for docs-only on regular PRs)
- Made all CI jobs conditional on `changes` job output
- Updated `all-jobs` aggregator to include `changes` dependency

## Implementation Details

The `changes` job checks:
1. If branch matches `release/*` pattern → always run CI
2. If branch is regular PR → check changed files
   - Skip if only: *.md, docs/**, *.txt, .gitignore
   - Run if any code files changed
3. If push to main → always run CI

This ensures the Release workflow's verify-ci job can find required
checks (Check, Test, Clippy, Build) even for release PRs that only
modify CHANGELOG.md and Cargo.toml.

## References

- Issue: #640
- Failed release run: https://github.com/codekiln/langstar/actions/runs/19992537324
- prepare-release workflow: .github/workflows/prepare-release.yml:241

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 6, 2025 19:36
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

Unit Test Results

174 tests   174 ✅  1s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 82248c4.

♻️ This comment has been updated with latest results.

Copy link
Contributor

Copilot AI left a comment

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 modifies the CI workflow to ensure that all CI jobs run on release branches (matching release/* pattern) even when only documentation or changelog files are modified. This fixes issue #640 where the Release workflow's verify-ci job was failing because CI checks were being skipped due to paths-ignore filters.

Key Changes:

  • Removed workflow-level paths-ignore filters and replaced them with a new changes job that performs job-level conditional execution
  • Added branch pattern detection to always run CI for release/* branches
  • Updated all CI jobs to depend on the changes job with conditional execution based on file changes
Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:366

  • Missing the check-feature-publish-status job from the all-jobs needs list. The all-jobs aggregator should include all jobs that can run in the workflow to properly reflect the overall CI status.

Add check-feature-publish-status to the needs list at line 367:

needs:
  - changes
  - check
  - test
  - integration-tests
  - clippy
  - audit
  - build
  - check-feature-publish-status

Note: Jobs with conditional execution (like if: github.event_name == 'pull_request') can still be included in the needs list; they'll show as "skipped" when conditions aren't met, which the jq check at line 370 already handles correctly.

    needs:
      - changes
      - check
      - test
      - integration-tests
      - clippy
      - audit
      - build

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

Integration Test Results

275 tests   275 ✅  3m 3s ⏱️
 10 suites    0 💤
  1 files      0 ❌

Results for commit 82248c4.

♻️ This comment has been updated with latest results.

Addresses review comments from PR #641:
- Add error handling for gh pr view failures (safer default)
- Add check for empty CHANGED_FILES
- Fix .txt file pattern matching logic (use regex instead of glob)
- Use == instead of = for consistency with double-bracket tests

Changes:
1. Line 60: Added 2>/dev/null error suppression and fallback
2. Lines 61-65: Added empty check with safe default (run CI)
3. Line 73: Fixed .txt pattern to use regex `! "$file" =~ /`
4. Line 82: Changed `=` to `==` for consistency

All changes improve robustness and follow bash best practices.

Addresses:
- #641 (comment)
- #641 (comment)
- #641 (comment)
- #641 (comment)
@codekiln codekiln merged commit b43896a into main Dec 6, 2025
24 checks passed
@codekiln codekiln deleted the claude/640-buildci-ensure-ci-runs-on-prepare-release-prs-rega branch December 6, 2025 19:51
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.

🔧 build(ci): ensure CI runs on prepare-release PRs regardless of path filters

2 participants