-
Notifications
You must be signed in to change notification settings - Fork 809
Fix an issue on type casting of default string function/procedure arguments in debugger tool. #9036 #9397
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
Conversation
WalkthroughAdds a new helper function Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
web/pgadmin/tools/debugger/templates/debugger/sql/get_function_debug_info.sql(1 hunks)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: run-feature-tests-pg (18)
- GitHub Check: run-feature-tests-pg (16)
- GitHub Check: run-feature-tests-pg (17)
- GitHub Check: run-feature-tests-pg (15)
- GitHub Check: run-feature-tests-pg (13)
- GitHub Check: run-feature-tests-pg (14)
🔇 Additional comments (1)
web/pgadmin/tools/debugger/templates/debugger/sql/get_function_debug_info.sql (1)
51-73: Request verification of the fix scope against issue #9036.The changes address type-cast cleanup, but without seeing the original issue or test cases, it's unclear whether the current implementation handles all necessary scenarios correctly. Specifically:
- What types of default argument values were causing the original bug?
- Are there existing tests that validate this fix against regression?
- Does the affected PostgreSQL version(s) produce any unexpected output formats from
pg_get_expr?Please confirm: (1) the root cause of #9036, (2) which PostgreSQL versions are in scope, and (3) whether test coverage exists for edge cases like quoted strings or complex types.
web/pgadmin/tools/debugger/templates/debugger/sql/get_function_debug_info.sql
Outdated
Show resolved
Hide resolved
web/pgadmin/tools/debugger/templates/debugger/sql/get_function_debug_info.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
web/pgadmin/tools/debugger/__init__.py (1)
788-817: Add documentation explaining the validation rules.The
filter_params_by_defaultfunction enforces an important constraint but lacks documentation explaining:
- What SQL/PL/pgSQL rule is being enforced (no arguments after defaults)
- What the expected input format is for
params_listanddefault_value_str- Examples of valid and invalid parameter combinations
Consider adding a comprehensive docstring:
def filter_params_by_default(params_list, default_value_str): """ Validate and truncate params_list to enforce SQL parameter rules. SQL/PL/pgSQL functions don't allow providing arguments after a default value is used. This function finds the first parameter using its default value and ensures no subsequent parameters are provided. Args: params_list: List of parameter dicts with 'value' keys e.g., [{'value': '10'}, {'value': ''}, {'value': ''}] default_value_str: Comma-separated string of default values e.g., "'default1','default2','default3'" Returns: tuple: (filtered_params_list, error_message) - On success: (truncated list up to first default, None) - On error: (None, error message string) Example: # Function has 3 params with defaults ['x', 'y', 'z'] # User provides ['1', 'y', ''] - ERROR: provided arg after default # User provides ['1', 'y'] - OK: truncate to ['1', 'y'] # User provides ['1'] - OK: keep as ['1'] """
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/en_US/release_notes_9_11.rst(1 hunks)web/pgadmin/tools/debugger/__init__.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
web/pgadmin/tools/debugger/__init__.py (2)
web/regression/javascript/fake_gettext.js (1)
gettext(40-42)web/pgadmin/utils/ajax.py (1)
internal_server_error(98-105)
🪛 Ruff (0.14.7)
web/pgadmin/tools/debugger/__init__.py
912-912: Do not catch blind exception: Exception
(BLE001)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: run-python-tests-pg (windows-latest, 13)
- GitHub Check: run-python-tests-pg (windows-latest, 15)
- GitHub Check: run-python-tests-pg (windows-latest, 16)
- GitHub Check: run-python-tests-pg (windows-latest, 14)
- GitHub Check: run-feature-tests-pg (17)
- GitHub Check: run-feature-tests-pg (15)
- GitHub Check: run-feature-tests-pg (14)
- GitHub Check: run-feature-tests-pg (18)
- GitHub Check: run-feature-tests-pg (13)
- GitHub Check: run-feature-tests-pg (16)
🔇 Additional comments (1)
docs/en_US/release_notes_9_11.rst (1)
42-42: LGTM!The release notes entry is clear and follows the established format.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.