Skip to content

Chat never says Jira isn't connected when it is; the Jira app's links heal themselves - #786

Merged
nambok merged 2 commits into
mainfrom
fix/jira-chat-connected
Nov 19, 2026
Merged

nambok merged 2 commits into
mainfrom
fix/jira-chat-connected

Conversation

@nambok

@nambok nambok commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Chat told a connected team "Jira isn't connected to Coderhelm" because chat and the integrations page asked the team's JIRA#config different questions. Chat required the app's ticket lookup link (get_issues_url); the page required the comment link. The lookup link was missing for two reasons:

  1. The Jira app gained its get-issues-trigger in a minor version. Forge rolls minor versions out to every site with no lifecycle event, and the app registered its links only on install, on a settings save or on an accepted major update (coderhelm-jira/src/register.js, manifest.yml lifecycle events), so a site that already had the app never sent the new link.
  2. A self-hosted install linked through CoderHelm copies the hosted links only when linked_at changes (hybrid_install::jira_sync_plan), so even once the hosted record has the link, the install's copy never gets it.

Now there is one test of "connected" for every reader, a missing ability is named as itself, and the system puts the links right by itself.

Changes

  • common::jira_connection (new): Connection::connected is the one test (the app registered with its secret, or a plain Jira webhook). ticket_reads returns the lookup or a Gap with its own wording: "Jira is connected, but the Coderhelm app on the Jira site hasn't registered its ticket lookup...". "Jira isn't connected to Coderhelm" is used only when there is no Jira at all. It also provides missing_registrations, register_again, registered and copy_is_stale.
  • Chat: chat_work_tickets::load returns Jira { app, off }. Ticket lookups fall back to what Coderhelm's runs know and say exactly why. "What needs me" uses the same words. When the lookup is missing, chat heals the links first and reads again, so the same answer usually has the tickets. The answer shape no longer gives the model "Jira isn't connected" as its example sentence.
  • Integrations page: uses the same Connection, shows ticket_reads (ready, or why not), and heals when a link is missing.
  • jira_heal (new): asks the app to register all its links again through its project-list trigger ({register_again, forge_secret}). On a linked install that link is CoderHelm's proxy, so the site registers with CoderHelm and the install then copies again. It runs at most once per team per ten minutes and is called from chat, the integrations page, the hosted Jira intake and the install's relayed Jira events.
  • Hybrid: /hybrid/status sends the trigger names the site registered with the link. The install records which triggers it copied (jira_synced_triggers) and copies again whenever they differ, not only on a relink. refresh_jira_copy forces a copy (self-hosted only).
  • Jira app: on the first event after any version change it registers again (registerIfVersionChanged). The project-list trigger answers a register-again request after checking the secret in constant time. A trigger a version lacks is sent empty instead of failing the whole registration. Forge is loaded lazily so register.js is testable.
  • Docs: docs/jira-app-release.md now explains how links reach CoderHelm after a minor version. A new incident page, docs/incidents/jc_jira_connected_in_chat.md, is added.
  • confluence_trigger_url and publish_release_url stay empty on purpose. The app has sent them empty since Confluence moved to the Atlassian connection, so they are not counted as gaps.

Verification

  • cargo fmt --all --check: clean.
  • cargo clippy -p common -p gateway -p worker --all-targets -- -D warnings: clean.
  • cargo test -p gateway: 1087 passed, 0 failed. New tests:
    • chat_work_tickets::an_app_without_its_lookup_is_never_called_not_connected
    • hybrid_install::a_trigger_the_site_registers_after_the_link_is_copied_again
    • the "connected, lookup missing" wording case in chat_work_needs
    • jira_heal tests
  • cargo test -p common jira_connection: 4 passed.
  • Incident case passes::incidents::jc_jira_connected_in_chat: 3 passed. every_case_has_its_page_and_every_page_its_case passes.
  • node --test in coderhelm-jira: 39 passed, including 7 in the new register.test.js.
  • Replays of the reported record, a linked install with get_issues_url empty and app_version 7.3.0:
    • On main, chat_work_tickets::load returns None for that record, so chat prints "Jira isn't connected to Coderhelm".
    • On main, jira_sync_plan returns Nothing for an unchanged linked_at even when the site registered a new trigger.
    • The new tests assert the opposite of both, and they don't build against main because the API they check doesn't exist there.

Deploy order: the gateway (hosted and installs) heals the links once the Jira app with the register-again handler is released. The app is a minor version with no new scopes, so Forge rolls it out with no admin step.

…inks heal themselves

Chat counted Jira as connected only when the app's ticket lookup link was
in JIRA#config, while the integrations page counted the app's comment link.
A site whose app gained the lookup in a minor version (Forge rolls those out
with no lifecycle event, so the app never registered the new link), and a
self-hosted install that copied the hosted links once at link time, showed
connected on the page while chat said Jira wasn't connected.

- common::jira_connection: one test of "connected" for every reader, and
  each missing ability named as itself, never as "not connected".
- The Jira app registers again on the first event after any version change,
  and on request through its project-list trigger; a trigger a version
  lacks no longer fails the whole registration.
- jira_heal: chat, the integrations page and the Jira intake ask the app to
  register again when a link it always registers is missing (once per team
  per ten minutes), and a linked install copies the hosted settings again.
- Hybrid: /hybrid/status sends the triggers the site registered; the
  install copies again whenever they change, not only on a relink.
- Incident case jc_jira_connected_in_chat with its page.
@nambok
nambok merged commit fed7312 into main Nov 19, 2026
10 checks passed
@nambok
nambok deleted the fix/jira-chat-connected branch November 19, 2026 03:18
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.

1 participant