🎻 Bard: Document Redaction module and fix broken links#604
Conversation
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
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.
| /// 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> { |
There was a problem hiding this comment.
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 Report❌ Patch coverage is
❌ 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. 🚀 New features to boost your workflow:
|
📖 Chapter: The
Redactionmodule.🔦 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