Skip to content

Add anonymization level and upload URL to the debug bundle modal - #753

Open
mlsmaycon wants to merge 1 commit into
mainfrom
debug-bundle-anonymize-level-upload-url
Open

Add anonymization level and upload URL to the debug bundle modal#753
mlsmaycon wants to merge 1 commit into
mainfrom
debug-bundle-anonymize-level-upload-url

Conversation

@mlsmaycon

@mlsmaycon mlsmaycon commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

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 main when omitted.

management-cloud-tag: main
reverse-proxy-tag: main


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added anonymization-level options when creating debug jobs.
    • Added support for specifying an optional HTTPS upload URL.
    • Added validation to ensure upload URLs use HTTPS.
    • Selected settings are included in submitted job requests.

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.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Debug job options

Layer / File(s) Summary
Job parameter contract
src/interfaces/Job.ts
BundleJobParameters now defines optional anonymize_level and upload_url properties.
Debug job modal controls
src/modules/jobs/CreateDebugJobModal.tsx
The modal adds anonymization selection and upload URL controls. It validates non-empty HTTPS URLs with hosts and includes the selected values in requests.

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

Poem

A rabbit taps the upload key,
“Strict” or “Default,” choices free.
HTTPS keeps the path secure,
Trimmed requests go hopping pure.
The debug job sails away!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change to the Create Debug Job modal.
Description check ✅ Passed The description includes the issue link, documentation selection and explanation, dependency, change summary, and E2E configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch debug-bundle-anonymize-level-upload-url

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/interfaces/Job.ts

Oops! Something went wrong! :(

ESLint: 9.39.5

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.json
at JSON.stringify ()
at /node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3123:19)
at ConfigArrayFactory._loadConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3088:21)
at ConfigArrayFactory._loadExtendedShareableConfig (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3393:21)
at ConfigArrayFactory._loadExtends (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

src/modules/jobs/CreateDebugJobModal.tsx

Oops! Something went wrong! :(

ESLint: 9.39.5

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.json
at JSON.stringify ()
at /node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3123:19)
at ConfigArrayFactory._loadConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3088:21)
at ConfigArrayFactory._loadExtendedShareableConfig (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3393:21)
at ConfigArrayFactory._loadExtends (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)


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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a92816b and 79fa359.

📒 Files selected for processing (2)
  • src/interfaces/Job.ts
  • src/modules/jobs/CreateDebugJobModal.tsx

type: "bundle",
parameters: {
anonymize,
anonymize_level: anonymize ? anonymizeLevel : undefined,

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.

🎯 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.

Suggested change
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.

@linear-code

linear-code Bot commented Aug 11, 2026

Copy link
Copy Markdown

NET-1488

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