Skip to content

updated db size#11658

Open
ArnabChatterjee20k wants to merge 2 commits into1.9.xfrom
update-db-size
Open

updated db size#11658
ArnabChatterjee20k wants to merge 2 commits into1.9.xfrom
update-db-size

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Member

What does this PR do?

(Provide a description of what this PR does and why it's needed.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

📝 Walkthrough

Walkthrough

This pull request contains two focused changes: (1) increasing the size constraint of the database attribute in the databases collection configuration from 128 to 2000 characters, and (2) refining the conditional logic in the testQueryBySequenceType() test method to broaden the failure condition by additionally checking for unsupported attributes, ensuring the success path only executes when both the adapter is not MongoDB and attributes are supported.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description contains only a template with empty sections and no actual information about the changeset, rationale, testing, or related items. Fill in the PR description with concrete details about why the database size limit was increased, how it was tested, and any related issues or PRs.
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 'updated db size' is vague and generic, using non-descriptive language that doesn't convey the specific nature or scope of the change. Clarify the title to specify what was updated and why, such as 'Increase database field size limit from 128 to 2000 characters' or similar descriptive phrasing.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-db-size

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 and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 27, 2026

Greptile Summary

This PR makes two unrelated changes: it increases the database attribute size in the databases collection config from 128 to 2000 characters, and it fixes a test assertion to correctly handle database adapters that do not support attributes.

  • Config change (app/config/collections/projects.php): The database attribute size is increased to 2000, but no migration step is included to resize the existing column for deployments that have already run the V24 migration. The V24 migration creates this attribute via createAttributeFromCollection, meaning the column already exists at size 128 in live environments. A $this->dbForProject->updateAttribute('databases', 'database', size: 2000) call must be added to a migration (new V25, or V24 if it has not yet been released) to ensure existing deployments benefit from the increased size.
  • Test change (tests/e2e/Services/Databases/DatabasesBase.php): The added !$this->getSupportForAttributes() guard correctly prevents false failures when testing against adapters that do not support schema attributes (such as ApiDocumentsDB). The logic is sound, but the change is unrelated to the collection config update and has no explanation in the PR description.

Confidence Score: 4/5

Not safe to merge without a database migration step to resize the existing database attribute column.

There is one P1 finding: the config-only size change from 128 → 2000 has no accompanying migration, which means any deployment that already ran V24 will retain a 128-character database column, causing data truncation or write failures for values exceeding that limit.

app/config/collections/projects.php — requires a companion migration to resize the database attribute on existing installations.

Important Files Changed

Filename Overview
app/config/collections/projects.php Increases database attribute size from 128 → 2000 in the databases collection config; missing a corresponding migration step (updateAttribute) to resize the column for existing deployments that already ran V24.
tests/e2e/Services/Databases/DatabasesBase.php Adds !getSupportForAttributes() to the condition that expects a 400 response for integer $sequence queries — a correct fix for non-attribute-supporting adapters, but unrelated to the config size change.

Reviews (1): Last reviewed commit: "updated project size" | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/config/collections/projects.php (1)

64-72: ⚠️ Potential issue | 🟡 Minor

Ensure this config change is included in the appropriate migration version.

Migration infrastructure exists in V24.php to handle collection schema changes—specifically, the migrateCollections() method calls createAttributeFromCollection() for the 'database' attribute in the databases collection (line 202). However, this requires that your config change is part of the released migration version. If this is a new config change being added, verify it's included in the migration being deployed.

Additionally, 2000 characters seems unusually large for a database identifier field. Please clarify the use case or intended content for this attribute.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/config/collections/projects.php` around lines 64 - 72, The new 'database'
attribute definition added in app/config/collections/projects.php
(ID::custom('database'), type Database::VAR_STRING, size 2000) must be reflected
in the migration that will run for released versions: add this attribute to the
appropriate migration (see V24.php and its migrateCollections() /
createAttributeFromCollection() logic) so the schema change is applied during
upgrades, and confirm the migration version matches the release. Also
re-evaluate the size value — if this field is a short identifier use a much
smaller size (e.g., 64/255) or document the intended large content if 2000 chars
is required; update the config and migration accordingly to keep them
consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@app/config/collections/projects.php`:
- Around line 64-72: The new 'database' attribute definition added in
app/config/collections/projects.php (ID::custom('database'), type
Database::VAR_STRING, size 2000) must be reflected in the migration that will
run for released versions: add this attribute to the appropriate migration (see
V24.php and its migrateCollections() / createAttributeFromCollection() logic) so
the schema change is applied during upgrades, and confirm the migration version
matches the release. Also re-evaluate the size value — if this field is a short
identifier use a much smaller size (e.g., 64/255) or document the intended large
content if 2000 chars is required; update the config and migration accordingly
to keep them consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: acc61fd1-765d-40d6-820d-581876522801

📥 Commits

Reviewing files that changed from the base of the PR and between f2c8500 and 3ff7cad.

📒 Files selected for processing (2)
  • app/config/collections/projects.php
  • tests/e2e/Services/Databases/DatabasesBase.php

'$id' => ID::custom('database'),
'type' => Database::VAR_STRING,
'size' => 128,
'size' => 2000,
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.

P1 Missing migration to resize existing database attribute

The database attribute size is being changed from 128 to 2000 in the collection config, but there is no corresponding migration step to resize the already-created column in existing deployments.

In V24.php (lines 199–208), the database attribute is created via createAttributeFromCollection, so any environment that has already executed the V24 migration will have a database column with size 128. Updating the config file alone does not retroactively alter that column — a call to $this->dbForProject->updateAttribute('databases', 'database', size: 2000) in a new migration (or inside V24 before it is officially released) is required.

Without this, values longer than 128 characters stored in the database field will be silently truncated or rejected on existing installations, which is the primary use-case motivating this change.


$adapter = getenv('_APP_DB_ADAPTER');
if ($adapter === 'mongodb') {
if ($adapter === 'mongodb' || !$this->getSupportForAttributes()) {
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.

P2 Test change appears unrelated to the projects.php size change

The added !$this->getSupportForAttributes() condition is a reasonable guard — adapters that do not support attributes (e.g. ApiDocumentsDB, which hard-codes getSupportForAttributes(): bool to false) should indeed reject an integer $sequence query with a 400. The fix itself looks correct.

However, this change has no connection to the "updated project size" described in the PR title, and the PR description is empty. Consider opening it as a separate PR or at minimum documenting the motivation in the PR description so reviewers can evaluate both changes independently.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

🔄 PHP-Retry Summary

Flaky tests detected across commits:

Commit 3ff7cad - 23 flaky tests
Test Retries Total Time Details
UsageTest::testVectorsDBStats 1 10.21s Logs
DocumentsDBConsoleClientTest::testTimeout 1 121.26s Logs
LegacyConsoleClientTest::testTimeout 1 123.11s Logs
LegacyCustomClientTest::testAttributeResponseModels 1 241.79s Logs
LegacyCustomClientTest::testCreatedBefore 1 240.30s Logs
LegacyCustomServerTest::testListAttributes 1 241.34s Logs
LegacyCustomServerTest::testCreateDocument 1 17ms Logs
LegacyCustomServerTest::testListDocuments 1 22ms Logs
LegacyCustomServerTest::testListDocumentsWithCache 1 23ms Logs
LegacyCustomServerTest::testListDocumentsCacheBustedByAttributeChange 1 23ms Logs
LegacyCustomServerTest::testGetDocument 1 24ms Logs
LegacyCustomServerTest::testGetDocumentWithQueries 1 25ms Logs
LegacyCustomServerTest::testQueryBySequenceType 1 40ms Logs
LegacyCustomServerTest::testListDocumentsAfterPagination 1 40ms Logs
LegacyCustomServerTest::testListDocumentsBeforePagination 1 33ms Logs
LegacyCustomServerTest::testListDocumentsLimitAndOffset 1 24ms Logs
LegacyCustomServerTest::testDocumentsListQueries 1 28ms Logs
LegacyCustomServerTest::testUpdateDocument 1 30ms Logs
LegacyCustomServerTest::testDeleteDocument 1 26ms Logs
LegacyCustomServerTest::testDefaultPermissions 1 24ms Logs
LegacyCustomServerTest::testPersistentCreatedAt 1 16ms Logs
LegacyCustomServerTest::testNotSearch 1 7ms Logs
LegacyTransactionsCustomClientTest::testCreateOperationsValidation 1 240.32s Logs
Commit 325b1d6 - 7 flaky tests
Test Retries Total Time Details
DocumentsDBConsoleClientTest::testTimeout 1 120.81s Logs
DocumentsDBCustomClientTest::testTimeout 1 120.66s Logs
DocumentsDBCustomServerTest::testTimeout 1 123.85s Logs
LegacyConsoleClientTest::testListDocumentsWithCache 1 779ms Logs
LegacyConsoleClientTest::testListDocumentsAfterPagination 1 120.05s Logs
LegacyConsoleClientTest::testIncrementAttribute 1 240.45s Logs
UsageTest::testVectorsDBStats 1 10.45s Logs

@blacksmith-sh

This comment has been minimized.

@ArnabChatterjee20k ArnabChatterjee20k changed the title updated project size updated db size Mar 27, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

✨ Benchmark results

  • Requests per second: 1,639
  • Requests with 200 status code: 295,049
  • P99 latency: 0.108688732

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,639 1,179
200 295,049 212,245
P99 0.108688732 0.193344161

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