Skip to content

feat(post_analysis_to_slack): make details URL a {vcon_id} template#180

Merged
pavanputhra merged 2 commits into
mainfrom
update-post-analysis-to-slack-link-to-allow-linking-to-portal
May 21, 2026
Merged

feat(post_analysis_to_slack): make details URL a {vcon_id} template#180
pavanputhra merged 2 commits into
mainfrom
update-post-analysis-to-slack-link-to-allow-linking-to-portal

Conversation

@ScottHenshaw86
Copy link
Copy Markdown
Contributor

Summary

  • The Slack details URL was hard-coded as ?_vcon_id="<uuid>", which works for Hex but not for path-based destinations like our reporting portal.
  • The url config option is now a template: if it contains {vcon_id}, the uuid is substituted there — letting each destination own the placement and quoting.
  • URLs without {vcon_id} fall back to the legacy ?_vcon_id="<uuid>" suffix, so existing Hex configs keep working unchanged.

Examples:

# Hex sheet — uuid wrapped in double quotes inside a query param.
url: 'https://app.hex.tech/<workspace>/app/<app>/latest?_vcon_id="{vcon_id}"'

# Portal — uuid embedded raw in the path.
url: "https://portal.strolidcxm.com/app/conversations/{vcon_id}"

Test plan

  • poetry run python -m pytest conserver/links/post_analysis_to_slack/test_post_analysis_to_slack.py — all 7 tests pass (4 new + 3 existing)
  • Smoke test the Hex config in a non-prod environment to confirm legacy fallback still emits the same URL
  • Update the production config to use the {vcon_id} template form for the portal rollout

🤖 Generated with Claude Code

Lets each deployment own the placement and quoting of the vCon uuid,
so the same link can target Hex sheets (quoted query param) or path-
based destinations like our reporting portal. URLs without {vcon_id}
fall back to the legacy ?_vcon_id="<uuid>" suffix so existing configs
keep working unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the post_analysis_to_slack link so the configured “details” URL can be treated as a template, enabling path-based destinations (e.g., portals) while preserving legacy behavior for existing Hex-style configs.

Changes:

  • Added build_details_url() to render details URLs via {vcon_id} substitution, with a legacy fallback that appends ?_vcon_id="<uuid>".
  • Updated the link runtime to use build_details_url() instead of hard-coding the query suffix.
  • Added/updated documentation and tests covering the template behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
conserver/links/post_analysis_to_slack/__init__.py Introduces build_details_url() and switches run() to use it for constructing the Slack “Details” link.
conserver/links/post_analysis_to_slack/test_post_analysis_to_slack.py Adds unit tests for template substitution and legacy fallback URL rendering.
conserver/links/post_analysis_to_slack/README.md Documents {vcon_id} URL templating and the legacy fallback behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread conserver/links/post_analysis_to_slack/__init__.py Outdated
Comment thread conserver/links/post_analysis_to_slack/__init__.py
Comment thread conserver/links/post_analysis_to_slack/__init__.py
Comment thread conserver/links/post_analysis_to_slack/README.md
str.format would raise KeyError/ValueError at runtime if the configured
URL happened to contain any other ``{...}`` segment (or a stray brace).
str.replace only touches the ``{vcon_id}`` token and leaves everything
else alone, so a config typo can't brick the link. No change for either
existing template shape (Hex's quoted query param, the portal's path).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pavanputhra pavanputhra merged commit 24e690c into main May 21, 2026
1 check passed
@pavanputhra pavanputhra deleted the update-post-analysis-to-slack-link-to-allow-linking-to-portal branch May 21, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants