Add network_logs_options input (capture network log content for XCUITest)#12
Closed
aditya711-code wants to merge 2 commits into
Closed
Conversation
Adds a boolean step input `network_logs_capture_content` so XCUITest builds can capture the request/response content (bodies) of network logs, not just metadata. Previously this could only be set on local/IDE runs. When enabled, the step sends networkLogsOptions.captureContent in the build payload and automatically enables networkLogs (capture content is only honoured when network logs are on). When disabled/omitted the payload is unchanged (networkLogsOptions is omitted), so it is fully backward compatible. Invalid values fail with a clear, actionable error. - step.yml: new boolean input under "Debug logs" - structs.go: NetworkLogsOptions struct + *NetworkLogsOptions field (omitempty) - util_fns.go: parseCaptureContent helper + wiring in createBuildPayload - constants.go: actionable error string for invalid values - main_test.go: unit tests for parsing and payload shape - README.md: documented the new input AAP-20051 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use a `network_logs_options` JSON input that mirrors the App Automate
`networkLogsOptions` capability (e.g. {"captureContent": true}) instead of a
boolean toggle, so the Bitrise input matches what users already pass on
local/IDE runs and can carry future networkLogsOptions keys.
- step.yml: network_logs_capture_content (bool) -> network_logs_options (JSON)
- util_fns.go: parseCaptureContent -> parseNetworkLogsOptions (json.Unmarshal)
- constants.go: error string updated for invalid JSON
- main_test.go: tests updated for the JSON input
- README.md: input row updated
The wire payload is unchanged: networkLogs:true + networkLogsOptions:{captureContent:true}.
AAP-20051
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Superseded by #13 — direct push access to this repo was granted, so moving to a same-repo PR (clean single commit, runs the repo's checks directly). |
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
network_logs_optionsstep input that mirrors the App AutomatenetworkLogsOptionscapability, so XCUITest builds on BrowserStack App Automate can capture the content (request and response bodies) of network logs — not just metadata such as URLs, headers, latency and status codes.Until now the step exposed only a
network_logson/off toggle, so capture-content could be enabled on local/IDE runs but not when running through this Bitrise step.Usage
The value is the same JSON you would pass as the
networkLogsOptionscapability elsewhere, so it maps 1:1 from local/IDE configurations.Behavior
networkLogsOptionsin the build payload.network_logs, becausenetworkLogsOptionsis only honoured when network logs are enabled (a notice is logged when this happens).networkLogsOptionsis omitted entirely — so the change is fully backward compatible.Changes
step.ymlnetwork_logs_optionsJSON input under "Debug logs"structs.goNetworkLogsOptionsstruct +*NetworkLogsOptionsfield (omitempty) on the payloadutil_fns.goparseNetworkLogsOptionshelper + wiring increateBuildPayload()constants.gomain_test.goREADME.mdTesting
gofmt,go build ./...,go vet ./...,go test ./...all pass.{"captureContent": true/false}, empty, malformed JSON, wrong value type) and payload shape (provided →networkLogs:true+networkLogsOptions.captureContent:true; empty →networkLogsOptionsabsent).Ref: AAP-20051
🤖 Generated with Claude Code