Repository navigation
Chat never says Jira isn't connected when it is; the Jira app's links heal themselves - #786
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chat told a connected team "Jira isn't connected to Coderhelm" because chat and the integrations page asked the team's
JIRA#configdifferent 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:get-issues-triggerin 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.ymllifecycle events), so a site that already had the app never sent the new link.linked_atchanges (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::connectedis the one test (the app registered with its secret, or a plain Jira webhook).ticket_readsreturns the lookup or aGapwith 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 providesmissing_registrations,register_again,registeredandcopy_is_stale.chat_work_tickets::loadreturnsJira { 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.Connection, showsticket_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/statussends 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_copyforces a copy (self-hosted only).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 soregister.jsis testable.docs/jira-app-release.mdnow 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_urlandpublish_release_urlstay 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_connectedhybrid_install::a_trigger_the_site_registers_after_the_link_is_copied_againchat_work_needsjira_healtestscargo test -p common jira_connection: 4 passed.passes::incidents::jc_jira_connected_in_chat: 3 passed.every_case_has_its_page_and_every_page_its_casepasses.node --testincoderhelm-jira: 39 passed, including 7 in the newregister.test.js.get_issues_urlempty andapp_version7.3.0:chat_work_tickets::loadreturnsNonefor that record, so chat prints "Jira isn't connected to Coderhelm".jira_sync_planreturnsNothingfor an unchangedlinked_ateven when the site registered a new trigger.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.