Skip to content

Conversation

@vedantthapa
Copy link
Contributor

@vedantthapa vedantthapa commented Oct 3, 2025

Contrary to the repository argument being optional in official docs, specifying it is crucial, else the URL for API call is malformed.

See this failed run for example, the repository name is missing between //. Here's the upstream Go SDK reference.

@gemini-code-assist
Copy link

Summary of Changes

Hello @vedantthapa, 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!

This pull request addresses a critical issue where the github_repository_ruleset Terraform resource was failing due to a missing repository argument in API calls, despite the argument being documented as optional. The changes introduce the necessary repository parameter across the relevant modules and update an example to ensure proper functionality and prevent future API malformation errors.

Highlights

  • Fix API Malformation: The repository argument is now explicitly passed to the github_repository_ruleset resource to prevent malformed API calls, which previously led to failed runs due to the repository name being omitted from the URL.
  • New repository Variable: A new repository input variable has been introduced in the modules/ruleset to allow specifying the target repository name for rulesets, ensuring proper configuration.
  • Example and Module Updates: The example configuration (examples/ruleset/repository-ruleset.tf) has been updated to demonstrate the usage of the new repository argument, and the modules/repository_base/rulesets.tf now correctly passes the repository name to the ruleset resource.
Using Gemini Code Assist

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

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays 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 found here.

Limitations & Feedback

Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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

Footnotes

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

Copy link

@gemini-code-assist gemini-code-assist bot 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 correctly identifies and fixes an issue where the repository argument was missing for github_repository_ruleset, causing API errors. The changes are applied consistently across the module, its tests, and the example usage. My main feedback is to add a validation check to ensure the new repository variable is provided when ruleset_type is 'repository', which will make the module more robust and prevent future misconfigurations.

@vedantthapa vedantthapa changed the title fix: add repository argument fix: add repository argument Oct 3, 2025
@vedantthapa vedantthapa changed the title fix: add repository argument fix: add required repository argument Oct 3, 2025
@vedantthapa vedantthapa enabled auto-merge (squash) October 3, 2025 21:34
@vedantthapa vedantthapa changed the title fix: add required repository argument fix: add required repository argument for rulesets Oct 3, 2025
@vedantthapa vedantthapa merged commit 71cc7c9 into main Oct 6, 2025
3 checks passed
@vedantthapa vedantthapa deleted the add-repository-name branch October 6, 2025 17:20
vedantthapa added a commit that referenced this pull request Oct 6, 2025
vedantthapa added a commit that referenced this pull request Oct 6, 2025
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