Skip to content

Enforce PR Title Convention & Description Requirements in CI/CD Pipeline #234

@phertyameen

Description

@phertyameen

Enforce PR Quality Standards via CI and Contributing Guidelines

Problem

Contributors are submitting pull requests with little to no context titles like "update" or descriptions that only say "Closes #22". This makes it difficult for maintainers to understand what a PR does at a glance, slows down reviews, and pollutes the project's commit history.

Expected Outcome

  • The CI pipeline should automatically reject PRs that do not meet a minimum quality bar, so maintainers are not the ones policing this manually.
  • PR titles should follow a consistent convention that produces a readable commit history.
  • PR descriptions should contain enough context for a maintainer to understand the change without having to read every line of code.
  • CONTRIBUTING.md should be updated to clearly communicate these expectations to contributors before they even open a PR, including the branching convention (feature/your-feature-name) required for PR submission.

What to Do

PRs with minimal descriptions like "Closes #22" make it hard for maintainers to understand changes at a glance. This issue proposes two changes:

1. Workflow Changes — Add PR Validation Job

Add a new job validate-pr to .github/workflows/ci-cd.yml before the existing build-and-deploy job. Do not touch any commented-out lines in the file.

Also update the build-and-deploy job to depend on validate-pr so a failing validation blocks the build:

  build-and-deploy:
    needs: validate-pr   # ← add this line
    runs-on: ubuntu-latest

2. Update CONTRIBUTING.md

Add (or update) the following sections in CONTRIBUTING.md:


Branch Naming Convention

All feature branches must follow this naming pattern before opening a PR:

feature/your-feature-name
fix/short-description
docs/what-you-documented

Examples:

  • feature/user-authentication
  • fix/null-pointer-login
  • docs/update-api-reference

PRs submitted from branches that do not follow this convention may be closed without review.


Pull Request Title

PR titles must follow the Conventional Commits format:

<type>: <short description (min 10 characters)>

Allowed types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert

Examples:

  • feat: add OAuth2 login support
  • fix: resolve crash on empty cart checkout
  • docs: update installation steps for Windows
  • Closes #22
  • fix: x
  • updates

The CI pipeline will automatically reject PRs that do not meet this format.

Pull Request Description

Every PR must include a meaningful description. A bare issue reference like Closes #22 is not acceptable as a full description.

Your PR body should answer:

  • What problem does this PR solve?
  • How did you solve it?
  • Any relevant context, screenshots, or testing notes?

PRs with fewer than 15 words in the description will be rejected by CI.

Acceptance Criteria

  • CI fails on any PR with a non-conforming title
  • CI fails on any PR with an empty or insufficiently descriptive body
  • CONTRIBUTING.md reflects the new requirements around PR titles, descriptions, and branch naming
  • Existing workflow behaviour (build, lint, test) is not affected

Notes

  • The existing .github/workflows/ci-cd.yml should be modified, not replaced
  • Do not alter any commented-out sections in the workflow file

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions