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

feat: Add GitHub PR Checks Workflow #545

Merged
merged 10 commits into from
Sep 19, 2024
Merged

Conversation

abhishek1234321
Copy link
Contributor

@abhishek1234321 abhishek1234321 commented Aug 13, 2024

https://app.clickup.com/

Summary by CodeRabbit

  • New Features
    • Introduced pull request checks to enforce format for titles and mandatory inclusion of ClickUp links in descriptions.
    • Added a new GitHub Actions workflow to automate the enforcement of PR checks.
  • Bug Fixes
    • Improved consistency and quality of PR submissions through standardized checks.

Copy link
Contributor

coderabbitai bot commented Aug 13, 2024

Warning

Rate limit exceeded

@shubham-fyle has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 29 minutes and 33 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between febb61b and dcd7664.

Walkthrough

This update introduces new checks for pull requests within the GitHub Actions framework. It establishes two primary requirements: PR titles must begin with specific prefixes, and descriptions must include a link to ClickUp. These changes aim to standardize the format of contributions and ensure relevant task references are provided, enhancing the overall clarity and organization of pull requests.

Changes

File Path Change Summary
.github/pr-checks-config.yml New pr_checks section added with prefix_check for title formatting and clickup_check for description link verification.
.github/workflows/pr-checks.yml New workflow named Strong PR Checks introduced to enforce checks on PRs during specific events.

Poem

In the meadow, we hop with glee,
New checks for PRs, oh so free!
Titles that start with a prefix bright,
Descriptions with links that shine so right.
Hooray for the rules that guide our way,
Hoppy coding, come what may! 🐰✨


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>, please review it.
    -- Generate unit testing code 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 testing code 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Tests Skipped Failures Errors Time
264 0 💤 0 ❌ 0 🔥 36.151s ⏱️

Copy link
Contributor

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 715f85b and b6de79a.

Files selected for processing (1)
  • .github/workflows/pr_checks_config.yaml (1 hunks)
Additional comments not posted (2)
.github/workflows/pr_checks_config.yaml (2)

2-5: LGTM! Title check configuration is well-defined.

The regex pattern correctly enforces the required prefixes for PR titles, and the message provides clear guidance to contributors.


7-10: LGTM! Description check configuration is well-defined.

The regex pattern effectively ensures that a ClickUp link is included in the PR description, and the message provides clear instructions.

Copy link

Tests Skipped Failures Errors Time
264 0 💤 0 ❌ 0 🔥 39.724s ⏱️

Copy link
Contributor

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b6de79a and 049a8ac.

Files selected for processing (1)
  • .github/workflows/pr_checks_config.yaml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/pr_checks_config.yaml

@ashwin1111
Copy link
Contributor

will wait for clickup removal - removing request for now

@ashwin1111 ashwin1111 removed their request for review August 19, 2024 06:29
Copy link

Tests Skipped Failures Errors Time
265 0 💤 0 ❌ 0 🔥 37.683s ⏱️

Copy link

Tests Skipped Failures Errors Time
277 0 💤 0 ❌ 0 🔥 38.721s ⏱️

Copy link
Contributor

@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.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 049a8ac and febb61b.

Files selected for processing (2)
  • .github/pr-checks-config.yml (1 hunks)
  • .github/workflows/pr-checks.yml (1 hunks)
Additional comments not posted (4)
.github/pr-checks-config.yml (1)

3-5: LGTM!

The prefix_check configuration is well-defined and enforces a consistent format for PR titles. The regex pattern correctly matches the required prefixes in a case-insensitive manner, and the message clearly communicates the expected format if the title does not match.

.github/workflows/pr-checks.yml (3)

2-6: LGTM!

The workflow name "Strong PR Checks" accurately reflects the purpose of introducing automated checks for pull requests. Triggering the workflow on pull request events (opened, synchronized, and edited) ensures that the checks are run at the appropriate times during the pull request lifecycle.


8-10: Workflow permissions look good.

The workflow grants the necessary permissions:

  • Write permission for pull-requests allows the workflow to add comments or labels to the pull request.
  • Read permission for contents enables the workflow to access the repository files, which is required for running the checks.

12-20: The job configuration looks good.

  • Running the job on the latest version of Ubuntu ensures a stable and up-to-date environment.
  • Using the fylein/fyle-pr-action@v1 action allows for the execution of strong checks on the pull request.
  • Providing the GitHub token from the repository's secrets ensures secure access to the necessary API endpoints.
  • Specifying the configuration file (.github/pr-checks-config.yml) allows for customization of the checks based on the project's requirements.

Please ensure that the specified configuration file (.github/pr-checks-config.yml) exists in the repository. You can use the following script to verify its existence:

Verification successful

Configuration file verified and job setup confirmed

The verification process has confirmed that the configuration file .github/pr-checks-config.yml exists in the repository. This validates that the job configuration in the PR-checks workflow is correctly referencing an existing file, ensuring that the strong checks can be executed as intended.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the configuration file.

# Test: Check if the configuration file exists. Expect: File found.
if [ -f ".github/pr-checks-config.yml" ]; then
  echo "Configuration file found: .github/pr-checks-config.yml"
else
  echo "Configuration file not found: .github/pr-checks-config.yml"
  exit 1
fi

Length of output: 160

Comment on lines 8 to 10
- name: 'clickup_check'
regex: '(?i)app.clickup.com'
message_if_not_matching: 'PR description must contain a link to a ClickUp (case-insensitive)'
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider the impact of mandating ClickUp links in PR descriptions.

The clickup_check configuration enforces the inclusion of a ClickUp link in PR descriptions, which aims to ensure that relevant task references are provided. However, as raised by a user in the comments, this requirement may create friction for contributors who do not use or have access to ClickUp.

While providing task references is valuable for context and traceability, mandating the use of a specific tool may limit flexibility and potentially discourage contributions. Consider the following alternatives:

  1. Allow for more generic task reference formats, such as "Resolves: TASK-123" or "Related to: ISSUE-456", without specifying the tool.
  2. Provide clear guidelines for task referencing in the PR template or contributing guidelines, but make it optional rather than a strict requirement.
  3. Encourage the use of ClickUp or other task management tools through documentation and onboarding materials, but avoid enforcing it through automated checks.

By adopting a more inclusive approach, you can still promote the inclusion of relevant task references while accommodating a wider range of contributors and their preferred workflows.

Copy link

Tests Skipped Failures Errors Time
277 0 💤 0 ❌ 0 🔥 41.758s ⏱️

@abhishek1234321 abhishek1234321 merged commit 75c9a25 into master Sep 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants