Repository navigation
Preserve Test metadata when reimport fields are omitted - #17054
Open
tayfunozgur13 wants to merge 1 commit into
Open
tayfunozgur13 wants to merge 1 commit into
tayfunozgur13 wants to merge 1 commit into
Conversation
|
This pull request contains a critical finding where a sensitive file in the
🔴 Configured Sensitive Codepath Modified by Non-Allowed Author in
|
| Vulnerability | Configured Sensitive Codepath Modified by Non-Allowed Author |
|---|---|
| Description | File 'dojo/importers/base_importer.py' matches configured sensitive codepath pattern 'dojo/importers/*.py' and was modified by 'tayfunozgur13' (commit 8cec035) who is not in the allowed authors list. |
We've notified @mtesauro.
Comment to provide feedback on these findings.
Report false positive: @dryrunsecurity fp [FINDING ID] [FEEDBACK]
Report low-impact: @dryrunsecurity nit [FINDING ID] [FEEDBACK]
Example: @dryrunsecurity fp drs_90eda195 This code is not user-facing
All finding details can be found in the DryRun Security Dashboard.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #17053.
Reimporting a scan without optional Test metadata currently clears
version,branch_tag,build_id, andcommit_hash.ImporterOptionsdefaults missing values to"", and"".isspace()is false, soBaseImporter.update_test_meta()overwrites existing values. The UI also assigns an empty version before calling the importer.Require a nonblank value before applying each metadata override, and let the importer handle the UI version update. Partial updates now preserve untouched fields. The shared fix also preserves a parser-provided version on an initial SARIF import; an explicit version still takes precedence.
Multipart empty fields continue to behave as omitted fields. Whitespace-only API values still receive HTTP 400, UI whitespace is still normalized as blank, and nonempty importer values retain their original whitespace. No migrations, dependencies, settings, or API schema changes.
Test results
Added
unittests/test_reimport_metadata.pywith 30 behavioral tests covering API and UI omission, empty inputs, individual/combined metadata updates, initial imports, SARIF parser versions, and importer normalization. Before the production fix: 19 failures, 0 errors. With only the shared importer fix: 6 remaining UI failures. With both changes: all 30 pass.Executed through the supported Docker test wrapper:
Also verified against the running local HTTP API: initial import and three reimports returned HTTP 201; GET requests confirmed that omitted/empty metadata is preserved and a version-only update leaves the other three fields intact.
Runtime: Python 3.14.10 and PostgreSQL 18.6 in the existing development containers. Ruff targets Python 3.13; tests were not separately executed on Python 3.13. Django reports the existing development-key and missing node_modules system warnings.
Documentation
Restores the existing reimport help-text contract. No documentation or API schema change is required.
Checklist
devand targetsdev.