Skip to content

Up - #45

Merged
MrIbrahem merged 7 commits into
mainfrom
up
Jun 27, 2026
Merged

Up#45
MrIbrahem merged 7 commits into
mainfrom
up

Conversation

@MrIbrahem

@MrIbrahem MrIbrahem commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Search and filter inputs now accept spaces in several API fields, making queries more flexible for names and categories.
    • Some category and language parameters are now required or have clearer defaults in supported requests.
  • Bug Fixes

    • Fixed validation so spaced campaign, category, and group values are accepted consistently across related endpoints.
    • Removed support for one outdated request type and its documentation, so API behavior is now more consistent.

Update sanitize_input regex patterns to accept spaces in addition to alphanumeric characters and hyphens. This allows user_group, campaign, category, and language code parameters to contain spaces for better flexibility in filtering options across status, missing_exists, and titles_infos endpoints.
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@MrIbrahem, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 11 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 20c9dbc4-61f1-4bef-9c8c-0b2efec921a7

📥 Commits

Reviewing files that changed from the base of the PR and between beee40b and 9845b23.

📒 Files selected for processing (2)
  • .gitignore
  • README.md

Walkthrough

This PR removes the exists_by_qids request path and OpenAPI entry. It also updates endpoint metadata and query sanitizers so several lang, category, campaign, and user_group inputs accept spaces.

Changes

API surface and input parsing

Layer / File(s) Summary
Remove exists_by_qids routing
src/api_cod/request.php, src/openapi.json
Deletes the get=exists_by_qids dispatcher branch and removes the matching OpenAPI path definition.
Update missing/exists endpoint metadata
src/endpoint_params.json, src/api_cod/subs/missing_exists.php
Removes no_mt_options from several parameter definitions and allows spaces in the exists_statics_by_category, missing_by_lang_and_category, exists_by_lang_and_category, and statics_by_category sanitizers.
Allow spaces in status and pages queries
src/api_cod/status.php, src/api_cod/subs/titles_infos.php
Broadens user_group, campaign, and category sanitization to accept spaces in make_status_query() and pages_query().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Mdwiki-TD/TD_API#25: Directly overlaps with the exists_by_qids request path this PR removes.
  • Mdwiki-TD/TD_API#39: Touches the same missing_exists endpoint family and routing introduced in the files updated here.
  • Mdwiki-TD/TD_API#19: Modifies the same make_status_query() sanitization path in src/api_cod/status.php.

Poem

I hop through paths both old and new,
With spaces in the fields I chew.
The qids trail fades from sight,
While status pages parse just right.
I leave a happy carrot hue. 🐰

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is too vague to describe the API endpoint and sanitization changes in this pull request. Replace it with a concise, specific summary of the main change, such as removing the exists_by_qids endpoint and loosening input sanitization.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch up

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Copy link
Copy Markdown

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 removes the exists_by_qids endpoint and its associated configurations across several files, while also updating input sanitization regexes to allow spaces in parameters like categories, campaigns, and user groups. The review feedback highlights that allowing spaces in language codes ($lang_code) unnecessarily weakens input validation, as language codes do not contain spaces. Additionally, a redundant fallback expression was identified in status.php that can be simplified to improve readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/api_cod/subs/missing_exists.php
Comment thread src/api_cod/subs/missing_exists.php
Comment thread src/api_cod/status.php

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/api_cod/status.php (1)

45-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant $_GET['cat'] fallback.

$category_raw already resolves to $_GET['category'] ?? $_GET['cat'] ?? null on line 43, so the extra ?? $_GET['cat'] here is unreachable. Match the cleaner form used in pages_query() (titles_infos.php line 102).

♻️ Simplify
-    $category   = sanitize_input($category_raw ?? $_GET['cat'] ?? '', '/^[A-Za-z0-9- ]+$/');
+    $category   = sanitize_input($category_raw ?? '', '/^[A-Za-z0-9- ]+$/');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/api_cod/status.php` around lines 45 - 46, The category sanitization in
status.php has a redundant fallback because $category_raw already includes
$_GET['cat']; update the sanitize_input call to use only $category_raw with the
same fallback pattern as pages_query() in titles_infos.php, and keep the change
localized around the $campaign and $category assignments so the logic stays
consistent and cleaner.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/api_cod/status.php`:
- Around line 45-46: The category sanitization in status.php has a redundant
fallback because $category_raw already includes $_GET['cat']; update the
sanitize_input call to use only $category_raw with the same fallback pattern as
pages_query() in titles_infos.php, and keep the change localized around the
$campaign and $category assignments so the logic stays consistent and cleaner.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c3fa1d44-0599-497e-828b-554cfa2c00ec

📥 Commits

Reviewing files that changed from the base of the PR and between 767200e and beee40b.

📒 Files selected for processing (16)
  • _src/test/README.md
  • _src/test/endpointGroups.json
  • _src/test/index.php
  • _src/test/script.js
  • _src/test/style.css
  • _src/test/theme.css
  • _src/test/theme.js
  • _src/test2/README.md
  • _src/test2/index.html
  • _src/test2/script.js
  • src/api_cod/request.php
  • src/api_cod/status.php
  • src/api_cod/subs/missing_exists.php
  • src/api_cod/subs/titles_infos.php
  • src/endpoint_params.json
  • src/openapi.json
💤 Files with no reviewable changes (2)
  • src/openapi.json
  • src/api_cod/request.php

@MrIbrahem
MrIbrahem merged commit 607abbc into main Jun 27, 2026
2 of 3 checks passed
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.

1 participant