chore(ci): add PR quality gate and improve PR template#4052
Open
bibhuti230185 wants to merge 1 commit intoeclipse-sw360:mainfrom
Open
chore(ci): add PR quality gate and improve PR template#4052bibhuti230185 wants to merge 1 commit intoeclipse-sw360:mainfrom
bibhuti230185 wants to merge 1 commit intoeclipse-sw360:mainfrom
Conversation
Signed-off-by: Bibhuti Bhusan Dash <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an automated PR Quality Gate workflow and rewrite the PR template to enforce type-specific quality evidence, AI disclosure accountability, and a 60% completeness scoring threshold. Also update the Copilot instructions to reflect the new PR standards.
Type of Change
feat— New featurefix— Bug fixrefactor— Code restructuring (no behavior change)test— Adding or updating testsdocs— Documentation onlychore— Build, CI, dependencies, cleanupbuild— Build system or Docker changesRelated Issue
Issue: N/A — This addresses a systemic quality gap observed across recent PRs: missing root cause analysis in bug fixes, missing architecture context in features, undisclosed AI usage, and no manual testing evidence. No single issue tracks this.
Suggest Reviewer
@GMishx
How To Test
mainand verify the template auto-populates with all type-specific sections (Bug Fix Details, Feature Details, Refactor Details), expanded checklist, and AI Disclosure fields.PR Quality Gateworkflow fails with hard errors listing missing sections.choretype (Summary, Type, Issue, How To Test, 4+ checklist items). Verify the workflow passes with ≥60% score.docsas type and leave type-specific sections empty. Verify no hard error for missing type-specific content (auto-pass).Checklist
Must:
mvn spotless:apply)AI Disclosure
Tool & model: GitHub Copilot (Claude 3.5 Sonnet) in VS Code agent mode
What AI generated vs. what you wrote/changed:
AI generated the initial drafts of all three files based on detailed requirements and iterative feedback. I designed the overall approach (type-specific sections, 60% scoring threshold, hard errors vs. soft warnings split, AI accountability fields), reviewed every line, adjusted the scoring weights, verified all GitHub Action SHAs against the repository's existing workflows, and manually cross-referenced the Harden Runner SHA and
actions/github-scriptSHA via GitHub Tags API.Your understanding of the changes (in your own words):
The PR template now forces contributors to provide evidence appropriate to their change type — bug fixes need root cause analysis, features need architecture explanation, refactors need no-behavior-change confirmation. The Quality Gate workflow parses the PR body with regex helpers, validates structural requirements (summary, type, issue, how-to-test), runs type-specific checks as soft warnings, enforces AI disclosure accountability as a hard error when the checkbox is checked but understanding is missing, and computes a weighted completeness score across 7 dimensions. PRs below 60% or with any hard errors are blocked via
core.setFailed(). Trivial types (docs/chore/build) get automatic credit for type-specific sections. The workflow uses the same hardening conventions as all existing SW360 workflows: SHA-pinned actions, step-security/harden-runner, least-privilege permissions, and PR concurrency groups.Edge cases you verified:
docs/chore/buildtype PRs without type-specific sections — auto-pass (15 pts) instead of penalizing trivial changestesttype PRs without "How To Test" — exempt since the tests themselves are the verificationBreaking Changes
None.
Additional Notes
.github/pull_request_template.md.github/workflows/pr_description_check.yml.github/instructions/git-commit.instructions.mdAfter merge: A repository admin should add
validate-pras a required status check in Settings → Branches →mainbranch protection rules to make the gate mandatory.