Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(github): add default rulesets and installation#47

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@fmind
Copy link
Owner

Changes

Reasons

Testing

Impacts

Notes

@fmindfmind added the featA new feature. Correlates with MINOR in SemVer labelMar 5, 2025
@fmindfmind added this to thev4.1.0 milestoneMar 5, 2025
@fmindfmind self-assigned thisMar 5, 2025
Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

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

Hello@fmind, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request introduces default rulesets and installation for GitHub repositories. It adds amain.json file containing the ruleset configuration, modifies theREADME.md file to include a newinstall-rulesets task, and updates thetasks/install.just file to include the implementation for installing the GitHub rulesets using the GitHub API.

Highlights

  • Ruleset Configuration: The pull request introduces amain.json file that defines a ruleset for themain branch. This ruleset enforces several rules, including deletion restrictions, required linear history, pull request requirements (approvals, dismissal of stale reviews, merge methods), required status checks, and non-fast-forward merges.
  • Installation Task: The pull request adds a newinstall-rulesets task to thetasks/install.just file. This task uses the GitHub API to create a ruleset for the repository based on the configuration inmain.json.
  • README Update: TheREADME.md file is updated to include the newinstall-rulesets task in the list of available tasks.

Changelog

  • .github/rulesets/main.json
    • Added a new file containing the default ruleset configuration for themain branch.
    • The ruleset enforces deletion restrictions, required linear history, pull request requirements, required status checks, and non-fast-forward merges.
    • Bypass actors are configured to allow repository roles to bypass the rules.
  • README.md
    • Addedinstall-rulesets to the list of available tasks.
  • tasks/install.just
    • Added a newinstall-rulesets task that uses the GitHub API to create a ruleset for the repository.
    • The task retrieves the repository name and owner using thegh CLI.
    • The task sends a POST request to the GitHub API to create the ruleset using the configuration in.github/rulesets/main.json.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on ourdocumentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either/gemini <command> or@gemini-code-assist <command>. Below is a summary of the supported commands.

FeatureCommandDescription
Code Review/gemini reviewPerforms a code review for the current pull request in its current state.
Pull Request Summary/gemini summaryProvides a summary of the current pull request in its current state.
Comment@gemini-code-assistResponds in comments when explicitly tagged, both in issue comments and review comments.
Help/gemini helpDisplays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a.gemini/ folder in the base of the repository. Detailed instructions can be foundhere.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on@gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with theGemini Code Assist IDE Extension.


Trivia time!

What is the purpose of the 'jq' command-line tool used in theinstall-rulesets task?

Click here for the answer
The `jq` command-line tool is a lightweight and flexible JSON processor. It is used to slice, filter, map and transform structured data.

Footnotes

  1. Review thePrivacy Notices,Generative AI Prohibited Use Policy,Terms of Service, and learn how to configure Gemini Code Assist in GitHubhere. Gemini can make mistakes, so double check it anduse code with caution.

@fmindfmind merged commit193a9b4 intov4.1.0Mar 5, 2025
1 check passed
@fmindfmind deleted the 46-feat-automatically-set-rulesets-on-github branchMarch 5, 2025 19:43
Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces default rulesets and installation for GitHub repositories usingjust. The changes look good overall, but there are a few areas that could be improved for clarity and maintainability.

Summary of Findings

  • Error Handling ininstall-rulesets: Theinstall-rulesets task intasks/install.just usesset -euo pipefail, which is good for general error handling. However, it might be beneficial to add specific error handling around thegh api call to provide more informative error messages or retry logic if the API call fails. I did not add a review comment for this due to the review settings.
  • Clarity of Rule Set Purpose: Themain.json ruleset lacks comments explaining the purpose of each rule. Adding comments would improve readability and maintainability. I did not add a review comment for this due to the review settings.

Merge Readiness

The pull request is almost ready for merging. Addressing the suggested improvements, particularly regarding error handling and documentation, would enhance the quality and maintainability of the code. I am unable to directly approve the pull request, and recommend that others review and approve this code before merging.

Comment on lines +23 to +24
gh api --method POST -H"Accept: application/vnd.github+json" \
"/repos/$owner/$repo/rulesets" --input=".github/rulesets/main.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Consider adding a comment explaining what this command does, and what the expected output is. This will help future developers understand the purpose of this command.

    gh api --method POST -H "Accept: application/vnd.github+json" \    "/repos/$owner/$repo/rulesets" --input=".github/rulesets/main.json" # Creates or updates the ruleset for the repository

@fmind
Copy link
OwnerAuthor

Closes by#46

@fmindfmind mentioned this pull requestMar 5, 2025
Merged
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@gemini-code-assistgemini-code-assist[bot]gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

@fmindfmind

Labels

featA new feature. Correlates with MINOR in SemVer

Projects

None yet

Milestone

v4.1.0

Development

Successfully merging this pull request may close these issues.

2 participants

@fmind

[8]ページ先頭

©2009-2025 Movatter.jp