Skip to content

Commit d933470

Browse files
committed
feat: $BRANCH_NAME variable in origin_source_file_url
1 parent c84e378 commit d933470

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backend/application/core/api/serializers_observation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ def _create_azure_devops_url(observation: Observation, origin_source_file_url: s
242242

243243
def _create_common_url(observation: Observation, origin_source_file_url: str) -> str:
244244
if observation.branch:
245-
origin_source_file_url += f"/{observation.branch.name}"
245+
if "$BRANCH_NAME" in origin_source_file_url:
246+
origin_source_file_url = origin_source_file_url.replace("$BRANCH_NAME", observation.branch.name)
247+
else:
248+
origin_source_file_url += f"/{observation.branch.name}"
246249
origin_source_file_url += f"/{observation.origin_source_file}"
247250
if observation.origin_source_line_start:
248251
origin_source_file_url += "#L" + str(observation.origin_source_line_start)

0 commit comments

Comments
 (0)