Skip to content

fix: make v3 wiki migration resumable#620

Merged
NagariaHussain merged 3 commits intofrappe:developfrom
NagariaHussain:fix/v3-migration-idempotency
May 7, 2026
Merged

fix: make v3 wiki migration resumable#620
NagariaHussain merged 3 commits intofrappe:developfrom
NagariaHussain:fix/v3-migration-idempotency

Conversation

@NagariaHussain
Copy link
Copy Markdown
Collaborator

@NagariaHussain NagariaHussain commented May 7, 2026

Summary

  • make wiki page -> wiki document v3 migration resumable instead of treating root_group as a completion marker
  • upsert migrated wiki documents by route so reruns repair partial migrations instead of skipping or duplicating rows
  • add regression coverage for reruns, partial migrations, existing-route upserts, and patch execution when root_group already exists

Testing

  • bench --site wiki.localhost run-tests --module wiki.wiki.doctype.wiki_space.test_wiki_space

Summary by CodeRabbit

  • New Features

    • Improved Version 3 migration with idempotent and resumable behavior
    • Enhanced document synchronization that upserts existing records instead of creating duplicates
  • Bug Fixes

    • Updated migration button visibility in wiki space forms based on sidebar status
  • Tests

    • Added comprehensive migration test coverage for idempotence, recovery scenarios, and data consistency during migration

@NagariaHussain NagariaHussain merged commit b76af1e into frappe:develop May 7, 2026
5 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Warning

Rate limit exceeded

@NagariaHussain has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 38 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 431362f7-718b-4569-b72e-7e3629a93e99

📥 Commits

Reviewing files that changed from the base of the PR and between 1e80dfa and 035f423.

📒 Files selected for processing (1)
  • wiki/patches.txt

Walkthrough

This PR refactors the wiki document migration system from a destructive insert-only pattern to an idempotent route-based upsert pattern. WikiPage._migrate_to_wiki_document now accepts optional parent and sort order parameters, checks for existing documents by route, and either updates them or creates new ones. WikiSpace migration delegates to this method for both groups and pages, including an early-return guard if the root group already exists. Migration patches now process all records instead of filtering for orphans, relying on the upsert logic to prevent duplicates. UI visibility logic changes to trigger migration based on sidebar entries rather than root group state. Comprehensive tests validate that migrations are idempotent, can repair partial state, and work correctly with the broader record scope.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% 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 'fix: make v3 wiki migration resumable' directly and accurately summarizes the main objective of the changeset: refactoring the wiki v3 migration to be resumable by enabling document upserts and removing the root_group completion marker.
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.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

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