Skip to content

docs: add repository merge policy and safe issue/PR handling guidelines - #308

Merged
apstndb merged 3 commits into
mainfrom
docs/update-claude-md-merge-and-issue-safety
Jun 19, 2025
Merged

apstndb merged 3 commits into
mainfrom
docs/update-claude-md-merge-and-issue-safety

Conversation

@apstndb

@apstndb apstndb commented Jun 19, 2025

Copy link
Copy Markdown
Owner

Summary

This PR adds critical documentation to CLAUDE.md to address issue #307:

  1. Repository merge policy: Documents that this repository enforces squash merge only via Repository Ruleset
  2. Safe Issue/PR handling: Adds guidance for using --body-file to safely handle special characters in issue/PR content

Changes Made

🚨 CRITICAL REQUIREMENTS Section

  • Added item 5: Repository merge policy documentation
  • Ensures AI assistants understand they must use squash method for automated merges

GitHub Issues/PRs Workflow Section

  • Added item 6: Safe Issue/PR creation/updates guidance
  • Documents --body-file approach to avoid shell escaping issues with special characters

Problem Solved

Issue #307: When attempting to merge PR #306 using GitHub API with merge_method: "merge", we encountered:

PUT https://api.github.com/repos/apstndb/spanner-mycli/pulls/306/merge: 405 Merge commits are not allowed on this repository.

Root Cause: Repository Ruleset "default branch" restricts allowed_merge_methods to ["squash"] only.

Additional Issue: Shell escaping problems when creating/updating issues with special characters (backticks, quotes) in content.

Impact

  • AI Assistant Reliability: Prevents unexpected merge failures by documenting repository constraints
  • Content Safety: Ensures issue/PR content with special characters is handled correctly
  • Developer Experience: Clear guidance prevents common mistakes

Validation

Fixes #307

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary of Changes

Hello @apstndb, 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 enhances the project's documentation by clarifying critical operational guidelines for repository management and content submission. It addresses past merge failures by explicitly stating the repository's "squash merge only" policy and improves developer experience by providing a robust method for safely handling special characters in issue and PR content, ensuring smoother workflows and more reliable automated processes.

Highlights

  • Repository Merge Policy: Documented that this repository enforces a "squash merge only" policy via GitHub Repository Ruleset. This explicitly guides AI assistants and other automated processes to use the squash method for all merges, preventing errors like those encountered in issue #307.
  • Safe Issue/PR Handling: Added guidance for creating and updating GitHub issues and pull requests, specifically recommending the use of --body-file. This method helps to safely handle content containing special characters (such as backticks and quotes) and avoids common shell escaping issues.
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 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.

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 issue 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 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 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. ↩

@apstndb
apstndb force-pushed the docs/update-claude-md-merge-and-issue-safety branch from 6a2d0d9 to a7e2559 Compare June 19, 2025 10:06

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This PR adds valuable documentation to CLAUDE.md regarding the mandatory squash merge policy and a best practice for safely handling special characters in GitHub issues and PRs using --body-file. These changes are clear, well-justified, and crucial for AI assistants and developers interacting with the repository. I've included one suggestion to further clarify the scope of special characters for the AI audience, aiming to prevent potential misinterpretations.

Comment thread CLAUDE.md Resolved
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@apstndb
apstndb force-pushed the docs/update-claude-md-merge-and-issue-safety branch from a7e2559 to 0e9124a Compare June 19, 2025 10:15
@apstndb apstndb added the ignore-for-release Exclude from automatic release notes generation label Jun 19, 2025
@github-actions

This comment has been minimized.

- Add critical note about squash-only merge policy enforced by Repository Ruleset
- Add comprehensive guidance for safe handling of special characters in shell commands
- Recommend variable + stdin approach to avoid temporary files
- Document tmp/ directory usage when temp files are necessary
- Add ignore-for-release label usage guidelines for CLAUDE.md and dev-docs changes
- Addresses issue #307 merge failures and shell escaping problems

Fixes #307
@apstndb
apstndb force-pushed the docs/update-claude-md-merge-and-issue-safety branch from 0e9124a to dbea1d2 Compare June 19, 2025 10:17
@github-actions

This comment has been minimized.

- Add guideline to preserve review history by not rewriting pushed commits
- Emphasize that explicit permission is required for any push --force operations
- Important for maintaining integrity of code review process
@github-actions

This comment has been minimized.

- Address Gemini review feedback for broader interpretation
- Include additional examples (dollar signs, parentheses) to emphasize comprehensiveness
- Helps AI assistants understand this is not an exhaustive list
@github-actions

Copy link
Copy Markdown

Code Metrics Report

main (fe08b20) #308 (d216278) +/-
Coverage 64.5% 64.5% 0.0%
Code to Test Ratio 1:0.6 1:0.6 0.0
Test Execution Time 1m31s 1m10s -21s
Details
  |                     | main (fe08b20) | #308 (d216278) | +/-  |
  |---------------------|----------------|----------------|------|
  | Coverage            |          64.5% |          64.5% | 0.0% |
  |   Files             |             30 |             30 |    0 |
  |   Lines             |           3447 |           3447 |    0 |
  |   Covered           |           2226 |           2226 |    0 |
  | Code to Test Ratio  |          1:0.6 |          1:0.6 |  0.0 |
  |   Code              |           8334 |           8334 |    0 |
  |   Test              |           5814 |           5814 |    0 |
+ | Test Execution Time |          1m31s |          1m10s | -21s |

Reported by octocov

@apstndb

apstndb commented Jun 19, 2025

Copy link
Copy Markdown
Owner Author

/gemini review

1 similar comment
@apstndb

apstndb commented Jun 19, 2025

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 adds valuable documentation regarding the repository's merge policy and safe handling of special characters in shell commands. It also clarifies Git practices and the use of the ignore-for-release label. The changes are clear, accurate, and directly address the problems outlined in issue #307. I found no issues of high or critical severity; the documentation enhancements are well-implemented and beneficial.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 adds critical documentation to CLAUDE.md and dev-docs/issue-management.md, covering repository merge policy, safe issue/PR handling, and Git practices. The changes enhance AI assistant reliability, content safety, and developer experience. The suggestions provided aim to further improve clarity and provide additional context for users.

@apstndb
apstndb merged commit cdf08f3 into main Jun 19, 2025
@apstndb
apstndb deleted the docs/update-claude-md-merge-and-issue-safety branch June 19, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release Exclude from automatic release notes generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improvement: enhance AI assistant tools to handle repository ruleset merge restrictions

1 participant