|
| 1 | +# Pull Request (PR) Rules - The Herald Bot |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +The **DevSec Blueprint (DSB)** community is dedicated to educating members about **DevSecOps** principles, tools, and best practices. As part of our commitment to maintaining high-quality software development, **The Herald** Discord bot follows structured **Pull Request (PR) guidelines** to ensure clarity, maintainability, and consistency across contributions. |
| 6 | + |
| 7 | +This document outlines the **Conventional Commits** specification for PR titles, ensuring that contributions align with **best DevSecOps practices**, facilitate automated release generation, and maintain a structured commit history. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## PR Title Formatting |
| 12 | + |
| 13 | +Every **non-draft PR** must follow the **Conventional Commits** specification for PR titles. This ensures: |
| 14 | + |
| 15 | +- **Consistent and readable commit history** |
| 16 | +- **Automatic generation of release notes** |
| 17 | +- **Avoidance of merge conflicts in release documentation** |
| 18 | + |
| 19 | +### PR Title Format |
| 20 | + |
| 21 | +A PR title should follow this structure: |
| 22 | + |
| 23 | +``` |
| 24 | +<type>([optional scope]): <description> |
| 25 | +``` |
| 26 | + |
| 27 | +Where: |
| 28 | + |
| 29 | +- **`<type>`** – Defines the nature of the change (see **Types** below) |
| 30 | +- **`[optional scope]`** – Provides additional context (optional but recommended) |
| 31 | +- **`<description>`** – Brief and meaningful description of the change |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## PR Types |
| 36 | + |
| 37 | +Each PR must fall under one of the following types: |
| 38 | + |
| 39 | +| Type | Description | |
| 40 | +| ------------ | ------------------------------------------------------------------------------------------ | |
| 41 | +| **feat** | Introduces a new feature for The Herald bot | |
| 42 | +| **fix** | Resolves a bug or issue in the bot’s code | |
| 43 | +| **chore** | Non-code changes, such as documentation updates, manual release notes, or repo maintenance | |
| 44 | +| **docs** | Updates to documentation, including README or wiki pages | |
| 45 | +| **build** | Changes to build scripts or dependency updates | |
| 46 | +| **ci** | Modifications to CI/CD pipelines, such as GitHub Actions | |
| 47 | +| **refactor** | Code refactoring without functional changes | |
| 48 | +| **style** | Formatting, whitespace, or stylistic changes that don’t alter logic | |
| 49 | +| **test** | Adding or updating tests | |
| 50 | +| **perf** | Performance improvements (unlikely to be common for The Herald) | |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## Examples |
| 55 | + |
| 56 | +| PR Title | Description | |
| 57 | +| --------------------------------------------------------------------- | ------------------------------------------------------------- | |
| 58 | +| `feat(bot): Add role-based access control` | Introduces role-based access control (RBAC) to The Herald bot | |
| 59 | +| `fix(auth): Resolve incorrect token expiration handling` | Fixes a bug where tokens were expiring prematurely | |
| 60 | +| `ci(workflows): Update deployment pipeline to include security scans` | Enhances CI/CD pipeline with security checks | |
| 61 | +| `docs(readme): Add setup guide for contributors` | Improves documentation for new contributors | |
| 62 | +| `test(commands): Add unit tests for moderation commands` | Adds missing tests for bot moderation features | |
| 63 | +| `chore: Release v1.2.0` | Manual release note update for version 1.2.0 | |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## Additional Guidelines |
| 68 | + |
| 69 | +- **Scope (optional but encouraged):** Use it when it provides meaningful context (e.g., `feat(bot): ...` instead of just `feat: ...`). |
| 70 | +- **Keep descriptions clear and concise:** Avoid unnecessary details in the title; add further context in the PR description. |
| 71 | +- **Follow best security practices:** Any security-related PRs should be labeled accordingly and reviewed carefully before merging. |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## Why This Matters |
| 76 | + |
| 77 | +By following this **PR title convention**, contributors to **The Herald** help: |
| 78 | + |
| 79 | +✅ Maintain a **structured and meaningful commit history** |
| 80 | +✅ Enable **automated changelogs** and **release note generation** |
| 81 | +✅ Improve **code review efficiency** for the **DSB** community |
| 82 | + |
| 83 | +Thank you for contributing to **The Herald** and supporting **DevSecOps education!** 🚀 |
| 84 | + |
| 85 | +--- |
| 86 | + |
0 commit comments