docs: add lessons learned from curl piping issues#13
Conversation
…mentation - Document curl piping issues and solutions from v1.0.6 - Explain versioning system and release process - Document .cursor/UPDATE.md file purpose - Add testing recommendations for piped execution - Update project organization documentation
There was a problem hiding this comment.
Summary of Changes
Hello @ivangrynenko, 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 significantly enhances the project's documentation by capturing critical lessons learned from debugging installer hanging issues, particularly those related to curl piping. It introduces detailed explanations of the project's versioning system and the purpose of the .cursor/UPDATE.md file. Furthermore, it provides specific solutions for PHP-specific behaviors encountered when piping scripts and outlines recommendations for improving test coverage to prevent similar issues in the future. The changes aim to ensure future developers understand these complexities and maintain robust system behavior.
Highlights
- Documenting Curl Piping Issues and Solutions: Added a comprehensive section detailing the problem of the installer hanging when piped through
curl, outlining the root causes ($_SERVER['PHP_SELF']behavior, STDIN waiting, argument parsing) and the specific PHP code solutions implemented to address these. - Clarifying Versioning System and Release Process: Introduced a new section explaining the project's version management, including the
CURSOR_RULES_VERSIONconstant, the role of.cursor/UPDATE.mdfor tracking history, and the defined release process steps. - Enhancing Project Documentation Structure: Updated the 'Project Organization' section to include
.cursor/UPDATE.mdandAGENTS.mdas key project files, and added new test examples for curl piping scenarios in theCLAUDE.mdfile. - Recommending Test Coverage Improvements: Identified gaps in existing test coverage related to curl piping scenarios and provided specific recommendations for adding tests for
curl ... | php,cat install.php | php, argument parsing, and STDIN handling.
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 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
-
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. ↩
There was a problem hiding this comment.
Code Review
This pull request adds valuable documentation regarding the project's versioning system and lessons learned from issues with curl piping. The new sections in CLAUDE.md are well-structured and informative. However, there are a couple of significant discrepancies between the new documentation and the current implementation in install.php. I've pointed out where the documentation claims a feature is implemented in a certain way, while the code shows a different (or incomplete) implementation. Addressing these points will ensure the documentation is accurate and reliable for developers.
| 1. **Entry Point Detection**: Check for both normal execution and "Standard input code" | ||
| ```php | ||
| if (basename(__FILE__) === basename($_SERVER['PHP_SELF'] ?? '') || | ||
| ($_SERVER['PHP_SELF'] ?? '') === 'Standard input code') | ||
| ``` |
There was a problem hiding this comment.
The documented solution for entry point detection does not seem to match the implementation in install.php. The documentation claims the fix is to use if (basename(__FILE__) === basename($_SERVER['PHP_SELF'] ?? '') || ($_SERVER['PHP_SELF'] ?? '') === 'Standard input code'), which would correctly handle piped execution.
However, the provided install.php at line 990 only has if (basename(__FILE__) === basename($_SERVER['PHP_SELF'] ?? '')). This condition will likely be false when the script is piped, preventing the main installation logic from running.
Please verify that the fix is correctly implemented and update the documentation or the code to be consistent. If the implementation is different, the documentation should reflect the actual code.
CLAUDE.md
Outdated
| ### .cursor/UPDATE.md File Purpose | ||
| The UPDATE.md file serves as a version history log that: | ||
| - Tracks all changes made in each version | ||
| - Documents new features, bug fixes, and improvements | ||
| - Records the date of each release | ||
| - Lists affected files and their impact | ||
| - Notes any breaking changes | ||
| - Gets created/updated automatically by the installer in user projects | ||
| - Helps users understand what changed between versions |
There was a problem hiding this comment.
This section describes .cursor/UPDATE.md as a "version history log" that "tracks all changes made in each version". However, the install.php script (lines 837-877) appears to overwrite this file on each run with the details of the current installation, rather than appending to it to create a history. The generated file acts more like an installation receipt than a version history log.
Please clarify the intended purpose of this file and update the documentation to accurately reflect the script's behavior.
…PDATE.md documentation - Added missing check for 'Standard input code' in entry point detection to properly handle curl piping - Corrected documentation to accurately describe UPDATE.md as an installation receipt (not version history) - Ensures consistency between documentation and actual implementation Addresses review comments from @gemini-code-assist on PR #13
✅ Review Feedback AddressedThank you @gemini-code-assist for the thorough review! I've addressed both issues: 1. Entry Point Detection (High Priority) - Fixed ✓
2. UPDATE.md Documentation (Medium Priority) - Fixed ✓
Changes Made:
All changes have been tested and verified to work correctly. The documentation now accurately reflects the implementation. |
|
Thank you for the detailed update, @ivangrynenko! I appreciate you taking the time to address the feedback. I've reviewed the changes, and they accurately reflect the proposed solutions:
Great work on implementing these fixes and ensuring the documentation is accurate. Your thorough testing with Looks good! |
…PDATE.md documentation - Added missing check for 'Standard input code' in entry point detection to properly handle curl piping - Corrected documentation to accurately describe UPDATE.md as an installation receipt (not version history) - Ensures consistency between documentation and actual implementation Addresses review comments from @gemini-code-assist on PR #13
docs: add lessons learned from curl piping issues
Summary
Changes
Context
This documentation captures the lessons learned from debugging and fixing the installer hanging issue when piped through curl (PR #11 and #12), ensuring future developers understand these PHP-specific behaviors.
Related Issues