Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add convertional commit lint #5111

Merged
merged 1 commit into from
Mar 23, 2024

Conversation

shoothzj
Copy link
Member

@shoothzj shoothzj commented Mar 23, 2024

What's the purpose of this PR

introduce conventional commit in apolloconfig[1]. It will looks like[2]
image

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.

[1] https://www.conventionalcommits.org/en/v1.0.0/
[2] https://github.com/openGemini/opengemini-client-go/commits/main/

Summary by CodeRabbit

  • Chores
    • Updated commit message conventions to adhere to the conventional commits format and provided guidelines for addressing existing issues in commit messages.
    • Established a GitHub Actions workflow named "commit lint" to enforce commit message standards using the commitlint-github-action action.
    • Updated the version of the actions/checkout action from v2 to v4 in relevant GitHub Actions workflows.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 23, 2024
Copy link

coderabbitai bot commented Mar 23, 2024

Walkthrough

This update brings a new GitHub Actions workflow named "commit lint" to enforce commit message standards on pull requests to the main branch. By leveraging the commitlint-github-action, this workflow ensures consistency and clarity in commit messages, enhancing project management and historical tracking.

Changes

File Path Change Summary
.github/workflows/.../commit_lint.yml Sets up a workflow for linting commit messages on PRs.
.github/workflows/build.yml
.github/workflows/license.yml
Updated actions/checkout action from v2 to v4.
CONTRIBUTING.md Updated commit message conventions to adhere to conventional commits format and provided guidelines for addressing issues in commit messages.

Related issues

Poem

In the realm of code, where logic thrives,
A rabbit dances, ensuring our archives.
"Commit with grace," it whispers low,
History's tale in each line we sow.
🐇✨ Our changes speak, a story so grand,
With clarity and care, we shape the land.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Mar 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.30%. Comparing base (353f997) to head (f4cf51b).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5111   +/-   ##
=========================================
  Coverage     50.30%   50.30%           
  Complexity     2011     2011           
=========================================
  Files           388      388           
  Lines         12216    12216           
  Branches       1207     1207           
=========================================
  Hits           6145     6145           
  Misses         5708     5708           
  Partials        363      363           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e3cd67d and c592db5.
Files selected for processing (1)
  • .github/workflows/commit_lint.yml (1 hunks)
Additional comments: 1
.github/workflows/commit_lint.yml (1)
  • 1-12: The workflow configuration looks good and is well-structured for the purpose of linting commit messages according to the conventional commit guidelines. It correctly triggers on pull requests to the main branch and includes appropriate steps for checking out the code and running the commit linting action. Great job on setting this up!

@nobodyiam
Copy link
Member

This looks good, would you please also help to update the CONTRIBUTING.md accordingly?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e3cd67d and 22f0145.
Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/commit_lint.yml (1 hunks)
  • .github/workflows/license.yml (1 hunks)
  • CONTRIBUTING.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/commit_lint.yml
Additional comments: 4
.github/workflows/license.yml (1)
  • 31-31: The update of actions/checkout to v4 is a good practice for taking advantage of the latest features and security improvements. Ensure that there are no breaking changes between v2 and v4 that could affect the workflow.
.github/workflows/build.yml (1)
  • 34-34: The update of actions/checkout to v4 is recommended to leverage the latest features and improvements. Please ensure compatibility with the workflow and that there are no breaking changes affecting the build process.
CONTRIBUTING.md (2)
  • 35-35: Introducing guidelines for conventional commits is a great improvement. Consider adding examples of conventional commit messages to provide clear models for contributors.
  • 37-37: Providing guidelines for commit messages that address existing issues is beneficial for project tracking. Ensure that the instructions are clear and easy to follow for contributors.

Signed-off-by: ZhangJian He <shoothzj@gmail.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 353f997 and f4cf51b.
Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/commit_lint.yml (1 hunks)
  • .github/workflows/license.yml (1 hunks)
  • CONTRIBUTING.md (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/build.yml
  • .github/workflows/commit_lint.yml
  • .github/workflows/license.yml
Additional comments: 3
CONTRIBUTING.md (3)
  • 32-37: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [17-17]

The term "Javadocs" is correctly spelled, but consider clarifying its usage if it's not widely understood among potential contributors.

  • 32-37: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [28-28]

The term "fixup" is correctly used in the context of Git commands. No change is necessary.

  • 35-37: The addition of conventional commit guidelines is a positive change. Ensure that the link to Conventional Commits is accessible and that the guidelines are clear and easy to follow for contributors.

Comment on lines 32 to +37
* `git checkout -b <some-branch-name> <remote>/master`
* `git merge --squash <current-feature-branch>`

* When writing a commit message please follow these conventions: if you are fixing an existing issue, please add Fixes #XXX at the end of the commit message (where XXX is the issue number).
* For commits, we adhere to the conventional commits format. For more details, refer to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

* When crafting commit messages, please adhere to the following conventions: if your commit addresses an existing issue, append "Fixes #XXX" to the end of the commit message (where XXX is the issue number).
Copy link

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [3-3]

Consider adding a comma for clarity: "...contribute even something trivial, please do not hesitate..."

- If you want to contribute even something trivial please do not hesitate
+ If you want to contribute even something trivial, please do not hesitate

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [7-7]

A comma might improve readability: "...non-trivial patch or pull request, we will need you to sign..."

- Before we accept a non-trivial patch or pull request we will need you to sign
+ Before we accept a non-trivial patch or pull request, we will need you to sign

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 23, 2024
@nobodyiam nobodyiam merged commit c255389 into apolloconfig:master Mar 23, 2024
12 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2024
@nobodyiam nobodyiam added this to the 2.3.0 milestone Apr 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants