Skip to content

Nextcloud 34 prep (CI/README) + Postgres integration-test stability#54

Merged
oleksandr-nc merged 3 commits into
mainfrom
feature/nextcloud-34-ci-prep
May 29, 2026
Merged

Nextcloud 34 prep (CI/README) + Postgres integration-test stability#54
oleksandr-nc merged 3 commits into
mainfrom
feature/nextcloud-34-ci-prep

Conversation

@oleksandr-nc
Copy link
Copy Markdown
Contributor

@oleksandr-nc oleksandr-nc commented May 29, 2026

Summary

Two related changes.

1. Nextcloud 34 prep (CI + README)

NC34 GA is 2026-06-09. The official nextcloud:34 Docker image isn't published yet (docker manifest inspect nextcloud:34no such manifest; Docker Hub's newest is 33.0.3), so adding 34 to the integration matrix now would fail CI on image pull.

  • CI (tests-integration.yml): matrix stays ["32", "33"] — the two newest released versions. Added a dated comment marking where to add "34" / drop "32" once the image publishes.
  • README: documents the "two newest released versions" policy and that NC34 (GA 2026-06-09) joins the matrix when its image is published.

The actual flip (matrix → ["33", "34"], badge → 33 | 34) lands at GA, following the rolling-window precedent (2c66ff1, which replaced EOL NC31 with NC33). NC32 keeps security support until ~Sept 2026, so it stays until 34 is wired in.

2. Integration test stability on PostgreSQL

The dev instances run PostgreSQL; these remove flakiness that surfaces there (and harden the suite for the bare-metal-Postgres CI effort, #28):

  • test_search.py::test_search_pagination — NC's FilesSearchProvider issues its DB query without an ORDER BY, so on Postgres LIMIT/OFFSET pages can skip or overlap rows; full enumeration of the seeded files isn't guaranteed. Rewrote the test to assert the pagination contract (limit respected, cursor advances, follow-up pages keep returning results, paging surfaces more than one page of distinct results) instead of near-total coverage. (SQLite happens to be stable by insertion order, which is why the old assertion passed in CI but failed on Postgres.)
  • seed_pagination_data.py — idempotent comment seeding with 1.05s timestamp spacing, so comment pagination is stable.
  • test_pagination.py — event-seeding idempotency keyed on the summary, not the server-generated UID (prevents duplicate accumulation across runs).
  • test_user_status.py — leak-free cleanup of the fresh test user via the admin client (the prior cleanup leaked it once create_server swapped the global client).

Verification

CI is green on NC 32 + 33 (SQLite). Locally, against the PostgreSQL dev instances, the full suite previously ran 834 passed, 1 failed on both NC34 (RC1) and NC35 (master/dev) — the single failure being this test_search_pagination. With the fix, test_search.py now passes 17/17 on both NC34 and NC35 (re-run on Postgres), clearing that failure; ruff + pyright clean.

(The mail and session_cache suites are excluded locally — they need CI-specific SMTP / regular-password setup.)

Summary by CodeRabbit

  • Documentation

    • Clarified CI integration test procedures and current Nextcloud version support details.
  • Tests

    • Enhanced pagination and event creation stability in integration test suite.

Review Change Stack

…il nextcloud:34 image publishes (GA 2026-06-09)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

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

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

Your organization has run out of usage credits. Purchase more in the billing tab.

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

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e664111-aa7a-4788-9587-91287619436d

📥 Commits

Reviewing files that changed from the base of the PR and between 8f77315 and 1d5f311.

📒 Files selected for processing (2)
  • tests/integration/test_pagination.py
  • tests/integration/test_search.py
📝 Walkthrough

Walkthrough

Clarifies CI wording about testing the two newest Nextcloud releases (currently 32 and 33) and notes Nextcloud 34 will be added when its Docker image is published. Adds idempotent, timestamp-stable comment seeding and updates integration tests for pagination, event creation, and user-status cleanup.

Changes

CI Version Support Documentation

Layer / File(s) Summary
Nextcloud version support in CI and docs
.github/workflows/tests-integration.yml, README.md
Workflow comment and README now state integration tests run against the two newest released Nextcloud versions and note Nextcloud 34 inclusion once its Docker image is available.

Integration test stability and pagination

Layer / File(s) Summary
Comment seeding and fetch helper
scripts/seed_pagination_data.py
Adds time import, introduces _fetch_all_comments to fetch comments via DAV REPORT with offset pagination, and updates seed_comments to detect existing message/timestamp sets, delete stale comments, and recreate comments with ~1.05s spacing for stable pagination.
Calendar event idempotency in pagination tests
tests/integration/test_pagination.py
Changes _ensure_pagination_events to detect existing events by summary and increases the initial get_events query limit to reduce unnecessary creation.
Unified search pagination contract test
tests/integration/test_search.py
Replaces two-page overlap check with a cursor-following pagination contract: verifies per-page limit, conditional skip if single page, cursor advancement, and that more than limit distinct titles appear across pages.
User status test cleanup change
tests/integration/test_user_status.py
Adds comments about client singleton swapping and changes cleanup to call nc_mcp.client.ocs_delete(...) directly for the temporary test user.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit hops through test and seed,
Spacing comments so pages read,
Docs whisper versions, near and far,
When thirty-four arrives we'll star,
🐇 CI and tests aligned, indeed.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Nextcloud 34 prep (CI/README) + Postgres integration-test stability' accurately reflects the main changes: Nextcloud 34 preparation (CI workflow and README updates) and Postgres integration test stability improvements (pagination, search, user-status tests).
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/nextcloud-34-ci-prep

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.

@oleksandr-nc oleksandr-nc marked this pull request as ready for review May 29, 2026 12:21
@oleksandr-nc
Copy link
Copy Markdown
Contributor Author

(AI) Ready for review — all CI green (lint+types, unit on 3.12/3.13/3.14, and integration + session-cache + user-permissions on NC 32 & 33).

Scope: intentionally minimal. nextcloud:34 isn't on Docker Hub yet (NC34 GA is 2026-06-09), so this PR keeps the matrix on 32+33 and only documents the plan. The matrix→[33,34] and badge→33|34 flip lands at GA when the image publishes.

Local verification (dev instances, PostgreSQL):

  • NC34 (34.0.0 RC1): 834 passed, 1 failed
  • NC35 (master/dev): 834 passed, 1 failed

The single failure is identical on both versions — test_search.py::test_search_pagination (48–49/55 vs. a ≥50 threshold). It lives in unrelated, uncommitted local WIP, not in this PR or in CI: it's the well-known Postgres behavior of LIMIT/OFFSET without ORDER BY skipping rows. The committed/CI version of that test asserts differently and runs on SQLite (green above). So this is a test-threshold artifact, not a server regression on NC34 or NC35.

@oleksandr-nc oleksandr-nc changed the title Note upcoming Nextcloud 34 support in CI/README; flip matrix to 33+34 at GA (2026-06-09) Nextcloud 34 prep (CI/README) + Postgres integration-test stability May 29, 2026
Copy link
Copy Markdown

@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: 2

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

Inline comments:
In `@tests/integration/test_pagination.py`:
- Around line 60-69: The test currently fetches only the first page (limit=500)
via nc_mcp.call("get_events") and builds existing_summaries from result["data"],
which misses events beyond that page; change the helper to paginate: repeatedly
call nc_mcp.call("get_events") (using the response's pagination token/has_more
flag and whatever next_cursor/offset the API returns) appending result["data"]
into existing_summaries until has_more is false or all expected summaries (e.g.
all "Pagination Test Event ###") are found, then proceed with assertions; update
the logic that reads result["has_more"] and result["next_cursor"] (or
equivalent) and merge summaries rather than capping at a single 500-item call.

In `@tests/integration/test_search.py`:
- Around line 112-130: The test currently casts first["cursor"] and
data["cursor"] to str even when has_more is true, which masks None as "None";
update the loop in tests/integration/test_search.py (the block using first,
data, cursor, next_cursor, and has_more) to assert that a cursor is present
whenever has_more is true (e.g., assert first["cursor"] is not None before
assigning cursor and assert data["cursor"] is not None whenever data["has_more"]
is True) so the test fails if the API advertises more pages without returning a
cursor.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bb7420ac-0de8-400a-acf2-2ab90fa85e14

📥 Commits

Reviewing files that changed from the base of the PR and between 1bd923e and 8f77315.

📒 Files selected for processing (4)
  • scripts/seed_pagination_data.py
  • tests/integration/test_pagination.py
  • tests/integration/test_search.py
  • tests/integration/test_user_status.py

Comment thread tests/integration/test_pagination.py Outdated
Comment thread tests/integration/test_search.py
@oleksandr-nc oleksandr-nc merged commit dd9b83b into main May 29, 2026
12 checks passed
@oleksandr-nc oleksandr-nc deleted the feature/nextcloud-34-ci-prep branch May 29, 2026 16:42
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