Skip to content

fix(ci): remove path filters from memory validation workflow#343

Merged
rjmurillo-bot merged 2 commits into
mainfrom
fix/memory-validation-always-run
Dec 24, 2025
Merged

fix(ci): remove path filters from memory validation workflow#343
rjmurillo-bot merged 2 commits into
mainfrom
fix/memory-validation-always-run

Conversation

@rjmurillo-bot

Copy link
Copy Markdown
Collaborator

Summary

Remove path filters from memory validation workflow to fix PRs being blocked by phantom "Validate Memory Files" check.

Problem

  • "Validate Memory Files" is a required status check in branch protection rulesets
  • The workflow had path filters at the trigger level (only runs on .serena/memories/** changes)
  • PRs that don't touch memory files never trigger the workflow
  • Those PRs are permanently blocked because the required check never runs

This blocks PR #334 and any other PR that doesn't modify memory files.

Solution

  1. Remove path filters from on.push and on.pull_request triggers
  2. Keep internal change detection - the job still skips validation for non-memory changes
  3. Fix git diff handling - use event-specific commit ranges and proper array splitting

Now the workflow runs on ALL PRs, but skips validation gracefully when no memory files changed.

Test Plan

Fixes #341 (fully - PR #342 only partially fixed it)

🤖 Generated with Claude Code

The 'Validate Memory Files' job is a required status check. With path
filters at the workflow trigger level, the workflow doesn't run for
PRs that don't touch memory files, causing those PRs to be blocked.

Changes:
- Remove path filters from on.push and on.pull_request triggers
- Add comment explaining why path filters are not used
- Fix git diff to use event-specific commit ranges
- Properly split git diff output into array before filtering

The change detection logic inside the job still skips validation for
PRs that don't modify .serena/memories/** files.

Fixes PRs being blocked by phantom 'Validate Memory Files' check.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 24, 2025 09:01
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot added bug Something isn't working area-workflows GitHub Actions workflows github-actions GitHub Actions workflow updates labels Dec 24, 2025
@coderabbitai coderabbitai Bot requested a review from rjmurillo December 24, 2025 09:02
@github-actions

Copy link
Copy Markdown
Contributor

AI Quality Gate Review

Tip

Final Verdict: PASS

Walkthrough

This PR was reviewed by six AI agents in parallel, analyzing different aspects of the changes:

  • Security Agent: Scans for vulnerabilities, secrets exposure, and security anti-patterns
  • QA Agent: Evaluates test coverage, error handling, and code quality
  • Analyst Agent: Assesses code quality, impact analysis, and maintainability
  • Architect Agent: Reviews design patterns, system boundaries, and architectural concerns
  • DevOps Agent: Evaluates CI/CD, build pipelines, and infrastructure changes
  • Roadmap Agent: Assesses strategic alignment, feature scope, and user value

Review Summary

Agent Verdict Status
Security PASS
QA PASS
Analyst PASS
Architect PASS
DevOps PASS
Roadmap PASS
Architect Review Details

Design Quality Assessment

Aspect Rating (1-5) Notes
Pattern Adherence 4 Follows existing workflow patterns; internal change detection preserves original intent
Boundary Respect 5 Change scoped to CI workflow; no cross-boundary violations
Coupling 4 Maintains loose coupling between trigger mechanism and validation logic
Cohesion 5 Single responsibility: enable required check to always report status
Extensibility 4 Event-specific branching handles push/PR/dispatch cleanly

Overall Design Score: 4.4/5

Architectural Concerns

Severity Concern Location Recommendation
Low Edge case: initial push where github.event.before is all zeros L56 Consider handling 0000000 SHA for new branches

Breaking Change Assessment

  • Breaking Changes: No
  • Impact Scope: None
  • Migration Required: No
  • Migration Path: N/A

Technical Debt Analysis

  • Debt Added: Low (minor edge case handling could be improved)
  • Debt Reduced: Medium (fixes blocking CI pattern that was creating friction)
  • Net Impact: Improved

ADR Assessment

  • ADR Required: No
  • Decisions Identified: Pattern of "always-run with internal skip" for required checks
  • Existing ADR: ADR-006-thin-workflows-testable-modules.md covers workflow design patterns
  • Recommendation: N/A - this is a tactical fix aligning with existing ADR-006 principles

Recommendations

  1. Consider adding defensive handling for initial push events where github.event.before equals 0000000000000000000000000000000000000000. Use git log --oneline -1 HEAD fallback.

Verdict

VERDICT: PASS
MESSAGE: Change correctly resolves required check blocking issue. Design maintains separation between trigger scope and validation logic. Follows ADR-006 thin workflow principles.
Analyst Review Details

Let me check the correct repository path and view related files:

Analysis: PR - Remove Path Filters from Memory Validation Workflow

Code Quality Score

Criterion Score (1-5) Notes
Readability 5 Clear comments explain why path filters removed
Maintainability 5 Event-specific logic is well-organized
Consistency 5 Follows existing PowerShell patterns in workflow
Simplicity 5 Minimal changes to solve the problem

Overall: 5/5

Impact Assessment

  • Scope: Isolated (single workflow file)
  • Risk Level: Low
  • Affected Components: .github/workflows/memory-validation.yml only

Findings

Priority Category Finding Location
Low Edge Case Push event with before as null SHA (initial commit) could fail git diff memory-validation.yml:56

The ${{ github.event.before }} can be 0000000000000000000000000000000000000000 for force pushes or the first push to a new branch. This edge case is rare for the main branch but worth noting.

Recommendations

  1. Consider adding a guard for the null SHA case on push events:
elseif ($env:GITHUB_EVENT_NAME -eq 'push') {
    $before = "${{ github.event.before }}"
    if ($before -match '^0+$') {
        # First push or force push - compare against parent
        $diffOutput = git diff --name-only HEAD~1...HEAD 2>$null
    } else {
        $diffOutput = git diff --name-only $before...${{ github.sha }}
    }
}

This is a minor edge case that rarely affects main branch workflows.

Verdict

The fix correctly addresses the root cause: path filters at workflow trigger level prevent the workflow from running at all, causing required status checks to remain pending indefinitely. Moving detection inside the job allows the workflow to run (satisfying branch protection) while still skipping validation for non-memory changes.

VERDICT: PASS
MESSAGE: Clean solution that correctly fixes phantom required check blocking. The in-job change detection preserves efficiency while ensuring the check always reports status.
DevOps Review Details

Pipeline Impact Assessment

Area Impact Notes
Build None No build process changes
Test Low Validation runs more frequently now
Deploy None No deployment changes
Cost Low Workflow runs on all PRs but skips quickly for non-memory changes

CI/CD Quality Checks

Check Status Location
YAML syntax valid .github/workflows/memory-validation.yml
Actions pinned Line 42: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
Secrets secure No secrets used
Permissions minimal Line 37-38: contents: read only
Shell scripts robust Lines 50-76: Proper error handling with PowerShell

Findings

Severity Category Finding Location Fix
Low Edge Case github.event.before is all zeros on initial push to new branch Line 56 Add fallback for zero SHA
Info Documentation Clear NOTE comment explains design decision Line 16 None needed

Edge Case Detail

On line 56, ${{ github.event.before }} will be 0000000000000000000000000000000000000000 for:

  • First push to a new branch
  • Force push with rewritten history

This could cause git diff to fail. Consider adding a check:

$beforeSha = "${{ github.event.before }}"
if ($beforeSha -eq "0000000000000000000000000000000000000000") {
  $diffOutput = git diff --name-only ${{ github.sha }}^...${{ github.sha }}
} else {
  $diffOutput = git diff --name-only $beforeSha...${{ github.sha }}
}

However, this is low severity because:

  1. Push to main is the primary trigger for this case
  2. Main branch pushes after PR merge will have valid before SHA
  3. The workflow will fail visibly if this edge case occurs (not silently)

Template Assessment

  • PR Template: Not in scope for this change
  • Issue Templates: Not in scope for this change
  • Template Issues: N/A

Automation Opportunities

Opportunity Type Benefit Effort
None identified - - -

The change correctly centralizes path detection logic inside the job rather than at the trigger level.

Recommendations

  1. Consider adding zero-SHA handling for github.event.before to handle edge case pushes gracefully
  2. The internal skip logic is well-implemented with proper array splitting and regex matching

Verdict

VERDICT: PASS
MESSAGE: Workflow correctly removes path filters while preserving internal change detection. Required check will now run on all PRs. Minor edge case on push events does not warrant blocking.
Roadmap Review Details

Strategic Alignment Assessment

Criterion Rating Notes
Aligns with project goals High CI reliability is foundational to multi-agent workflow adoption
Priority appropriate High Blocking issue (#341) affecting PR merges
User value clear High Unblocks developers from phantom check failures
Investment justified High Minimal change (15 lines) solves systemic CI problem

Feature Completeness

  • Scope Assessment: Right-sized
  • Ship Ready: Yes
  • MVP Complete: Yes
  • Enhancement Opportunities: None needed; the internal skip logic preserves efficiency

Impact Analysis

Dimension Assessment Notes
User Value High Fixes blocking CI for all non-memory PRs
Business Impact Medium Reduces developer friction, enables PR velocity
Technical Leverage Medium Pattern reusable for other required checks with path filtering
Competitive Position Neutral Internal tooling fix

Concerns

Priority Concern Recommendation
Low Increased workflow runs Already mitigated by internal skip logic; monitoring recommended

Recommendations

  1. The fix correctly addresses the root cause: required checks need to run (even if skipping) to report status to GitHub.
  2. The implementation preserves efficiency through internal change detection rather than wasting CI resources on full validation.
  3. Consider documenting this pattern in .agents/governance/ for future required-check workflows that need path filtering.

Verdict

VERDICT: PASS
MESSAGE: Infrastructure fix that unblocks CI pipeline. Aligns with project goal of minimal-friction agent adoption.
Security Review Details

Security Review: Memory Validation Workflow Changes

Findings

Severity Category Finding Location CWE
Low Workflow Injection github.base_ref and other context variables used without quoting in shell interpolation .github/workflows/memory-validation.yml:53,56 CWE-78

Analysis

1. GitHub Context Variable Injection (Low Risk)

Lines 53-56 use GitHub context variables directly in shell commands:

  • origin/${{ github.base_ref }}...HEAD
  • ${{ github.event.before }}...${{ github.sha }}

These are low risk because:

  • github.base_ref is controlled by GitHub (branch name from the PR target)
  • github.event.before and github.sha are SHA hashes (alphanumeric only)
  • The checkout action already validated the repository context

2. No Secret Exposure - [PASS]
No credentials, API keys, or tokens detected.

3. No Path Traversal - [PASS]
The git diff commands only list filenames; they don't read file contents.

4. No Command Injection via PR Title/Body - [PASS]
User-controlled inputs (PR title, body, labels) are not used in shell commands.

5. Permissions - [PASS]
Workflow uses minimal contents: read permission.

6. Logic Change Review - [PASS]

  • Removing path filters is a valid fix for required check blocking
  • Internal change detection via git diff maintains the filtering intent
  • The fix correctly handles different event types (push, pull_request, workflow_dispatch)

Recommendations

  1. Optional hardening: Wrap context variables in quotes to prevent word splitting:
    git diff --name-only "origin/${{ github.base_ref }}...HEAD"
    This is defensive coding but not required since branch names are validated by GitHub.

Verdict

VERDICT: PASS
MESSAGE: No security vulnerabilities found. The workflow change safely removes path filters while maintaining internal change detection. Context variables used are GitHub-controlled values with low injection risk.
QA Review Details

Now I have enough context. Let me analyze the workflow change:


QA Review: PR - fix(ci): remove path filters from memory validation workflow

Test Coverage Assessment

Area Status Evidence Files Checked
Unit tests N/A Workflow YAML change, no PowerShell code .github/workflows/memory-validation.yml
Edge cases Partial Internal detection logic tested via Validate-MemoryIndex.Tests.ps1 tests/Validate-MemoryIndex.Tests.ps1
Error paths Tested LASTEXITCODE checks in test file lines 68-71, 158-161 tests/Validate-MemoryIndex.Tests.ps1
Assertions Present 60+ assertions across 30 test cases tests/Validate-MemoryIndex.Tests.ps1

Code Quality Analysis

Metric Value Status
Lines changed 22 (14 removed, 8 added) Within threshold
Cyclomatic complexity Low (linear flow) Pass
Duplication None detected Pass

Quality Concerns

Severity Issue Location Evidence Required Fix
MEDIUM No workflow-level test for push event before..sha handling Line 55-56 $diffOutput = git diff --name-only ${{ github.event.before }}...${{ github.sha }} Cannot test in isolation; relies on GitHub Actions context
LOW Initial push to new branch may have github.event.before as null SHA Line 55-56 First push scenario not documented Add comment noting fallback behavior

Regression Risk Assessment

  • Risk Level: Low
  • Affected Components: .github/workflows/memory-validation.yml only
  • Breaking Changes: None - workflow behavior changes from "skip workflow entirely" to "run workflow, skip validation step"
  • Required Testing: PR without memory files should see check pass with skip notice

Logic Review

Changed behavior analysis:

Event Type Before After
PR without memory files Workflow never runs, check missing Workflow runs, skips gracefully [PASS]
PR with memory files Workflow runs, validates Workflow runs, validates [NO CHANGE]
Push to main without memory files Workflow never runs Workflow runs, skips gracefully [NEW]
Push to main with memory files Workflow runs, validates Workflow runs, validates [NO CHANGE]

Internal change detection (lines 50-66):

if ($env:GITHUB_EVENT_NAME -eq 'pull_request') {
    $diffOutput = git diff --name-only origin/${{ github.base_ref }}...HEAD
} elseif ($env:GITHUB_EVENT_NAME -eq 'push') {
    $diffOutput = git diff --name-only ${{ github.event.before }}...${{ github.sha }}
} else {
    $diffOutput = git diff --name-only origin/main...HEAD
}

Edge case risk: github.event.before is 0000000... on first push to new branch. The git diff command will fail. This scenario is rare for main branch pushes but possible.

Evidence

VERDICT: PASS
MESSAGE: Workflow change correctly solves required check blocking issue with proper internal filtering.

EVIDENCE:
- Tests found: 60+ assertions for underlying validation scripts
- Edge cases: Covered for validation logic; workflow event handling relies on GitHub Actions semantics
- Error handling: Graceful skip notice on line 97 when no memory files changed
- Blocking issues: 0

Recommendations

  1. The github.event.before zero-SHA edge case is unlikely on main branch pushes but could add a defensive check:

    elseif ($env:GITHUB_EVENT_NAME -eq 'push' -and '${{ github.event.before }}' -ne '0000000000000000000000000000000000000000') {
  2. Consider adding a comment documenting the three-way merge base (...) vs two-dot diff (..) choice at line 54.


VERDICT: PASS

The change correctly addresses the root cause: required status checks need the workflow to run on all PRs. Internal filtering preserves efficiency. The validation scripts have comprehensive test coverage.


Run Details
Property Value
Run ID 20482590736
Triggered by pull_request on 343/merge
Commit 2fe8824b07260b1d09c10bb28ce9af64d773c982

Powered by AI Quality Gate - View Workflow

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 removes path filters from the Memory Validation workflow triggers to fix a critical issue where PRs not touching memory files were permanently blocked by a missing required status check. The workflow now always runs but includes internal logic to gracefully skip validation when no memory files have changed.

Key changes:

  • Removed paths filters from both push and pull_request triggers
  • Enhanced the change detection logic with event-specific git diff handling for pull requests, pushes, and manual dispatches
  • Improved PowerShell array handling by properly splitting git diff output on newlines

Comment thread .github/workflows/memory-validation.yml Outdated
Comment thread .github/workflows/memory-validation.yml Outdated
Comment thread .github/workflows/memory-validation.yml Outdated
Comment thread .github/workflows/memory-validation.yml
@rjmurillo-bot rjmurillo-bot enabled auto-merge (squash) December 24, 2025 09:06
@coderabbitai

coderabbitai Bot commented Dec 24, 2025

Copy link
Copy Markdown

Warning

Rate limit exceeded

@rjmurillo-bot has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0dadc69 and c14973e.

📒 Files selected for processing (1)
  • .github/workflows/memory-validation.yml

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Modified GitHub Actions workflow to implement job-level path filtering using git diff instead of trigger-level filters. Workflow now always runs but conditionally executes memory validations based on detected changes to .serena/memories/ directory, with event-type-specific logic for determining commit ranges.

Changes

Cohort / File(s) Change Summary
GitHub Actions Workflow Configuration
.github/workflows/memory-validation.yml
Removed trigger path filters; added git diff logic inside job to compute changed files array; implemented event-type handling (push uses before..HEAD, pull_request uses base comparison, others fall back to origin/main); kept memory-change detection filtering for .serena/memories/; added explanatory comments

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #141: Adds actions/checkout to another workflow to ensure path-filtering operations work correctly with git diff.

Suggested labels

area-workflows, github-actions

Suggested reviewers

  • rjmurillo

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title follows conventional commit format with 'fix(ci):' prefix and clearly describes the main change: removing path filters from the memory validation workflow.
Description check ✅ Passed Description explains the problem (phantom checks blocking PRs), the solution (remove path filters, keep internal change detection), and provides a test plan related to the changeset.
Linked Issues check ✅ Passed Changes directly address issue #341 objectives: restore workflow so the required check is created on all PRs, skip gracefully when no memory files changed, and unblock PR #334.
Out of Scope Changes check ✅ Passed All changes are within scope: removing path filters, fixing git diff handling with event-specific commit ranges, and keeping internal memory-change detection logic as specified in issue #341.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Address Copilot review comments:
1. Handle zero SHA when first commit on new branch
2. Detect force-push/rebase when before commit doesn't exist
3. Use two dots (..) for push events instead of three (...)
4. Add exit code check after git diff command

Fallback to origin/main comparison when:
- github.event.before is all zeros (first commit)
- before commit no longer exists (force-push/rebase)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rjmurillo-bot rjmurillo-bot merged commit fcc3eb5 into main Dec 24, 2025
28 of 29 checks passed
@rjmurillo-bot rjmurillo-bot deleted the fix/memory-validation-always-run branch December 24, 2025 09:23
rjmurillo-bot pushed a commit that referenced this pull request Dec 24, 2025
Retrospective of CI workflow debugging session that fixed phantom
required check blocking. Analyzed PR #342 (initial fix) and PR #343
(comprehensive edge case handling).

**Skills Extracted** (atomicity 88-95%):
- Skill-CI-Workflow-001: Required check + path filter anti-pattern (95%)
- Skill-CI-Workflow-002a: Zero SHA handling in git diff (95%)
- Skill-CI-Workflow-002b: Missing commit handling with cat-file (93%)
- Skill-CI-Workflow-002c: Git diff exit code validation (92%)
- Skill-CI-Workflow-003: Required check deployment testing (90%)
- Skill-Architecture-016: ADR compliance documentation (88%)
- Skill-Implementation-007: Fast iteration cycle pattern (92%)

**Key Learnings**:
- Path filters on required check workflows cause phantom blocking
- Internal skip logic preserves efficiency while ensuring status reports
- Git diff in workflows needs comprehensive edge case handling
- Fast iteration (<10min cycles) enabled 5 rounds in 20 minutes

**Memory Files Created**:
- ci-workflow-required-checks.md (5 skills)
- architecture-adr-compliance-documentation.md (1 skill)
- implementation-fast-iteration.md (1 skill)

**Related**: PR #342 (merged), PR #343 (pending merge)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rjmurillo pushed a commit that referenced this pull request Dec 24, 2025
…atus check (#346)

* fix(ci): remove path filters from memory validation workflow

The 'Validate Memory Files' job is a required status check. With path
filters at the workflow trigger level, the workflow doesn't run for
PRs that don't touch memory files, causing those PRs to be blocked.

Changes:
- Remove path filters from on.push and on.pull_request triggers
- Add comment explaining why path filters are not used
- Fix git diff to use event-specific commit ranges
- Properly split git diff output into array before filtering

The change detection logic inside the job still skips validation for
PRs that don't modify .serena/memories/** files.

Fixes PRs being blocked by phantom 'Validate Memory Files' check.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): add robust git diff handling for edge cases

Address Copilot review comments:
1. Handle zero SHA when first commit on new branch
2. Detect force-push/rebase when before commit doesn't exist
3. Use two dots (..) for push events instead of three (...)
4. Add exit code check after git diff command

Fallback to origin/main comparison when:
- github.event.before is all zeros (first commit)
- before commit no longer exists (force-push/rebase)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(retrospective): extract 7 atomic skills from PR #342 & #343

Retrospective of CI workflow debugging session that fixed phantom
required check blocking. Analyzed PR #342 (initial fix) and PR #343
(comprehensive edge case handling).

**Skills Extracted** (atomicity 88-95%):
- Skill-CI-Workflow-001: Required check + path filter anti-pattern (95%)
- Skill-CI-Workflow-002a: Zero SHA handling in git diff (95%)
- Skill-CI-Workflow-002b: Missing commit handling with cat-file (93%)
- Skill-CI-Workflow-002c: Git diff exit code validation (92%)
- Skill-CI-Workflow-003: Required check deployment testing (90%)
- Skill-Architecture-016: ADR compliance documentation (88%)
- Skill-Implementation-007: Fast iteration cycle pattern (92%)

**Key Learnings**:
- Path filters on required check workflows cause phantom blocking
- Internal skip logic preserves efficiency while ensuring status reports
- Git diff in workflows needs comprehensive edge case handling
- Fast iteration (<10min cycles) enabled 5 rounds in 20 minutes

**Memory Files Created**:
- ci-workflow-required-checks.md (5 skills)
- architecture-adr-compliance-documentation.md (1 skill)
- implementation-fast-iteration.md (1 skill)

**Related**: PR #342 (merged), PR #343 (pending merge)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): update session log with commit SHA

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
rjmurillo-bot added a commit that referenced this pull request Dec 24, 2025
* fix(ci): remove path filters from memory validation workflow

The 'Validate Memory Files' job is a required status check. With path
filters at the workflow trigger level, the workflow doesn't run for
PRs that don't touch memory files, causing those PRs to be blocked.

Changes:
- Remove path filters from on.push and on.pull_request triggers
- Add comment explaining why path filters are not used
- Fix git diff to use event-specific commit ranges
- Properly split git diff output into array before filtering

The change detection logic inside the job still skips validation for
PRs that don't modify .serena/memories/** files.

Fixes PRs being blocked by phantom 'Validate Memory Files' check.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): add robust git diff handling for edge cases

Address Copilot review comments:
1. Handle zero SHA when first commit on new branch
2. Detect force-push/rebase when before commit doesn't exist
3. Use two dots (..) for push events instead of three (...)
4. Add exit code check after git diff command

Fallback to origin/main comparison when:
- github.event.before is all zeros (first commit)
- before commit no longer exists (force-push/rebase)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
rjmurillo-bot added a commit that referenced this pull request Dec 24, 2025
…atus check (#346)

* fix(ci): remove path filters from memory validation workflow

The 'Validate Memory Files' job is a required status check. With path
filters at the workflow trigger level, the workflow doesn't run for
PRs that don't touch memory files, causing those PRs to be blocked.

Changes:
- Remove path filters from on.push and on.pull_request triggers
- Add comment explaining why path filters are not used
- Fix git diff to use event-specific commit ranges
- Properly split git diff output into array before filtering

The change detection logic inside the job still skips validation for
PRs that don't modify .serena/memories/** files.

Fixes PRs being blocked by phantom 'Validate Memory Files' check.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): add robust git diff handling for edge cases

Address Copilot review comments:
1. Handle zero SHA when first commit on new branch
2. Detect force-push/rebase when before commit doesn't exist
3. Use two dots (..) for push events instead of three (...)
4. Add exit code check after git diff command

Fallback to origin/main comparison when:
- github.event.before is all zeros (first commit)
- before commit no longer exists (force-push/rebase)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(retrospective): extract 7 atomic skills from PR #342 & #343

Retrospective of CI workflow debugging session that fixed phantom
required check blocking. Analyzed PR #342 (initial fix) and PR #343
(comprehensive edge case handling).

**Skills Extracted** (atomicity 88-95%):
- Skill-CI-Workflow-001: Required check + path filter anti-pattern (95%)
- Skill-CI-Workflow-002a: Zero SHA handling in git diff (95%)
- Skill-CI-Workflow-002b: Missing commit handling with cat-file (93%)
- Skill-CI-Workflow-002c: Git diff exit code validation (92%)
- Skill-CI-Workflow-003: Required check deployment testing (90%)
- Skill-Architecture-016: ADR compliance documentation (88%)
- Skill-Implementation-007: Fast iteration cycle pattern (92%)

**Key Learnings**:
- Path filters on required check workflows cause phantom blocking
- Internal skip logic preserves efficiency while ensuring status reports
- Git diff in workflows needs comprehensive edge case handling
- Fast iteration (<10min cycles) enabled 5 rounds in 20 minutes

**Memory Files Created**:
- ci-workflow-required-checks.md (5 skills)
- architecture-adr-compliance-documentation.md (1 skill)
- implementation-fast-iteration.md (1 skill)

**Related**: PR #342 (merged), PR #343 (pending merge)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): update session log with commit SHA

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-workflows GitHub Actions workflows bug Something isn't working github-actions GitHub Actions workflow updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): Required check 'Validate Memory Files' references non-existent workflow

3 participants