Skip to content

feat(ci): add advisory warnings for large PRs and generated artifacts#388

Open
CoderPrateek971 wants to merge 15 commits into
utksh1:mainfrom
CoderPrateek971:main
Open

feat(ci): add advisory warnings for large PRs and generated artifacts#388
CoderPrateek971 wants to merge 15 commits into
utksh1:mainfrom
CoderPrateek971:main

Conversation

@CoderPrateek971
Copy link
Copy Markdown

@CoderPrateek971 CoderPrateek971 commented May 28, 2026

Description

Large PRs with generated artifacts are hard to review. This PR adds a lightweight GitHub Actions workflow that warns contributors when a PR contains unusually large diffs or accidentally includes generated testing folders.

Approach

  • Added a new workflow .github/workflows/pr-advisory.yml that triggers on PR updates.
  • The script checks the github.event context for total lines and files changed.
  • It uses the native gh CLI to check file paths specifically for playwright-report/ and test-results/.
  • Uses GitHub Actions ::warning annotations and Step Summaries to make the warnings highly visible without digging through logs.
  • Advisory only: The script is designed to exit cleanly (exit 0), ensuring it does not fail CI builds, leaving the final decision to maintainers.
  • Updated CONTRIBUTING.md to document the threshold (50 files / 1000 lines) and explain how contributors can fix the artifact warning.

Linked Issues

Closes #120

Tests Run

  • Verified GitHub Actions workflow syntax and context variables
  • Confirmed minimal token permissions (pull-requests: read) are used

Notes

This change strictly improves the contributor and reviewer experience. It does not touch or affect the backend API or frontend React code.

@utksh1 utksh1 added area:ci CI, tooling, or automation work type:devops DevOps or infrastructure work category bonus label level:beginner 20 pts difficulty label for small beginner-friendly PRs labels May 28, 2026
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

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

Requesting changes. The PR-size advisory workflow is useful, but the PR also rewrites large parts of CONTRIBUTING.md with unrelated formatting churn. Please keep this PR focused on the workflow and minimal contributor guidance only; avoid broad markdown restyling unless it is part of a separate docs cleanup PR.

@CoderPrateek971
Copy link
Copy Markdown
Author

Thanks for the review @utksh1 . I’ve updated the PR to keep it focused only on the PR-size advisory workflow and removed the unrelated CONTRIBUTING.md formatting/restyling changes.

The workflow has also been cleaned up for readability while keeping the functionality unchanged.

@CoderPrateek971 CoderPrateek971 requested a review from utksh1 May 28, 2026 17:38
@utksh1
Copy link
Copy Markdown
Owner

utksh1 commented May 28, 2026

Thanks for following up. Clarifying the change request so it is actionable:

Why this is blocked:
Requesting changes. The PR-size advisory workflow is useful, but the PR also rewrites large parts of CONTRIBUTING.md with unrelated formatting churn. Please keep this PR focused on the workflow and minimal contributor guidance only; avoid broad markdown restyling unless it is part of a separate docs cleanup PR.

What to do next:

  • Fix the specific issues called out above.
  • Push the updated branch and make sure the relevant CI checks pass.
  • Reply here when ready for re-review.

Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

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

Re-reviewed after the update, but this is still not mergeable. The new .github/workflows/pr-size-warning.yml file is wrapped in Markdown code fences, so it is not valid workflow YAML, and CONTRIBUTING.md is still heavily reformatted beyond the PR-size advisory scope. Please remove the fences and keep docs changes minimal/focused.

@CoderPrateek971
Copy link
Copy Markdown
Author

Fixed!

Removed the Markdown code fences around the YAML file, and fully reverted CONTRIBUTING.md so that it uses the exact original layout and formatting. No more churn! Should be good to go. Ready for re-review.

@CoderPrateek971 CoderPrateek971 requested a review from utksh1 May 28, 2026 18:16
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

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

Re-reviewed latest state. The workflow YAML is no longer fenced, but CONTRIBUTING.md is still broadly reformatted and loses existing Markdown structure/code fences far beyond the PR-size advisory scope. Please restore CONTRIBUTING.md and limit this PR to the advisory workflow plus a small focused docs note if needed.

@CoderPrateek971
Copy link
Copy Markdown
Author

Thanks for the feedback! I've updated the PR to address the issues:

  1. Restored CONTRIBUTING.md: I reverted the file to its original state so no existing Markdown structures or code fences are lost.
  2. Scoped the docs change: Instead of a broad rewrite or appending loose text at the bottom, I only added a small, focused ### PR Size and Generated Artifacts subsection under the ## Pull Request Format section to explain the thresholds.
  3. Fixed Workflow Formatting: The pr-size-workflow.yml file is now cleanly isolated and properly formatted.

Let me know if this looks good to go!

@CoderPrateek971 CoderPrateek971 requested a review from utksh1 May 30, 2026 07:15
@utksh1
Copy link
Copy Markdown
Owner

utksh1 commented May 30, 2026

Re-reviewed after the latest push. Still blocked: CONTRIBUTING.md still needs to be restored/kept minimal so this PR remains focused on the PR-size advisory workflow and a small targeted docs note only.

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

Labels

area:ci CI, tooling, or automation work level:beginner 20 pts difficulty label for small beginner-friendly PRs type:devops DevOps or infrastructure work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] Add a lightweight PR size warning workflow

2 participants