fix: relabel finding Asset-tag (AND) filter to v3 Asset vocabulary#15136
Open
stevewallone wants to merge 1 commit into
Open
fix: relabel finding Asset-tag (AND) filter to v3 Asset vocabulary#15136stevewallone wants to merge 1 commit into
stevewallone wants to merge 1 commit into
Conversation
The v3 Product->Asset relabel (DefectDojo#13155) centralises filter copy in dojo/asset/labels.py, gated by ENABLE_V3_ORGANIZATION_ASSET_RELABEL (default on). The Asset-level AND tag filter on the finding list (test__engagement__product__tags_and) was left with a hardcoded "Product Tags (AND)" label and help text, so it kept the legacy wording even with the relabel enabled -- inconsistent with its siblings "Test Tags (AND)" / "Engagement Tags (AND)" and with the OR variant, whose label is already set dynamically to "Tags (Asset)". Wire it to the edition-aware labels by adding ASSET_FILTERS_TAGS_ASSET_AND_LABEL and ASSET_FILTERS_TAGS_ASSET_AND_HELP to both vocabulary branches, so the field reads "Asset Tags (AND)" in v3 and remains "Product Tags (AND)" in the legacy edition. Adds a regression test asserting the rendered FindingFilter form field. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
The v3 Product→Asset relabel (#13155) centralises filter copy in
dojo/asset/labels.py, gated byENABLE_V3_ORGANIZATION_ASSET_RELABEL(default on). The Asset-level AND tag filter on the finding list (test__engagement__product__tags_andinFindingTagFilter) was left with a hardcoded"Product Tags (AND)"label and help text, so it kept the legacy wording even with the relabel enabled — inconsistent with:Test Tags (AND)/Engagement Tags (AND), andTags (Asset).This wires the AND field to the edition-aware labels by adding
ASSET_FILTERS_TAGS_ASSET_AND_LABELandASSET_FILTERS_TAGS_ASSET_AND_HELPto both vocabulary branches, so the field renders:Asset Tags (AND)— help text "Filter Findings by the selected Asset tags (AND logic)"Product Tags (AND)— unchangedThe OR variant (
test__engagement__product__tags) is intentionally left untouched: its label is set dynamically at render time byget_tags_label_from_model()→Tags (Asset), which already overrides any static declaration.Test results
Adds a regression test
unittests/test_filter_asset_tag_labels.pythat asserts the renderedFindingFilterform field (not the static declaredlabel=, which the dynamic setter can override) carries the Asset vocabulary. Verified RED→GREEN, and the surrounding filter/label unit tests pass.manage.py makemigrations --checkis clean — no model or migration changes.Documentation
The one docs screenshot that shows this label (
OS__tagging_objects.md, "Filtering for Tags") is refreshed in a separate, dependent docs PR againstdev. No doc changes here.Checklist
bugfixbranch (branch is on the currentbugfixtip).makemigrations --check).bugfixlabel (fork PRs can't set labels).