Fix: Jira dashboard config params not reaching notifier#22
Conversation
Two bugs were preventing Jira settings configured in the Socket dashboard
from being used by the Jira notifier:
1. Parameter name mismatch in notifications.yaml
- Dashboard API returns `jiraUrl` -> normalized to `jira_url`
- But notifications.yaml defined param as `name: server`
- Manager looks up params by name, so `jira_url` was never found
- Fixed by renaming params to match dashboard keys: `jira_url`, `jira_project`
2. Priority bug in manager param resolution
- Comment said "app_config -> env var -> default" (app_config highest)
- But code would set val from app_config, then overwrite with default
if env var wasn't set
- Fixed by restructuring: start with default, apply env var, then app_config
Also updated jira_notifier.py to look for the correct param names
(`jira_url`, `jira_project`, `jira_email`, `jira_api_token`) and fall back
to the `auth` dict for backwards compatibility.
Tested locally with simulated dashboard config - all four Jira params now
resolve correctly.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Manual Testing CompletedTested the fix locally against a real Jira instance with dashboard-configured credentials. Setup
Before Fix (v1.0.26)After Fix (this branch)ResultJira issue KAN-4 created successfully with the Trivy scan results attached as a comment. The fix correctly resolves the parameter name mismatch and priority bug described in the PR. |
Signed-off-by: lelia <lelia@socket.dev>
Signed-off-by: lelia <lelia@socket.dev>
Signed-off-by: lelia <lelia@socket.dev>
Signed-off-by: lelia <lelia@socket.dev>
lelia
left a comment
There was a problem hiding this comment.
Conditionally approved, pending your thoughts on whether we should add in those additional safeguards first - you'd know better than me what the typical customer use cases are. I also modified the PR branch to include a few things that helped me verify the changes, in absence of access to a real JIRA instance:
- config wiring script to verify the dashboard config without making API calls
- unit tests to cover new notifier functionality (you can run these with
./venv/bin/python -m pytestand they should not rely on any external services).
Reject empty/whitespace-only env var values in notifier param resolution so they don't silently override app_config or defaults.
dc-larsen
left a comment
There was a problem hiding this comment.
Thanks for the review and the tests.
Comments 1 & 2 (backwards compat for server, project, email, api_token): We don't need fallbacks. The old names never worked from the dashboard. normalize_api_config has always mapped jiraUrl → jira_url (config.py:927-928), so no customer could have relied on the old yaml param names. CI users set env vars like INPUT_JIRA_URL, which resolve via the env_variable field regardless of param name. For email/api_token, the auth dict fallback already covers the one real path (the enrichment block at manager.py:247-252).
Comment 3 (empty env var guard): Agreed. Pushed 35a5e75 with the str(ev).strip() != "" guard on the env var check. An accidental INPUT_JIRA_URL="" in CI would have silently overwritten valid config with an empty string.
Summary
Fixes two bugs preventing Jira settings configured in the Socket dashboard from being used by the Jira notifier:
jiraUrl(normalized tojira_url), butnotifications.yamldefined the param asname: server. The manager looks up params by name, sojira_urlwas never found.valfromapp_config, then overwrite it withp_defaultif the env var wasn't set, despite the comment saying app_config should have highest priority.Customer Impact
A customer reported that Jira integration configured via the dashboard wasn't working. Logs showed:
The notifier was enabled (because the manager saw
jira_urlin app_config), but the actual URL value wasn't passed through.Changes
notifications.yaml: Renamed Jira params fromserver/projecttojira_url/jira_projectto match dashboard config keysmanager.py: Fixed param resolution order (default → env var → app_config, with app_config having highest priority)jira_notifier.py: Updated to look for the correct param names with fallback toauthdict for backwards compatibilityTest plan
jira_url,jira_project,jira_email,jira_api_token) now resolve correctly from simulated dashboard config🤖 Generated with Claude Code