fix(migrations): report membership counts - #13598
Open
HarshMN2345 wants to merge 2 commits into
Open
Conversation
The Appwrite source counts memberships per team while building a report, but the response model had no rule for them, so the count was computed and then dropped on the way out. A report therefore showed teams with nothing behind them, and a caller sizing up a migration had no way to see how many memberships it would move.
Contributor
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Checking the model's rules only proved the key was configured; it would have stayed green if the count were dropped or reshaped on the way out. Serialize a report instead and read the count back off the payload.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
MigrationReporthad no rule for memberships, so the count the Appwrite source already computes was dropped on the way out.The source counts memberships per team while building a report (
reportAuthwalks each team and addslistMemberships(...)->total), but with noaddRulefor it the value never reaches the response. A report came back showing teams with nothing behind them, and a caller sizing up a migration had no way to see how many memberships it would move.Observed against a real 1.9.6 source — the response carried
user,team,provider,topic,subscriberandmessage, and nomembershipkey at all despite it being requested:Changes
MigrationReport.php— oneaddRuleforResource::TYPE_MEMBERSHIP, next to the team rule it belongs with.tests/unit/Utopia/Response/Model/MigrationReportTest.php— new, followingExecutionTest.Testing
vendor/bin/phpunit tests/unit/Utopia/Response/Model/MigrationReportTest.php— passes, and fails without the rulecomposer lint— passed on both filesphpstan --level 4on both files — no errorsNote
This adds a field to a response model, so the API specs want regenerating before release. The
Generate Specsworkflow isworkflow_dispatch-only and publishes toappwrite/specs, so I have left it alone rather than running it from a PR branch.