Add anonymization level and upload URL to the debug bundle modal - #753
Add anonymization level and upload URL to the debug bundle modal#753mlsmaycon wants to merge 1 commit into
Conversation
Surfaces the two bundle parameters added to the management API: an anonymization level (Default/Strict, shown when anonymization is enabled) and an optional upload service URL that overrides the default upload server. The upload URL is validated as an https URL before the job can be submitted; both fields are omitted from the request when left at their defaults so the peer applies its own.
📝 WalkthroughWalkthroughThe debug job parameter interface now supports optional anonymization levels and upload URLs. The debug job modal adds controls for both values, validates HTTPS upload URLs, and includes valid values in job requests. ChangesDebug job options
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/interfaces/Job.tsOops! Something went wrong! :( ESLint: 9.39.5 TypeError: Converting circular structure to JSON src/modules/jobs/CreateDebugJobModal.tsxOops! Something went wrong! :( ESLint: 9.39.5 TypeError: Converting circular structure to JSON 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/modules/jobs/CreateDebugJobModal.tsx`:
- Line 90: Update the payload construction around anonymizeLevel so
anonymize_level is omitted when anonymize is enabled but the user leaves the
Default selection; only send an explicit anonymization level for non-default
choices, while preserving omission when anonymization is disabled.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 718464f5-f28c-41ae-93d2-7d208f39cccb
📒 Files selected for processing (2)
src/interfaces/Job.tssrc/modules/jobs/CreateDebugJobModal.tsx
| type: "bundle", | ||
| parameters: { | ||
| anonymize, | ||
| anonymize_level: anonymize ? anonymizeLevel : undefined, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Omit the default anonymization level.
When anonymize is enabled and the user keeps the Default selection, this sends "default" instead of omitting anonymize_level. This prevents the peer from applying its own default.
Proposed fix
- anonymize_level: anonymize ? anonymizeLevel : undefined,
+ anonymize_level:
+ anonymize && anonymizeLevel !== "default"
+ ? anonymizeLevel
+ : undefined,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| anonymize_level: anonymize ? anonymizeLevel : undefined, | |
| anonymize_level: | |
| anonymize && anonymizeLevel !== "default" | |
| ? anonymizeLevel | |
| : undefined, |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/modules/jobs/CreateDebugJobModal.tsx` at line 90, Update the payload
construction around anonymizeLevel so anonymize_level is omitted when anonymize
is enabled but the user leaves the Default selection; only send an explicit
anonymization level for non-default choices, while preserving omission when
anonymization is disabled.
Surfaces the two bundle parameters added to the management API in the Create Debug Job modal: an anonymization level (Default/Strict, shown when anonymization is enabled) and an optional upload service URL that overrides the default upload server. The upload URL is validated as an https URL before the job can be submitted; both fields are omitted from the request when left at their defaults so the peer applies its own.
Depends on the management API change in netbirdio/netbird#7147.
Issue ticket number and link
https://linear.app/netbird/issue/NET-1488/dashboard-anonymization-level-upload-url-in-create-debug-job-modal (parent NET-1484)
Documentation
Select exactly one:
UI-only change exposing two optional fields already described by the management OpenAPI schema (added in #7147).
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
N/A
E2E tests
Optional: override the image tags used by the Playwright e2e workflow.
Defaults to
mainwhen omitted.management-cloud-tag: main
reverse-proxy-tag: main
Generated by Claude Code
Summary by CodeRabbit