Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Fix issue with utm_source not appearing in generated insight links #766

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/codegate/pipeline/extract_snippets/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ async def _snippet_comment(self, snippet: CodeSnippet, context: PipelineContext)
lib_type = lib["properties"]["type"]
lib_status = lib["properties"]["status"]
lib_url = (
f"https://www.insight.stacklok.com/report/{lib_type}/{quote(lib_name, safe='')}"
f"https://www.insight.stacklok.com/report/{lib_type}/"
f"{quote(lib_name, safe='')}?utm_source=codegate"
)

warnings.append(
Expand Down
5 changes: 4 additions & 1 deletion src/codegate/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def generate_vector_string(package) -> str:
}
vector_str += f" is a {type_map.get(package['type'], 'package of unknown type')}. "
package_name = quote(package["name"], safe="")
package_url = f"https://www.insight.stacklok.com/report/{package['type']}/{package_name}"
package_url = (
f"https://www.insight.stacklok.com/report/{package['type']}/"
f"{package_name}?utm_source=codegate"
)

# Add extra status
status_suffix = status_messages.get(package["status"], "")
Expand Down
Loading