fix(jira): gate the legacy endpoints block in the classic issue templates - #15810
Open
svader0 wants to merge 1 commit into
Open
fix(jira): gate the legacy endpoints block in the classic issue templates#15810svader0 wants to merge 1 commit into
svader0 wants to merge 1 commit into
Conversation
…ates
The V3 Locations gate was added to dojo/templates/issue-trackers only. The
classic copies under dojo/templates_classic/ kept the ungated
`{% if finding.endpoints.all %}`, and those are the copies the loader serves:
UIPreferenceLoader puts the classic tree first for every user who has not
opted into the Tailwind UI.
A migrated tenant keeps its legacy Endpoint rows, so rendering that block with
V3_FEATURE_LOCATIONS on hydrates a deprecated Endpoint and raises
NotImplementedError. Pushing such a finding to JIRA or GitHub returned a 500.
Both templates now carry the same gate the Tailwind copies already have. The
finding-group template gets it too, because jira_description renders that one
for a group push and it had the identical block.
Fixes the two pre-existing failures in
unittests/test_endpoint_init_v3.TestEndpointInitV3.
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
When
V3_FEATURE_LOCATIONSis on, pushing a finding to JIRA or GitHub returns a 500.The JIRA description templates have two copies. The Tailwind copy under
dojo/templates/issue-trackers/got a{% if V3_FEATURE_LOCATIONS %}gate that rendersfinding.locationsinstead offinding.endpoints. The classic copy underdojo/templates_classic/issue-trackers/did not.UIPreferenceLoaderputs the classic tree first for every user who has not opted into the Tailwind UI, so the ungated copy is what most deployments render.The ungated block does
{% if finding.endpoints.all %}. A tenant migrated to Locations keeps its legacyEndpointrows on purpose, so that queryset hydrates a deprecatedEndpointandEndpoint.__init__raisesNotImplementedError.This PR copies the same gate into both classic templates:
dojo/templates_classic/issue-trackers/jira_full/jira-description.tpldojo/templates_classic/issue-trackers/jira_full/jira-finding-group-description.tplThe group template gets it too.
jira_description()renders that one for a finding-group push, and it carried the identical ungated block.jira_description()andgithub_body()already passV3_FEATURE_LOCATIONSinto the context, so no Python change is needed.Test results
Two tests in
unittests/test_endpoint_init_v3.pyalready covered this and were failing:TestEndpointInitV3.test_jira_description_renders_locations_under_v3TestEndpointInitV3.test_github_body_renders_locations_under_v3Before, with
DD_V3_FEATURE_LOCATIONS=True:After:
unittests/test_jira_helper.pystill passes (47 tests). No test asserts the rendered description text, so nothing else changes.Documentation
No documentation change. This restores the behavior the Locations docs already describe.