Skip to content

🎻 Bard: Document Redaction module and fix broken links#604

Open
madmax983 wants to merge 1 commit into
trunkfrom
jules-17573055805411712321-d1ac1061
Open

🎻 Bard: Document Redaction module and fix broken links#604
madmax983 wants to merge 1 commit into
trunkfrom
jules-17573055805411712321-d1ac1061

Conversation

@madmax983
Copy link
Copy Markdown
Owner

📖 Chapter: The Redaction module.
🔦 Insight: Clarified the purpose and usage of Redactor initialization and redaction methods, and resolved broken intra-doc links across the codebase.
🧪 Example: Added multiple executable doctests for Redactor::from_config, Redactor::default_enabled, and others.
🖼️ Preview: Documentation is now fully rendering without broken links.


PR created automatically by Jules for task 17573055805411712321 started by @madmax983

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request primarily improves documentation across several modules, adding detailed doc comments and examples to Redactor methods in src/redaction.rs, fixing broken intra-doc links, and formatting ranges. It also includes minor code cleanups, such as simplifying a socket read loop in swebench.rs and refactoring helper methods in sweep_webhook.rs tests. Feedback is provided regarding the placement of the #[must_use] attribute in src/redaction.rs, which is currently interleaved between doc comments and should be moved directly above the function signature to ensure proper documentation generation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/redaction.rs
Comment on lines 1009 to 1025
/// applies the *same* sensitive-key rule when walking JSON artifacts. Returns
/// the value-kind label (e.g. `"env_password"`) or `None` for a benign key.
#[must_use]
/// Detect if a given JSON key name suggests it holds a sensitive value.
///
/// Returns `Some(kind)` with a label like `"password"` or `"api_key"` if the key contains
/// terms implying it's a secret. Returns `None` if the key appears safe.
///
/// ## Examples
///
/// ```
/// use maxwells_daemon::redaction::sensitive_json_key_kind;
///
/// assert!(sensitive_json_key_kind("github_token").is_some());
/// assert!(sensitive_json_key_kind("user_name").is_none());
/// ```
pub fn sensitive_json_key_kind(key: &str) -> Option<&'static str> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The #[must_use] attribute is currently placed between two blocks of doc comments. In Rust, all doc comments for an item should be contiguous and placed before other attributes (or at least not interleaved) to ensure they are correctly parsed as a single documentation block by rustdoc and IDEs. Please move the #[must_use] attribute to be directly above the function signature, after the doc comments.

/// applies the *same* sensitive-key rule when walking JSON artifacts. Returns
/// the value-kind label (e.g. "env_password") or None for a benign key.
///
/// Detect if a given JSON key name suggests it holds a sensitive value.
///
/// Returns Some(kind) with a label like "password" or "api_key" if the key contains
/// terms implying it's a secret. Returns None if the key appears safe.
#[must_use]
pub fn sensitive_json_key_kind(key: &str) -> Option<&'static str> {

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.19%. Comparing base (9aa2ad9) to head (4052362).

Files with missing lines Patch % Lines
src/stream/sweep_webhook.rs 33.33% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk     #604      +/-   ##
==========================================
- Coverage   85.19%   85.19%   -0.01%     
==========================================
  Files         114      114              
  Lines       65408    65406       -2     
==========================================
- Hits        55725    55722       -3     
- Misses       9683     9684       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant