feat: support custom sourcemap intake endpoint for private deployments#5
Merged
Merged
Conversation
Add a `sourcemapEndpoint` option so mapping files can be uploaded to a self-hosted RUM ingest instead of the predefined Flashcat sites. The endpoint can be set three ways, with precedence extension DSL > flashcat-ci.json > FLASHCAT_SOURCEMAP_INTAKE_URL env var. When the value omits the `/sourcemap/upload` path it is appended automatically. Consistency & correctness: - Align the env-vs-CI precedence for `sourcemapEndpoint` with the existing `site` resolution order (extension > CI config > env), instead of the previous extension > env > CI ordering. - When a custom endpoint is in use, skip the API-key validation call against the predefined site's `api.*` host (its validate URL is unknown for a private deployment) and report errors against the actual upload endpoint rather than the misleading site hostname. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Adds a
sourcemapEndpointoption to the plugin so ProGuard/R8 mapping files can be uploaded to a self-hosted RUM ingest (private deployment) instead of only the predefined Flashcat sites (CN/STAGING).The endpoint can be provided three ways, resolved with the precedence extension DSL >
flashcat-ci.json>FLASHCAT_SOURCEMAP_INTAKE_URLenv var. If the value omits the/sourcemap/uploadpath it is appended automatically (trailing slashes / surrounding whitespace are tolerated).flashcat { sourcemapEndpoint = "https://rum.example.com" // -> https://rum.example.com/sourcemap/upload }Why these two extra fixes
While verifying the feature two issues surfaced:
Inconsistent precedence.
sourcemapEndpointresolved env before the CI config file (env wins), whereassiteresolves CI config before env (CI wins). A user setting both an env var andflashcat-ci.jsonwould get opposite behavior for the two settings. AlignedsourcemapEndpointto the existingsiteorder: extension > CI config > env.API-key validation / error pointed at the public site host. On an upload error the plugin validated the API key against
https://api.<site>/api/v1/validateand reportedsite=<public host>— wrong for a private deployment on a different host. Now, when a custom endpoint is in use, the validation call is skipped (the validate URL for a private deployment is unknown) and errors reference the actual upload endpoint.Tests
OkHttpUploaderTest(24): custom-endpoint upload, path resolution (resolveSourcemapUploadEndpoint), plus new cases for custom-endpoint403(→InvalidApiKeyException, no validation request) and400(validation skipped).MappingFileUploadTaskTest(26): three resolution sources + precedence; flipped the env-vs-CI test to assert CI now wins.DdAndroidGradlePluginTest(34): config wiring.All 84 tests pass locally (
failures=0, errors=0).Docs
README.mdand快速开始.mdupdated with the new option, env var, andflashcat-ci.jsonkey.🤖 Generated with Claude Code