Skip to content

fix(engine): preserve bare schemes in redacted errors - #1722

Closed
teaphile wants to merge 1 commit into
opengeos:mainfrom
teaphile:fix/bare-scheme-error-notices
Closed

teaphile wants to merge 1 commit into
opengeos:mainfrom
teaphile:fix/bare-scheme-error-notices

Conversation

@teaphile

@teaphile teaphile commented Nov 10, 2026 •

Copy link
Copy Markdown

Summary

redact_text treated a bare scheme in error text (http://, https://, s3://) or an ellipsis placeholder ("https://…") as an address and redacted it, mangling hints like "give an http://, https:// or s3:// address". A word whose address part after :// is empty or … is now left untouched; real addresses are still redacted (credentials and secret query parameters removed).

Testing

  • New unit test sources::tests::error_text_keeps_bare_schemes_but_redacts_addresses: prose hints and placeholders survive unchanged; user:pw@ and ?token= are still stripped from real URLs next to bare schemes.
  • New engine test tests::add_url_error_keeps_bare_schemes: the layer.addUrl error for a local path reads correctly.
  • cargo test -p rustgis-engine --lib -- bare_scheme passes.

UI evidence

No visible UI change.

Related issue

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Text redaction now preserves bare web-address schemes and placeholders ending in an ellipsis, while continuing to redact other addresses.
    • Passing a local file path where a web or cloud address is required produces a message explaining the accepted address formats and where to add files.

Keep scheme-only examples and ellipsis placeholders intact in error text, while still redacting credentials from real addresses.

Cover prose hints, secret-bearing URLs, and the layer.addUrl error path.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 11:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change updates diagnostic text redaction to preserve bare URL schemes and ellipsis placeholders. Tests cover redaction of complete addresses and the error returned by layer.addUrl for a Windows-style file path.

Changes: Diagnostic text handling

Layer / File(s) Summary
Preserve scheme text in diagnostics
crates/engine/src/sources.rs, crates/engine/src/tests.rs
redact_text leaves bare schemes and https://… placeholders unchanged while continuing to redact complete addresses. Tests cover credentials, query tokens, and the expected layer.addUrl error for a Windows-style file path.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

  • opengeos/RustGIS#1661: This PR changes the same redact_text behavior for bare schemes and ellipsis placeholders.
  • opengeos/RustGIS#1501: This PR changes address-aware diagnostic redaction, including scheme-only text and bare-scheme error outputs.

Suggested reviewers: deniial00

Merge Risk: Minimal · up to 8dada

Bare scheme hints are preserved in the tested error path, with no material merge risk identified.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed

Check name Status Explanation
Title check Passed The title clearly summarizes the primary change: preserving bare schemes in redacted error text.
Description check Passed The description includes a clear summary, specific test details, and the required UI evidence statement. The Related issue section does not identify an issue, but this is non-critical.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (1 skipped: 1 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks each link with care
Bare schemes stay just as they are
Real secrets fade from view
Ellipsis marks stay true
And file paths get errors clear

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a156f815-34e9-49e9-bb98-87d33645df38
Commits

Reviewing files that changed from the base of the PR and between 4a7e37f and 8dadac3.

Files selected for processing: 2

  • crates/engine/src/sources.rs
  • crates/engine/src/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@teaphile

Copy link
Copy Markdown
Author

Closing as a duplicate: #1661 already fixed this (bare schemes and https://… placeholders kept in error text), with the same layer.addUrl test.

@teaphile teaphile closed this Nov 10, 2026
@teaphile
teaphile deleted the fix/bare-scheme-error-notices branch November 10, 2026 11:26
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.

2 participants