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: Adds auto-labels for PR and changelog releaser #8

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

bendoerr
Copy link
Member

@bendoerr bendoerr commented Aug 22, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a structured changelog management system for improved clarity of updates.
    • Enhanced automated labeling of pull requests based on branch naming conventions.
    • Added a GitHub Actions workflow to automate the release process, including changelog generation.
  • Bug Fixes

    • Improved permissions for dependency review actions to enhance functionality.
  • Chores

    • Implemented a new workflow for auto-labeling pull requests to streamline management.

Copy link
Contributor

coderabbitai bot commented Aug 22, 2024

Walkthrough

The changes introduce structured management of changelogs, automated labeling of pull requests, and enhanced release workflows in a GitHub repository. This includes new configuration files for changelogs and labeling, as well as modifications to GitHub Actions workflows for dependency review and release management, ensuring better organization and automation of repository processes.

Changes

File Path Change Summary
.github/changelog.json New structured format for managing changelogs with categories and template.
.github/labeler.yml New configuration to automate pull request labeling based on branch name patterns.
.github/workflows/dependency-review.yml Modified permissions for the dependency review job and added a parameter for summary comments in PRs.
.github/workflows/pr-label.yml New workflow for automatic labeling of pull requests on events.
.github/workflows/release.yml New workflow for automating releases upon tagging, including changelog generation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub
    participant Actions
    participant Release
    participant Changelog

    User->>GitHub: Push Tag (v*.*.*)
    GitHub->>Actions: Trigger Release Workflow
    Actions->>Changelog: Generate Changelog
    Changelog-->>Actions: Return Changelog
    Actions->>Release: Create GitHub Release
    Release-->>GitHub: Publish Release with Changelog
Loading

🐇 Hop along, a changelog bright,
Labels flowing, what a sight!
Releases spring with joyous cheer,
Automation makes it crystal clear!
In this burrow, we thrive and play,
Code and bunnies, hip-hip-hooray! 🎉


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

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

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

deepsource-io bot commented Aug 22, 2024

Here's the code health analysis summary for commits 37af06b..fadb493. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗
DeepSource Terraform LogoTerraform✅ SuccessView Check ↗
DeepSource Go LogoGo✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/labeler 8558fd74291d67161a8a78ce36a881fa63b766a9 🟢 5.6
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
Security-Policy🟢 9security policy file detected
SAST🟢 7SAST tool is not run on all commits -- score normalized to 7
Vulnerabilities🟢 73 existing vulnerabilities detected
actions/step-security/harden-runner 5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde 🟢 8.8
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
CI-Tests🟢 1014 out of 14 merged PRs checked by a CI test -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Code-Review🟢 10all changesets reviewed
Contributors🟢 6project has 2 contributing companies or organizations -- score normalized to 6
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Dependency-Update-Tool🟢 10update tool detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Maintained🟢 1030 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 7dependency not pinned by hash detected -- score normalized to 7
SAST🟢 9SAST tool detected but not run on all commits
Security-Policy🟢 10security policy file detected
Signed-Releases⚠️ -1no releases found
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Vulnerabilities🟢 100 existing vulnerabilities detected
actions/actions/checkout 692973e3d937129bcbf40652eb9f2f61becf3332 🟢 6.9
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 45 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies🟢 4dependency not pinned by hash detected -- score normalized to 4
Security-Policy🟢 9security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Vulnerabilities🟢 91 existing vulnerabilities detected
actions/mikepenz/release-changelog-builder-action f3fc77b47b74e78971fffecb2102ae6eac9a44d6 🟢 6.4
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 8 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 2Found 3/11 approved changesets -- score normalized to 2
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Security-Policy🟢 10security policy file detected
Binary-Artifacts🟢 10no binaries found in the repo
Packaging⚠️ -1packaging workflow not detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
SAST🟢 9SAST tool detected but not run on all commits
Vulnerabilities🟢 100 existing vulnerabilities detected
actions/softprops/action-gh-release c062e08bd532815e2082a85e87e3ef29c3e6d191 🟢 5.1
Details
CheckScoreReason
Code-Review⚠️ 1Found 2/15 approved changesets -- score normalized to 1
Maintained🟢 1030 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Pinned-Dependencies🟢 10all dependencies are pinned
Fuzzing⚠️ 0project is not fuzzed
Security-Policy⚠️ 0security policy file not detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities🟢 100 existing vulnerabilities detected
actions/step-security/harden-runner 5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde 🟢 8.8
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
CI-Tests🟢 1014 out of 14 merged PRs checked by a CI test -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Code-Review🟢 10all changesets reviewed
Contributors🟢 6project has 2 contributing companies or organizations -- score normalized to 6
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Dependency-Update-Tool🟢 10update tool detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Maintained🟢 1030 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 7dependency not pinned by hash detected -- score normalized to 7
SAST🟢 9SAST tool detected but not run on all commits
Security-Policy🟢 10security policy file detected
Signed-Releases⚠️ -1no releases found
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Vulnerabilities🟢 100 existing vulnerabilities detected

Scanned Manifest Files

.github/workflows/pr-label.yml
.github/workflows/release.yml

@github-actions github-actions bot added the cicd Adjustments to the CI/CD/Action Workflows label Aug 22, 2024
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: ASSERTIVE

Commits

Files that changed from the base of the PR and between 37af06b and fadb493.

Files selected for processing (5)
  • .github/changelog.json (1 hunks)
  • .github/labeler.yml (1 hunks)
  • .github/workflows/dependency-review.yml (2 hunks)
  • .github/workflows/pr-label.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
Additional comments not posted (9)
.github/labeler.yml (1)

1-11: LGTM! Configuration for automatic PR labeling is well-structured.

The file defines clear rules for labeling pull requests based on branch name patterns. This should help in organizing PRs efficiently.

.github/workflows/pr-label.yml (1)

1-22: LGTM! Workflow for labeling PRs is well-defined.

The workflow is structured to label pull requests using secure and efficient practices. The use of step-security/harden-runner enhances security, and actions/labeler is correctly utilized for labeling.

.github/changelog.json (1)

1-25: LGTM! Changelog configuration is comprehensive and clear.

The categories and template are well-defined, ensuring organized and informative changelogs.

.github/workflows/release.yml (4)

8-10: Ensure minimal permissions for security.

The contents: read permission is set at the workflow level. Consider minimizing permissions to only what's necessary for each job.

Verify if reducing permissions at the job level affects the workflow. If not, adjust permissions accordingly.


15-18: Review permissions for the release job.

The release job has write permissions for contents, pull-requests, and deployments. Ensure these permissions are necessary for the release process.

Verify if all these permissions are required for the release job. If not, adjust permissions to follow the principle of least privilege.


34-37: Ensure release conditions are correct.

The action-gh-release step is conditioned to run only if the reference starts with refs/tags/. Ensure this condition aligns with your release strategy.

Verify if the condition startsWith(github.ref, 'refs/tags/') aligns with your release strategy.


27-33: Check changelog configuration.

The release-changelog-builder-action uses a configuration file .github/changelog.json. Ensure this file is correctly set up and includes all necessary configurations.

Verify the existence and correctness of .github/changelog.json.

.github/workflows/dependency-review.yml (2)

18-20: Review permissions for the dependency-review job.

The dependency-review job has read permissions for contents and write permissions for pull-requests. Ensure these permissions are necessary for the dependency review process.

Verify if all these permissions are required for the dependency-review job. If not, adjust permissions to follow the principle of least privilege.


31-32: Verify the new parameter for dependency review action.

The comment-summary-in-pr parameter is set to always. Ensure this setting aligns with your workflow requirements for providing feedback in pull requests.

Verify if the comment-summary-in-pr: always setting aligns with your workflow requirements.

@bendoerr bendoerr merged commit 82c4ad8 into main Aug 22, 2024
17 checks passed
@bendoerr bendoerr deleted the ci/add-release branch August 22, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cicd Adjustments to the CI/CD/Action Workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant