Skip to content

Conversation

abnegate
Copy link
Member

@abnegate abnegate commented Sep 23, 2025

This PR contains updates to the Dart SDK for version 18.1.0.

Summary by CodeRabbit

  • New Features

    • Added random ordering support to queries.
    • Deployment objects now include the providerBranch field.
  • Documentation

    • Updated geometry examples to clarify default value shapes for point, line, and polygon.
    • Corrected minor wording in health and execution field descriptions.
    • README usage now references dart_appwrite ^18.1.0.
  • Chores

    • Bumped SDK version to 18.1.0.
    • Updated SDK/version headers to 18.1.0 in client requests.

Copy link

coderabbitai bot commented Sep 23, 2025

Warning

Rate limit exceeded

@github-actions[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 645e739 and 420540e.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)

Walkthrough

Updates documentation examples for geometry defaults across databases and tablesdb (point, line, polygon) to adjust xdefault shapes and values. Bumps displayed and header SDK versions from 18.0.0 to 18.1.0 and updates pubspec version. Adds Query.orderRandom() as a new public static method with corresponding unit test. Extends Deployment model with a new required public field providerBranch, including constructor, fromMap, and toMap updates, with tests adjusted accordingly. Minor doc comment corrections in model classes. Some tests reorder providerBranch fields in maps without logic changes.

Possibly related PRs

  • Add time between queries #88: Also modifies lib/query.dart by adding new query builder methods, aligning with this PR’s addition of Query.orderRandom().

Suggested reviewers

  • lohanidamodar

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: Dart SDK update for version 18.1.0" is concise, follows conventional commit style, and accurately communicates the primary intent of the changeset (a version/SKD update). It clearly relates to the main changes in the diff such as the pubspec and client header bumps and documentation updates. Although there are additional items (e.g., Query.orderRandom and Deployment.providerBranch), the title appropriately emphasizes the release/version bump without needing to list every small change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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.

Copy link

@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.

Actionable comments posted: 0

🧹 Nitpick comments (11)
docs/examples/tablesdb/create-line-column.md (1)

15-16: Clarify coordinate order in example.

Consider noting the expected order ([lon, lat] vs [lat, lon]) to prevent misuse.

Apply this doc tweak:

-    xdefault: [[1, 2], [3, 4], [5, 6]], // (optional)
+    xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) [lon, lat] pairs

Please confirm the SDK/server expects [lon, lat].

docs/examples/databases/create-point-attribute.md (1)

15-16: Specify point coordinate order.

Add a hint for [lon, lat] to avoid ambiguity.

-    xdefault: [1, 2], // (optional)
+    xdefault: [1, 2], // (optional) [lon, lat]

Verify the expected order matches backend validation.

docs/examples/databases/update-line-attribute.md (1)

15-17: Add brief note on required shape.

Lines require 2+ points; document coordinate order to reduce errors.

-    xdefault: [[1, 2], [3, 4], [5, 6]], // (optional)
+    xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) [lon, lat] pairs; >= 2 points

Confirm this aligns with server-side validation rules.

docs/examples/databases/update-polygon-attribute.md (1)

15-17: Clarify polygon ring closure and order.

This example closes the ring (first == last). Add a short hint and coordinate order to guide users.

-    xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional)
+    xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) single ring, closed (first==last), [lon, lat]

Please confirm orientation/winding isn’t enforced in validation.

docs/examples/tablesdb/update-point-column.md (1)

15-17: Disambiguate point ordering.

Add [lon, lat] note to minimize confusion.

-    xdefault: [1, 2], // (optional)
+    xdefault: [1, 2], // (optional) [lon, lat]

Ensure this matches TablesDB expectations.

docs/examples/databases/create-polygon-attribute.md (1)

15-16: Document polygon ring semantics.

Note closed ring and coordinate order.

-    xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional)
+    xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) single closed ring, [lon, lat]

Confirm whether holes (inner rings) are supported and how they should be nested.

docs/examples/tablesdb/create-point-column.md (1)

15-16: Add coordinate order hint.

Tiny doc polish to avoid lat/lon mix-ups.

-    xdefault: [1, 2], // (optional)
+    xdefault: [1, 2], // (optional) [lon, lat]

Please verify ordering with the TablesDB API docs.

lib/src/models/execution.dart (1)

35-36: Doc fix: now correctly references request headers; tweak wording to match type.

Type is List<Headers>, not a key-value object. Suggest adjusting the sentence to avoid confusion.

-  /// HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
+  /// HTTP request headers as a list of header entries. Returns only whitelisted headers. All headers are returned if execution is created as synchronous.

Also consider updating the similar comment for responseHeaders for consistency.

lib/src/models/deployment.dart (1)

80-82: Approve — providerBranch added and serialized correctly.

Verified: providerBranch is present and handled in lib/src/models/deployment.dart (field, constructor, fromMap, toMap), reflected in lib/src/models/site.dart and lib/src/models/function.dart, used in lib/services/{sites,functions}.dart, present in tests (test/services/, test/src/models/) and docs/examples.

Fix: update the doc comment above providerBranchUrl in lib/src/models/deployment.dart from "The branch of the vcs repository" to "The URL of the VCS repository branch".

test/src/models/deployment_test.dart (2)

65-66: Define behavior when providerBranch is missing (compat concern).

If older server payloads omit this field, decide: throw vs. default. Add a negative test to lock behavior.

Example test to add:

test('fromMap missing providerBranch', () {
  final base = model.toMap()..remove('providerBranch');
  // Option A (strict): expect throw
  expect(() => Deployment.fromMap(base), throwsA(isA<Exception>()));
  // Option B (compat): if you choose a default, then:
  // final r = Deployment.fromMap(base);
  // expect(r.providerBranch, isEmpty);
});

33-35: Add explicit toMap assertion for providerBranch in deployment_test.dart

Round‑tripping via toMap()/fromMap() can hide key mismatches — assert the raw map contains providerBranch.

Apply after Line 37 in test/src/models/deployment_test.dart:

       final map = model.toMap();
+      expect(map['providerBranch'], '0.7.x');
       final result = Deployment.fromMap(map);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 16a7403 and 645e739.

📒 Files selected for processing (25)
  • README.md (1 hunks)
  • docs/examples/databases/create-line-attribute.md (1 hunks)
  • docs/examples/databases/create-point-attribute.md (1 hunks)
  • docs/examples/databases/create-polygon-attribute.md (1 hunks)
  • docs/examples/databases/update-line-attribute.md (1 hunks)
  • docs/examples/databases/update-point-attribute.md (1 hunks)
  • docs/examples/databases/update-polygon-attribute.md (1 hunks)
  • docs/examples/tablesdb/create-line-column.md (1 hunks)
  • docs/examples/tablesdb/create-point-column.md (1 hunks)
  • docs/examples/tablesdb/create-polygon-column.md (1 hunks)
  • docs/examples/tablesdb/update-line-column.md (1 hunks)
  • docs/examples/tablesdb/update-point-column.md (1 hunks)
  • docs/examples/tablesdb/update-polygon-column.md (1 hunks)
  • lib/query.dart (1 hunks)
  • lib/src/client_browser.dart (1 hunks)
  • lib/src/client_io.dart (1 hunks)
  • lib/src/models/deployment.dart (4 hunks)
  • lib/src/models/execution.dart (1 hunks)
  • lib/src/models/health_antivirus.dart (1 hunks)
  • lib/src/models/health_status.dart (1 hunks)
  • pubspec.yaml (1 hunks)
  • test/query_test.dart (1 hunks)
  • test/services/functions_test.dart (6 hunks)
  • test/services/sites_test.dart (6 hunks)
  • test/src/models/deployment_test.dart (2 hunks)
🔇 Additional comments (15)
docs/examples/tablesdb/update-line-column.md (1)

15-15: xdefault shape expanded — confirm it matches API contract.

Ensure the API expects a polyline-style array of coordinate pairs and that the coordinate order (lon, lat) is correct in docs.

lib/src/models/health_antivirus.dart (1)

8-8: Doc grammar fix — LGTM.

Clearer field description; no behavior change.

docs/examples/databases/create-line-attribute.md (1)

15-15: Example updated — confirm coordinate semantics.

Validate that triple pair default is acceptable and that docs state coordinate order (lon, lat).

docs/examples/databases/update-point-attribute.md (1)

15-15: Point xdefault changed to [1, 2] — check consistency with other point examples.

Ensure all point attribute/column docs now use a 1D pair and note expected coordinate order.

lib/src/client_browser.dart (1)

33-33: Approve version header bump (18.1.0) — confirm browser platform header

Version header updated to 18.1.0 — approved. 'x-sdk-platform' is set to 'server' in lib/src/client_browser.dart:31 and lib/src/client_io.dart:37; confirm whether 'server' is intentional for the browser client. If intentional, ignore.

pubspec.yaml (1)

2-2: Version set to 18.1.0 — align release artifacts.

  • CHANGELOG.md exists but contains no match for "18.1.0" — add the release notes or confirm the changelog entry.
  • Occurrences already present: pubspec.yaml:2, README.md:26, lib/src/client_browser.dart:33, lib/src/client_io.dart:39,41.
  • Create Git tag v18.1.0 and update CI release workflows to reference 18.1.0.
README.md (1)

26-26: Dependency constraint bumped to ^18.1.0 — OK (internal files consistent)

pubspec.yaml, SDK headers, and README updated. Confirm package 18.1.0 is published on pub.dev before merge/release to avoid install resolution failures.

Locations: pubspec.yaml:2; lib/src/client_io.dart:39,41; lib/src/client_browser.dart:33; README.md:26.

lib/src/client_io.dart (1)

39-41: Unverified — re-run repo search for 18.0.0 occurrences; consider deriving SDK version from pubspec

lib/src/client_io.dart (lines 39–41) sets x-sdk-version/user-agent to 18.1.0; the prior ripgrep run returned "No files were searched", so verification couldn't complete.

Re-run this check to ensure no lingering 18.0.0 or inconsistent headers:

#!/bin/bash
set -euo pipefail
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
  git grep -nE '18\.0\.0|x-sdk-version|AppwriteDartSDK' || true
else
  rg -n --hidden --no-ignore '18\.0\.0|x-sdk-version|AppwriteDartSDK' -g '!**/CHANGELOG*' || true
fi

Non-blocking suggestion: derive 'x-sdk-version' and User-Agent from pubspec.yaml/package version to avoid future drift.

lib/src/models/health_status.dart (1)

11-12: LGTM — typo fix.

Docstring correction reads well; no API/logic change.

docs/examples/tablesdb/update-polygon-column.md (1)

15-15: Polygon xdefault shape looks correct (single ring, closed).

The nesting/closure matches a valid polygon example and aligns with other docs updates.

docs/examples/tablesdb/create-polygon-column.md (1)

15-15: LGTM: polygon example matches expected geometry structure.

Keeps one ring and closes it; consistent with TablesDB polygon expectations.

test/query_test.dart (1)

189-195: Nice coverage for Query.orderRandom().

Asserts null attribute/values and correct method string.

test/services/sites_test.dart (1)

348-349: providerBranch included in deployment fixtures — consistent with model change.

The added field is present across Sites deployment-related tests; order within maps is fine.

Also applies to: 397-398, 441-442, 488-490, 533-535, 606-608

test/services/functions_test.dart (1)

342-344: providerBranch additions look consistent across Functions tests.

Fixtures align with the new Deployment model field.

Also applies to: 391-393, 435-437, 482-484, 527-529, 600-602

lib/query.dart (1)

156-158: Add Query.orderRandom(): API shape is consistent.

No params, emits only method — matches tests. Consider adding a brief note in docs about randomness implications with pagination.

Would you like me to add a short README/docs snippet for orderRandom() usage and caveats?

@abnegate abnegate merged commit 6b754aa into main Sep 25, 2025
1 check 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.

2 participants