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(ci): create file sync and auto merge bot workflows #29

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

MSevey
Copy link
Contributor

@MSevey MSevey commented Dec 3, 2024

Overview

Closes #20
Closes #15

This PR add 2 key features.

  1. File Sync
  2. Auto merge bot PRs

File Sync

The File Sync action will sync key files from this repository to all repos listed in the .github/sync.yml config file. This allows use to manage changes to common files like dependabot.yml and other simple workflow files in a single place.

On merge, the RollkitBot will create PRs for any diffs in the repos from the config file.

Auto merge bot PRs

The auto merge bot action will auto approve and merge dependabot PRs (as long as the CI passes).

Additionally, since the file sync action will be creating RollkitBot PRs, the auto approve action can approve and merge those as well.

Copy link

coderabbitai bot commented Dec 3, 2024

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

The pull request introduces several changes to GitHub configuration files within the .github directory. It updates the reviewer assignment mechanism in auto_request_review.yml, adds a new Dependabot configuration template in dependabot.njk, and modifies the existing Dependabot settings in dependabot.yml. Additionally, it introduces multiple GitHub Actions workflows for automating pull request approvals, semantic versioning, and file synchronization. These changes collectively enhance the automation and management of dependencies and workflows across multiple repositories in the Rollkit organization.

Changes

File Path Change Summary
.github/auto_request_review.yml - Updated default reviewer from MSevey to rollkit.
- Added reviewer group rollkit with team core.
- Increased number_of_reviewers from 2 to 3.
- Added WIP to ignored keywords.
.github/dependabot.njk - Added new configuration file for Dependabot with dynamic template for dependencies.
.github/dependabot.yml - Removed npm package ecosystem configuration.
.github/sync.yml - Added configuration for Dependabot across multiple repositories with specified source and destination files.
- Introduced grouping for common workflow files.
.github/workflows/approve_merge_bots.yml - Added new workflow for automating PR approvals and merges for dependabot and rollkitbot.
.github/workflows/semantic_pull_request.yml - Added new workflow for semantic pull request validation triggered on PR events.
.github/workflows/semantic_release.yml - Added new workflow for semantic release triggered on pushes to the main branch.
.github/workflows/sync.yml - Added new workflow for file synchronization triggered on pushes to the main branch and manually.

Possibly related PRs

  • chore(ci): add semantic PR and release workflows #17: The changes in this PR involve the introduction of a semantic pull request workflow, which is relevant to the main PR's updates to the reviewer assignment mechanism, as both aim to enhance the CI processes within the GitHub workflows.
  • build(deps): add dependabot #19: This PR adds a Dependabot configuration, which is related to the main PR's updates in the .github directory, indicating a broader effort to improve automation and management within the repository's configuration files.

Suggested reviewers

  • gupadhyaya
  • Manav-Aggarwal
  • tzdybal
  • yarikbratashchuk

🐰 In the garden, changes bloom,
Reviewers gather, dispelling gloom.
With workflows bright and bots that cheer,
Dependencies managed, no need to fear.
Rollkit hops, in sync we play,
Automate the tasks, 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>, 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.

@MSevey MSevey changed the title WIP: file sync feat(ci): create file sync and auto merge bot workflows Dec 3, 2024
@MSevey MSevey marked this pull request as ready for review December 3, 2024 03:01
@MSevey MSevey self-assigned this Dec 3, 2024
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.

Actionable comments posted: 4

🧹 Outside diff range and nitpick comments (4)
.github/auto_request_review.yml (1)

17-17: Consider if 3 reviewers is optimal for your workflow

Setting number_of_reviewers: 3 might introduce delays in the PR review process. Consider if this high number of required reviewers aligns with your team's size and review practices.

.github/workflows/semantic_release.yml (1)

Line range hint 15-18: Consider committing .releaserc.json instead of generating it dynamically

While the current approach works, dynamically generating .releaserc.json makes the configuration less visible and harder to review. Consider committing this file to the repository instead.

- run: echo '{"branches":[],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/github"]}' > .releaserc.json
+ uses: actions/checkout@v4

Then create a .releaserc.json file in the repository.

.github/sync.yml (2)

1-81: Consider standardizing ecosystem ordering across repositories

The ordering of ecosystems varies between repositories. Consider standardizing the order (e.g., gomod, docker, github-actions, npm) for better maintainability.

Example standardized order:

      deps: [
+       {ecosystem: "gomod"},
+       {ecosystem: "docker"},
+       {ecosystem: "github-actions"},
+       {ecosystem: "npm"}
      ]

1-105: Consider adding documentation for the sync configuration

The file would benefit from documentation explaining:

  • The purpose of the file sync mechanism
  • How the template system works
  • When and how the sync occurs
  • How to add new repositories or workflows

Add a comment block at the top of the file:

+# File Sync Configuration
+# ----------------------
+# This configuration manages file synchronization across Rollkit repositories.
+# 
+# Structure:
+# 1. Individual repository settings for Dependabot configuration
+#    - Uses dependabot.njk template to generate dependabot.yml
+#    - Customized per repository based on required dependency ecosystems
+#
+# 2. Group settings for shared workflow files
+#    - Maintains consistency of CI/CD workflows across repositories
+#    - Automatically syncs changes to all listed repositories
+
 # Use individual repo settings for files that differ
 rollkit/.github:
   - source: .github/dependabot.njk
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5c79fab and ef76b7d.

📒 Files selected for processing (8)
  • .github/auto_request_review.yml (1 hunks)
  • .github/dependabot.njk (1 hunks)
  • .github/dependabot.yml (0 hunks)
  • .github/sync.yml (1 hunks)
  • .github/workflows/approve_merge_bots.yml (1 hunks)
  • .github/workflows/semantic_pull_request.yml (1 hunks)
  • .github/workflows/semantic_release.yml (1 hunks)
  • .github/workflows/sync.yml (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/dependabot.yml
✅ Files skipped from review due to trivial changes (3)
  • .github/workflows/semantic_pull_request.yml
  • .github/dependabot.njk
  • .github/workflows/sync.yml
🔇 Additional comments (5)
.github/workflows/semantic_release.yml (1)

Line range hint 19-24: Verify branch protection rules for secure releases

The semantic release workflow runs on pushes to main. Ensure that appropriate branch protection rules are in place to prevent unauthorized releases.

.github/workflows/approve_merge_bots.yml (1)

49-56: ⚠️ Potential issue

Replace placeholder TBD token configuration

The TBD approval step is using a placeholder token. This needs to be properly configured before this workflow can function correctly.

Based on the previous review discussion, consider using @Manav-Aggarwal's PAT here since the bot can't approve its own PRs.

.github/sync.yml (3)

102-105: Verify the existence of shared workflow files

Let's ensure all referenced workflow files exist in the source repository.

✅ Verification successful

All referenced workflow files exist in the repository

All workflow files listed in the sync configuration are present in their specified locations:

  • .github/workflows/approve_merge_bots.yml
  • .github/workflows/semantic_pull_request.yml
  • .github/workflows/semantic_release.yml
  • .github/auto_request_review.yml
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if all workflow files exist
for file in \
    ".github/workflows/approve_merge_bots.yml" \
    ".github/workflows/semantic_pull_request.yml" \
    ".github/workflows/semantic_release.yml" \
    ".github/auto_request_review.yml"
do
    if [ -f "$file" ]; then
        echo "$file exists"
    else
        echo "$file missing"
    fi
done

Length of output: 1339


3-6: Verify the existence and content of the template file

The configuration references .github/dependabot.njk as a template source. Let's ensure it exists and contains the necessary template variables.

✅ Verification successful

Template file exists and is properly configured

The .github/dependabot.njk template exists and correctly handles the ecosystem configurations defined in sync.yml. The template:

  • Uses proper Nunjucks templating syntax to iterate over the provided ecosystems
  • Includes consistent configuration for each ecosystem:
    • Weekly schedule
    • 10 open PR limit
    • Patch/minor update grouping
    • Standardized commit message format

The template aligns perfectly with the ecosystem configurations in the sync file, ensuring consistent Dependabot settings across repositories.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the template file exists and contains expected variables
if [ -f ".github/dependabot.njk" ]; then
    echo "Template exists"
    cat ".github/dependabot.njk"
else
    echo "Template file missing"
fi

Length of output: 549


85-100: Verify repository accessibility and consistency

Let's ensure all listed repositories are accessible and maintain consistency in the repository list.

✅ Verification successful

All repositories are accessible and verified

All 15 repositories listed in the sync configuration are accessible via the GitHub API, confirming their existence and proper access permissions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check repository accessibility using GitHub API
while IFS= read -r repo; do
    repo=$(echo "$repo" | xargs)  # Trim whitespace
    if [ ! -z "$repo" ]; then
        gh api "repos/$repo" --silent && \
            echo "$repo accessible" || \
            echo "$repo not accessible"
    fi
done <<EOF
    rollkit/astria-sequencer
    rollkit/avail-da
    rollkit/based-sequencer
    rollkit/bitcoin-da
    rollkit/centralized-sequencer
    rollkit/cosmos-sdk-starter
    rollkit/docs
    rollkit/go-da
    rollkit/go-execution
    rollkit/go-execution-abci
    rollkit/go-execution-evm
    rollkit/go-sequencing
    rollkit/local-da
    rollkit/rollkit
    rollkit/template-da-repo
EOF

Length of output: 3867

.github/auto_request_review.yml Show resolved Hide resolved
.github/workflows/approve_merge_bots.yml Show resolved Hide resolved
.github/workflows/approve_merge_bots.yml Show resolved Hide resolved
.github/workflows/approve_merge_bots.yml Outdated Show resolved Hide resolved
@MSevey
Copy link
Contributor Author

MSevey commented Dec 3, 2024

@coderabbitai ignore

@MSevey MSevey enabled auto-merge (squash) December 3, 2024 03:07
Copy link

coderabbitai bot commented Dec 3, 2024

✅ Actions performed

Reviews paused.

Manav-Aggarwal
Manav-Aggarwal previously approved these changes Dec 3, 2024
.github/sync.yml Outdated Show resolved Hide resolved
.github/sync.yml Show resolved Hide resolved
@MSevey MSevey requested review from tuxcanfly and tzdybal December 3, 2024 12:32
tzdybal
tzdybal previously approved these changes Dec 3, 2024
Copy link
Member

@tzdybal tzdybal left a comment

Choose a reason for hiding this comment

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

utACK

@MSevey MSevey dismissed stale reviews from tzdybal and Manav-Aggarwal via d8b0278 December 3, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: For Review
Development

Successfully merging this pull request may close these issues.

Auto merge dependabot Common Dependabot
3 participants