Skip to content

[Troubleshoot] Test CI Failure with #23028 focusing on Detekt#23033

Closed
ParaskP7 wants to merge 7 commits into
release/26.9from
cherry-pick/media-upload-error-mapping-26.9-test
Closed

[Troubleshoot] Test CI Failure with #23028 focusing on Detekt#23033
ParaskP7 wants to merge 7 commits into
release/26.9from
cherry-pick/media-upload-error-mapping-26.9-test

Conversation

@ParaskP7

Copy link
Copy Markdown
Contributor

Description

Testing instructions

adalpari and others added 3 commits June 23, 2026 09:12
* Map rs media upload failures to specific error types

The Application-Password REST upload path collapsed four distinct rs
failures (HTTP status, WpError, execution failure, unknown) into a single
GENERIC_ERROR, hiding the cause and showing users an unhelpful generic
snackbar. Map by HTTP status and transport reason, and record
status/code/reason in logMessage so reports are diagnosable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Satisfy detekt: extract error-parsing helpers and suppress LargeClass

Split parseMediaError's network-error branches into small helper functions
to stay under the LongMethod and CyclomaticComplexity thresholds, and mark
the growing test class with @Suppress("LargeClass") to match the sibling
TaxonomyRsApiRestClientTest.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Extract shared buildMediaError helper to dedupe error parsers

The four parse* helpers repeated the same MediaError.apply construction.
Centralize it in buildMediaError, which also unifies the nullable
statusCode handling. No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Reuse MediaErrorType.fromHttpStatusCode and align 403 handling

Replace the duplicated private HTTP-status mapper in MediaRSApiRestClient
with the canonical MediaErrorType.fromHttpStatusCode, reconciling 403 to
NOT_AUTHENTICATED (was AUTHORIZATION_REQUIRED) and restoring 400 ->
BAD_REQUEST. Generalize fromHttpStatusCode's 500 case to the full 5xx
range and make the execution-reason mapping exhaustive so new upstream
RequestExecutionErrorReason variants surface as compile errors.

Extend NOT_AUTHENTICATED handling through EditPostActivity,
GutenbergKitActivity, and WPMediaUtils so 403s still show the
no-permission message. Add tests for the 5xx range and forbidden
execution reason.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

ParaskP7 added 4 commits June 23, 2026 20:54
Prepend internal Reposilite proxy (http://10.0.2.215:8080/maven-central)
to dependencyResolutionManagement repositories, guarded by
gradle.ext.isCi. Enable allowInsecureProtocol since the mirror is served
over plain HTTP.

FYI: Copy-pasted commit from #23018.
@wpmobilebot

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr23033-b9ded87
Build Number1497
Application IDcom.jetpack.android.prealpha
Commitb9ded87
Installation URL712lk2v8qao1g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr23033-b9ded87
Build Number1497
Application IDorg.wordpress.android.prealpha
Commitb9ded87
Installation URL06pkv9lbk2ia8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Base automatically changed from cherry-pick/media-upload-error-mapping-26.9 to release/26.9 June 24, 2026 11:35
@ParaskP7 ParaskP7 closed this Jun 24, 2026
@ParaskP7 ParaskP7 deleted the cherry-pick/media-upload-error-mapping-26.9-test branch June 24, 2026 13:51
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.

4 participants