Skip to content

chore: promote dev → main (JIRA baseUrl discovery + createPR timeout removal)#1186

Merged
zbigniewsobiecki merged 3 commits intomainfrom
dev
Apr 24, 2026
Merged

chore: promote dev → main (JIRA baseUrl discovery + createPR timeout removal)#1186
zbigniewsobiecki merged 3 commits intomainfrom
dev

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

Promotes two dev commits to main:

  • fix(pm-discovery): promote JIRA baseUrl from config into discovery credentials #1184fix(pm-discovery): promote JIRA baseUrl from config into discovery credentials
    Closes the prod incident on ua-store where the JIRA wizard's Select Project step returned "Internal server error" for any saved integration. Adds a generic configToCredentials manifest hook (non-secret connection fields promoted from project_integrations.config into discovery credentials). JIRA declares it to surface baseUrl → base_url. DB-scoped secrets still win on key collisions. Regression pinned at router + manifest layers.

  • chore(createPR): remove subprocess + gadget timeouts so long pre-push hooks survive #1185chore(createPR): remove subprocess + gadget timeouts so long pre-push hooks survive
    Drops the three stacked wall-clocks that were killing cascade-tools scm create-pr whenever a pre-push hook ran a real test suite. git commit + git push now use wallTimeoutMs: 0, idleTimeoutMs: 0 (disabled), and the CreatePR gadget's outer timeoutMs is 0 (llmist treats as no outer timer). Heartbeats still emit every 30 s so long hooks remain observable. Regression pinned with tests for both the disabled-timeout paths on runCommand and the 0/0 contract at the call site.

Test plan

🤖 Generated with Claude Code

zbigniewsobiecki and others added 2 commits April 24, 2026 14:35
…edentials (#1184)

Edit-mode re-verification in the JIRA wizard's Select Project step was
returning "Internal server error" because `pm.discovery.discover({ projectId })`
resolved credentials only from `project_credentials` — where JIRA's `baseUrl`
does not live. The JIRA `createDiscoveryProvider` factory built
`new Version3Client({ host: '' })` and the underlying jira.js client threw
"Couldn't parse the host URL."

Regression from spec 010/2, which replaced per-provider discovery procedures
with the generic `pm.discovery.discover`. The legacy `jiraProjectsByProject`
read `baseUrl` off integration config directly.

Fix: add an optional `configToCredentials(config): Record<string, string>`
hook to `PMProviderManifest`. The resolver invokes it on the `projectId`
path to seed the credentials bag with non-secret connection fields promoted
from `project_integrations.config`. `project_credentials` values override
on key collisions — DB-scoped secrets always win over config-derived defaults.
JIRA declares the hook to promote `baseUrl` → `base_url`.

The hook is generic (no JIRA `if` in shared infra), defensive (bad hook
returns or throws are caught and logged, discovery stays up), and preserves
the spec-009 "new provider touches zero shared files" invariant.

Also: refactored `resolvePMCredentials` to stay under the biome cognitive-
complexity threshold by extracting `promoteConfigCredentials` +
`loadIntegrationAndManifest` helpers.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… hooks survive (#1185)

Three stacked wall-clocks were killing `cascade-tools scm create-pr` whenever a
project's pre-push hook ran a real test suite:

1. `git commit` runCommand — wallTimeoutMs 120s, idleTimeoutMs 60s
2. `git push`   runCommand — wallTimeoutMs 230s, idleTimeoutMs 90s
3. CreatePR gadget — outer timeoutMs 240s

A 5-minute pre-push test suite is a legitimate use case. The agent harness that
wraps this gadget already budgets long tool calls; the second shorter cap here
was just re-creating the "PUSH FAILED at 2 min" failure mode of spec 013.

Fix: pass `wallTimeoutMs: 0, idleTimeoutMs: 0` to both runCommand calls
(runCommand treats 0 as "disabled", per its docstring at utils/repo.ts:75-86
and the enforced branches at :153,164,169). Set the CreatePR gadget's outer
`timeoutMs: 0`, which llmist treats as "no outer timer" (see
`if (timeoutMs && timeoutMs > 0)` in its dispatch path).

Heartbeat stays on (default 30s stderr pulse) so operators still see
`[git-push] still running (Ns)` ticks during slow hooks — observability
without killing.

Test coverage:
 - Two new `runCommand` tests pin the disabled-idle and disabled-wall paths
   (tests/unit/utils/repo.test.ts)
 - Three new regression tests pin that createPR passes 0/0 for both git
   commands (tests/unit/gadgets/github/core/createPR.test.ts)
 - The definitions-level assertion was flipped from "240s" to "0" and now
   documents why 0 is the correct value
 - Outdated spec-013 contract tests that asserted the old "finite" timeouts
   were deleted; the captured-output assertions from that block were kept

Not touched: runCommand DEFAULT_IDLE_TIMEOUT_MS / DEFAULT_WALL_TIMEOUT_MS, and
every other timeout in the inventory (HTTP clients, watchdogs, VerifyChanges,
diagnostics tsc/biome, tmux, Sleep). Those guard genuine hang cases and were
explicitly out of scope.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 92.75362% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/api/routers/pm-discovery.ts 91.66% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

…ntials refactor (#1187)

#1184 extracted `promoteConfigCredentials` + `loadIntegrationAndManifest`
helpers but added five guard branches none of the new tests exercised
(codecov patch coverage on that PR was 58.33%, below the 80% target).
This commit pins each branch directly so the patch is in the green:

- UNAUTHORIZED when projectId is set but effectiveOrgId is null
- NOT_FOUND when no PM integration is configured for the project
- NOT_FOUND when the saved integration belongs to a different provider
- configToCredentials returning a non-object (string/null/array) is
  silently coerced to empty — resolved bag ends up project_credentials-only
- configToCredentials throwing is swallowed with a console.warn; discovery
  still returns project_credentials — a broken hook cannot brick the wizard

All five are behavioural contracts the original `resolvePMCredentials`
upheld through inline conditionals; the refactor preserved them but moved
them into the helpers. These tests make the contract explicit.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 5349e91 into main Apr 24, 2026
15 checks passed
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