Conventional Commit Message Policy

Conventional Commit Message Policy

Code QualityNetspective Unified Process
 

All the Software developers of Netspective Communications LLC across all the projects must have a conventional commit format for all commits made to version control repositories.

Controls

Developers are required to follow a structured conventional commit format for all commits made to the version control repositories. [FII-CQI-050-CCP-01]

  • The commit format consists a header, an optional body, and an optional footer, as outlined below:
<type>(<scope>): <subject> [#ticketNumber]

[Optional body]

[Optional footer]

[FII-CQI-050-CCP-02]

  • Ensure to the commit header must be prefixed with a type, which consists of a noun (which listed in below table), followed by the OPTIONAL scope, and REQUIRED terminal colon and space. [FII-CQI-050-CCP-03]

  • It is optional to provide a longer commit body after the short description, providing additional contextual information about the code changes. [FII-CQI-050-CCP-04]

  • Ensure in the Type to describe the purpose or nature of the commit described below for any project.

    TypeDescriptionis Part of conventional commits?#
    featMust be used when a commit adds a new feature to your application or library.Yes
    fixMust be used when a commit represents a bug fix for your application.Yes
    choreMust be used when a commit is for a routine task.Yes
    buildMust be used when commits include application build-related changes.Yes
    ciMust be used when commits include continuous integration-related changes.Yes
    docsMust be used when commits involve updating documents.Yes
    perfMust be used when commits include performance-related updates.Yes
    refactorMust be used when commits involve code refactoring.Yes
    styleMust be used when commits include style-related updates.Yes
    testMust be used when commits include tests or test-related changes.Yes
    revertMust be used when reverting a previous commit.Yes
    feat-rfcMust be used when a commit adds RFCs, user stories, etc. for content sites or modules.No
    contentMust be used when a commit is related to original content, curated content, newsletters, etc.No
    qaMust be used when commits are related to testing, such as automation rules, test scripts, etc.No
    seoMust be used when commits are related to SEO, such as Google Tag Manager, monitoring dashboards, etc.No
    pmMust be used when a commit is related to OKR, BLUF, internal communication strategy, team member details, etc.No
    researchMust be used for commits related to work in progress (WIP) that is not yet ready for review.No
    designMust be used for commits related to design work.No
    draftMust be used for any work in progress (WIP) that is not yet ready for review.No
    securityMust be used when addressing security vulnerabilities or implementing security measures.No

    #isPartofconventionalcommits indicates whether the type is recommend by https://www.conventionalcommits.org website.

    [FII-CQI-050-CCP-05]

  • It is optional to provide a scope after a type. A scope must consist of a noun describing a section of the codebase surrounded by parenthesis, e.g., fix(parser) [FII-CQI-050-CCP-04]

  • In the subject provide a description that must immediately follow the colon and space after the type/scope prefix. [FII-CQI-050-CCP-05]

    • The description is a short summary of the code changes, for example- “fix: resolved parsing issue when spaces were contained in the string #12”
    • The maximum length of the description should be 50 characters.
    • The subject must end with the ticket number. If multiple tickets are involved, use the format [#ticketNumber1, #ticketNumber2].
    • Do not include a period at the end of the description.
  • It is optional to provide a [body] which Offers additional information, context, or details about the commit. [FII-CQI-050-CCP-06]

  • It is optional to provide a [footer] which includes references to related issues, tasks, or pull requests. [FII-CQI-050-CCP-07]

Evidence

Execute the below mergestat query in a CLI to identify the commits which is not keeping the controls properly.

mergestat 'SELECT MESSAGE , AUTHOR_NAME  FROM commits  WHERE NOT EXISTS (SELECT * FROM grep(commits.MESSAGE,\'^(feat|fix|chore|build|ci|docs|perf|refa
ctor|style|test|revert|feat-rfc|content|qa|seo|pm|research|design|draft|security)(\([a-zA-Z0-9-]+\))?: [A-Za-z0-9\s\-]+ (?:\[#\d+\]|\(#\d+\)|#\d+)\s*$(\n[A
-Za-z0-9\s\-]*)?\'))'

Approved by
Abdul Razak on August 25, 2023 |
Last Updated by
Abdul Razak PM on August 25, 2023