Skip to content

fix: Resolve changelog check failures on large PRs#1782

Merged
aknysh merged 2 commits intomainfrom
osterman/changelog-fix
Nov 11, 2025
Merged

fix: Resolve changelog check failures on large PRs#1782
aknysh merged 2 commits intomainfrom
osterman/changelog-fix

Conversation

@osterman
Copy link
Member

@osterman osterman commented Nov 11, 2025

Summary

Replace GitHub's diff API with local git diff to avoid API limitations that cause changelog check failures on large PRs. GitHub's diff API has hard limits (~300 files or ~3000 lines), but using local git diff with base/head SHAs works reliably for any PR size.

Test Plan

  • Changelog check should pass on large PRs
  • Changelog check should still work on normal-sized PRs
  • Blog post detection logic unchanged

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Optimized changelog verification workflow to more reliably detect blog file changes in pull requests while reducing dependency on external API limitations.

Replace GitHub's diff API with local git diff to avoid API limitations.
GitHub's diff API has hard limits (~300 files or ~3000 lines) that cause
failures on large PRs. Using git diff with base/head SHAs works reliably
for any PR size without API constraints.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@osterman osterman requested a review from a team as a code owner November 11, 2025 04:10
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 11, 2025

📝 Walkthrough

Walkthrough

This PR updates .github/workflows/changelog-check.yml to detect changed blog files using git diff with BASE_REF and HEAD_REF instead of the gh pr diff command. The logic and filtering remain consistent; only the detection mechanism changes.

Changes

Cohort / File(s) Summary
Workflow blog-file detection
\.github/workflows/changelog-check.yml``
Replaced gh pr diff with git diff for determining changed blog files; added BASE_REF and HEAD_REF extraction from PR data; updated file-change queries to filter for website/blog/*.md or *.mdx and exclude tags.yml; added debug echo for diff range; applied same approach to both NEW_BLOG_FILES and BLOG_FILES retrievals.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Focus on verifying that BASE_REF and HEAD_REF extraction logic is correct and aligned with GitHub Actions PR context
  • Confirm the git diff filters (path patterns and exclusions) match the intended behavior

Possibly related PRs

Suggested labels

patch

Pre-merge checks and finishing touches

✅ 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: fixing changelog check failures on large PRs by replacing the GitHub diff API with git diff.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/changelog-fix

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.

@github-actions github-actions bot added the size/s Small size PR label Nov 11, 2025
@mergify
Copy link

mergify bot commented Nov 11, 2025

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label Nov 11, 2025
@github-actions
Copy link

github-actions bot commented Nov 11, 2025

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.76%. Comparing base (7efc759) to head (009d921).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1782      +/-   ##
==========================================
+ Coverage   70.74%   70.76%   +0.02%     
==========================================
  Files         432      432              
  Lines       39916    39916              
==========================================
+ Hits        28238    28246       +8     
+ Misses       9275     9268       -7     
+ Partials     2403     2402       -1     
Flag Coverage Δ
unittests 70.76% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osterman osterman added the no-release Do not create a new release (wait for additional code changes) label Nov 11, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/changelog-check.yml (2)

47-54: Solid fix for API limitations using local git diff.

The switch to git diff with commit SHAs bypasses GitHub's API constraints effectively. The pattern ^website/blog/.*\.(md|mdx)$ correctly captures blog files, and the explanatory comments (lines 50–52) are helpful for future maintainers.

One minor note: the grep -v 'tags.yml' is redundant since the preceding grep already filters for .md|.mdx extensions. You can drop it for clarity, but it's harmless as-is.

- NEW_BLOG_FILES=$(git diff --name-only "$BASE_REF" "$HEAD_REF" | grep -E '^website/blog/.*\.(md|mdx)$' | grep -v 'tags.yml' || true)
+ NEW_BLOG_FILES=$(git diff --name-only "$BASE_REF" "$HEAD_REF" | grep -E '^website/blog/.*\.(md|mdx)$' || true)

101-105: Consistent application of git diff approach in success message step.

The same pattern is correctly applied here. However, BASE_REF and HEAD_REF are extracted twice (lines 47–48 and 101–102). Consider moving these to a common step to reduce duplication and make future updates easier.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7efc759 and 009d921.

📒 Files selected for processing (1)
  • .github/workflows/changelog-check.yml (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build (macos)
  • GitHub Check: Build (windows)
  • GitHub Check: autofix
  • GitHub Check: Analyze (go)
  • GitHub Check: Run pre-commit hooks
  • GitHub Check: Lint (golangci)
  • GitHub Check: Review Dependency Licenses
  • GitHub Check: Summary

@aknysh aknysh merged commit c7fa891 into main Nov 11, 2025
53 checks passed
@aknysh aknysh deleted the osterman/changelog-fix branch November 11, 2025 18:33
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Nov 11, 2025
aknysh added a commit that referenced this pull request Nov 11, 2025
Resolved snapshot conflicts by taking main's version. User will regenerate
snapshots as needed for ai-1 branch changes.

Merged changes from main:
- feat: add error handling infrastructure with context-aware capabilities (#1763)
- fix: Resolve changelog check failures on large PRs (#1782)
- Refine homepage hero and typing animation (#1781)
- fix: Reduce log spam for imports outside base directory (#1780)
- feat: Add custom sanitization map to test CLI for test-specific output rules (#1779)

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

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

These changes were released in v1.199.0-rc.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Do not create a new release (wait for additional code changes) size/s Small size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants