8000 fix(common,op): the download_web spans of RemoteStorage record the source URL with no credentials by minimal-foundry[bot] · Pull Request #3713 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(common,op): the download_web spans of RemoteStorage record the source URL with no credentials - #3713

Draft
minimal-foundry[bot] wants to merge 1 commit into
mainfrom
agent/2817-the-download-web-spans-of-remotestorage-record-t
Draft

minimal-foundry[bot] wants to merge 1 commit into
mainfrom
agent/2817-the-download-web-spans-of-remotestorage-record-t

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Follow-up

Fixes #2817

Task marker
### D2817 — The download_web spans of RemoteStorage record the source URL with no credentials, no query and no fragment
  kind: task
  size: S
  est: 25 code, 70 tests
  executor: agent
  origin: residual
  epic: 1437
  layers:
    - spans:
      - crates/common/src/remote_storage.rs: Add skip(url) to the instrument attributes of download_web_with_verification_and_caching and download_web_placed, and record fields(url) from the stripped URL. Add a pub stripped_url function and a test that reads the span fields.
      - crates/common/src/lib.rs: Export stripped_url from remote_storage.
      - crates/op/src/specs.rs: stripped_url calls common::stripped_url, so one function strips a URL. strip_urls and its callers in sources.rs stay as they are.
      test: cargo test -p common download_web_spans_record_a_stripped_url
  proof: A subscriber that records span fields shows https://host/path for a source URL that carries user:password@ and a signed query, and the password and the token are not in the span.

Proof

A subscriber that records span fields now shows https://127.0.0.1:/pkg.tar.gz as the url field of both the download_web_with_verification_and_caching span and the download_web_placed span, for a source URL with user:hunter2@, a signed X-Goog-Signature query and a fragment. The password, the token, the query key and the fragment are in no span field.

Notes from the agent: The test uses a small recording tracing::Subscriber written in the test module, because common has no tracing-subscriber dev-dependency and Cargo.toml is not in the layers. The span url field is an Option. It is empty when the text is not a URL. RemoteStorage's other #[tracing::instrument] spans (for example download_with_verification_and_caching) are not changed, because they take a bucket and an object, not a URL. op::specs::stripped_url now calls common::stripped_url. I did not run op's existing stripped_url test, but cargo clippy -p common -p op --all-targets is clean.

Tests

line exit tail
cargo test -p common download_web_spans_record_a_stripped_url 0 running 1 test test remote_storage::span_tests::download_web_spans_record_a_stripped_url ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 91 filtered out; finished in 0.12s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in

Verify

min task run agent-verify exited 100, so this PR is a draft.

me and age are named
    ok
    ok   - report.json carries every key and every gate row has value, baseline, threshold and result
    ok   - changed crates carry new hits and deltas against the baseline
    ok   - only the strict hit on a changed line is new; the untouched one on line 22 is not
    ok   - the hit is listed as path:line [code]
    ok   - promotable lints are carried
    ok   - collectors that did not run are listed
    == step_summary_is_appended ==
    ok   - existing content is kept
    ok   - the Markdown report is appended
    ok   - appended bytes are report.md
    ok   - an unwritable summary path does not stop the report
    ok   - the summary variable does not change the report
    == gate_runs_without_rustc ==
    ok   - the gate exits 0 with rustc and cargo-clippy unusable
    ok   - neither rustc nor cargo-clippy was invoked
    ok   - stdout ends with the verdict, the report path and its sha256
    ok   - the sha256 is report.json's
    ok   - the snapshot records gate mode
    ok   - the compiling collectors and cargo-shear are recorded as not measured
    == darwin_scope_lists_uncovered_crates_in_report ==
    ok   - the changed crate the pinned scope left out is listed
    ok   - the report names the pinned scope
    ok   - the report lists decode under Scope
    ok   - an uncovered crate's strict hits read as not measured, not zero
    ok   - no promotable list from a partial scope
    ok   - a scoped ratchet re-sums the baseline over the same crates
    == gate_fits_probe_budget ==
    ok   - the gate over the real tree took 1s, inside the 300 s probe budget
    ok   - the gate wrote its report (exit 0)
    ok   - the evidence line is last on stdout
    == clippy_strict_unchanged ==
    ok   - a strict hit on a changed line exits 2
    ok   - the hit is printed as path:line: message [code]
    ok   - the guidance follows on stderr
    ok   - the scope is derived from the changed crate
    ok   - a hit on an unchanged line is clean, exit 0
    ok   - no changes since BASE exits 0 before cargo runs
    ok   - a pinned scope says which changed crate it leaves out

    metrics_test: 204 passed, 2 failed
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
        import json,sys; s=json.load(open(sys.argv[1])); print(eval(sys.argv[2]))
                                     ~~~~^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp.EClVVM0qPg/mut/.scratch/nonextest/snapshot.json'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
        import json,sys; s=json.load(open(sys.argv[1])); print(eval(sys.argv[2]))
                                     ~~~~^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp.EClVVM0qPg/mut/.scratch/nonextest/snapshot.json'

    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
error: test run failed

The download_web_with_verification_and_caching and download_web_placed
spans recorded the raw URL, with its credentials, signed query and
fragment. They now skip the argument and record the URL from one shared
stripped_url, which op::specs now calls.
@coderabbitai
coderabbitai Bot commented Nov 20, 2026
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 76b17c02-ed77-4ce8-8c14-d1276773edd3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

This branch has not been deployed

No deployments
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.

Tracing spans record source URLs with credentials (remote_storage download_web*)

0 participants

0