-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adopt to the breaking changes in WordPressOrgRestApi #22612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0b17477
Update WordPressKit
crazytonyli 7d4a72e
Adopt to the breaking changes in WordPressOrgRestApi
crazytonyli aebe3f9
Rename `Blog.wordPressOrgRestApi` to `selfHostedSiteRestApi`
crazytonyli bb220fd
Remove unused functions
crazytonyli f5afa99
Update BlockEditorSettingsService tests
crazytonyli 8b828ae
Add a release note
crazytonyli 73fef12
Fix flaky unit tests caused by randomly generated `dotComID`
crazytonyli 18d8382
Log error into test failures
crazytonyli 876b975
Throw on nil value
crazytonyli a3d03a6
Do not use mock in a CommentService unit test
crazytonyli c8f27c5
Merge branch 'trunk' into wordpresskit-error-refactor
crazytonyli 9ab9cf3
Use a WordPressKit version that should fix the Reader loading issues
mokagio 57cd3ab
Update WordPressKit
crazytonyli e0d3744
Use WP.com API url from AppEnvironment
crazytonyli 44e0507
Merge branch 'trunk' into wordpresskit-error-refactor
crazytonyli e01a8db
Use new `PluginDirectoryServiceRemote` API
crazytonyli 5407c04
Move a release note to the next release
crazytonyli 3de5c2f
Add a comment about `GutenbergNetworkRequest.path`
crazytonyli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
24.4 | ||
----- | ||
|
||
* [**] [internal] Refactored .org REST API calls. [#22612] | ||
|
||
24.3 | ||
----- | ||
|
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mokagio @tiagomar I think I have found the root cause of the
testAddGalleryBlock
failure: .org REST API calls stopped using API-Mocks in this PR. We used to use aWordPressComRestApi
instance, which can be mocked by UI tests API-Mocks. But the newWordPressOrgRestApi
doesn't support that. I'll just need to add that support back by allowing passing a custom "api base URL", which can be set to mock server url during UI tests.Here are some details about the issue.
As @tiagomar has pointed out, the "html content" is different: one use images block and the other use a gallery block. This variable here dictates which block to use. It's part of a protocol defined in Gutenberg Mobile. One place, which appears to be the only place in UI tests, that makes Gutenberg Mobile calls this variable is successfully fetching and updating editor settings, which sends a .org REST API call. As I mentioned before, this PR breaks API mocks for .org REST API calls, which results in a fetching editor settings failure, which ultimately leads the editor produces a different html content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed in wordpress-mobile/WordPressKit-iOS#731
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think being able to customize the base URL is good design regardless, even if 99% of the usages will be with the default one configured in the library.