Skip to content

fix: disable sync for SIMPLE_URL issue integrations#197

Merged
therealbrad merged 7 commits intomainfrom
fix/disable-sync-simple-url
Apr 15, 2026
Merged

fix: disable sync for SIMPLE_URL issue integrations#197
therealbrad merged 7 commits intomainfrom
fix/disable-sync-simple-url

Conversation

@therealbrad
Copy link
Copy Markdown
Contributor

@therealbrad therealbrad commented Apr 15, 2026

Description

SIMPLE_URL integrations are for link-out to third-party issue trackers where TestPlanIt doesn't have a first-class adapter (e.g. MantisBT). They have no API to pull from, so several UI affordances and code paths assumed capabilities the provider doesn't have. This PR cleans up four categories of misbehavior:

  1. Sync was exposed in the UI and API despite the adapter reporting syncIssue: false.
  2. Test Connection was available despite there being no API to test.
  3. API Key / apiKey field was present on the config form despite SIMPLE_URL requiring no authentication.
  4. External URLs were persisted per-issue, so editing the integration's Base URL left old issues pointing to stale links.

Changes

Sync disabled across all surfaces (defense-in-depth)

  • UI: per-issue Sync button hidden on admin issues page for SIMPLE_URL
  • UI: per-integration Sync button hidden on admin integrations page for SIMPLE_URL
  • API: POST /api/issues/[issueId]/sync returns 400 when provider is SIMPLE_URL
  • API: POST /api/admin/integrations/[id]/sync returns 400 when provider is SIMPLE_URL
  • Adapter already reported syncIssue: false; this makes behavior consistent everywhere

Test Connection removed for SIMPLE_URL

  • Hidden in the admin integration modal (no external endpoint to hit)

API Key field removed from SIMPLE_URL config

  • IntegrationConfigForm no longer renders the apiKey input for SIMPLE_URL
  • Only the Base URL (with {issueId} placeholder) is required

External URLs now constructed at render time

  • ManageSimpleUrlIssues no longer writes externalUrl when creating or updating an issue
  • New helper buildSimpleUrlLink(baseUrl, externalId) in lib/integrations/simpleUrl.ts
  • Project issues grid (columns.tsx) resolves the URL at render via a new resolveIssueUrl helper: SIMPLE_URL computes from the current Integration.settings.baseUrl; Jira/GitHub continue to use their stored externalUrl (those are real external URLs, not templates)
  • Result: if an admin updates the Base URL, every linked SIMPLE_URL issue immediately points to the new URL — no stale links, no backfill
  • Deleted an obsolete prisma/backfill-simple-url-external-urls.ts that was briefly in-tree to populate stored URLs (no longer needed)

Issue grid polish for SIMPLE_URL-only projects

  • Columns that come from external API sync (description, status, priority, lastSyncedAt) are hidden when the project's only integration is SIMPLE_URL, since those values are always empty

Supporting plumbing

  • issue added to AUTO_INJECT_USER_FIELDS in api/model/[...path]/route.ts so createdBy is server-injected on issue create (needed because the SIMPLE_URL create path no longer supplies it client-side)
  • Small validation fix: externalId schema in the versions route accepts null as well as undefined

Docs

  • integrations.md updated: clarified that SIMPLE_URL requires no auth, offers no Test Connection, does not support Sync, and constructs link-out URLs at render time from the current Base URL
  • reporting.md: small filter list addition to the Stale/Flaky report section

Related Issue

N/A (internal cleanup surfaced while reviewing integration flows; MantisBT users were the prompt.)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change
  • Documentation update
  • Refactoring (no functional changes) — small formatting passes rode along
  • Performance improvement

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • E2E tests (existing API-level E2E for SIMPLE_URL covers create/link/unlink cycle — no new browser E2E added; see reasoning below)
  • Manual testing

Unit + component tests added

  • lib/integrations/simpleUrl.test.tsbuildSimpleUrlLink unit tests (missing inputs, token replacement, missing placeholder)
  • components/issues/ManageSimpleUrlIssues.test.tsx — regression guards for the render-time fix:
    • Create does not write externalUrl
    • Rendered link uses current baseUrl, ignoring a stale stored issue.externalUrl
    • Rerender with a new baseUrl updates the link in place
    • Add-dialog URL preview reflects typed issue ID

Manual testing

  • Per-issue Sync button hidden for SIMPLE_URL-linked issues
  • Per-integration Sync button hidden on admin integrations page for SIMPLE_URL
  • Both sync endpoints return clean 400 with descriptive errors when called against SIMPLE_URL
  • Test Connection hidden on SIMPLE_URL integration modal
  • API Key field not rendered on SIMPLE_URL config form
  • Edited an existing integration's Base URL and confirmed linked issues immediately point to the new URL without a page reload beyond the integration settings save
  • Verified Jira/GitHub integrations still show sync buttons, Test Connection, and sync successfully

Why no new browser E2E

Existing API-level E2E in integrations-setup.spec.ts and integrations-issues.spec.ts already covers the SIMPLE_URL create/link/unlink/project-assignment cycle. The component test asserts the exact render-time URL behavior that a browser E2E would visually confirm, at a fraction of the maintenance cost.

Test Configuration

  • OS: macOS
  • Browser: Chrome
  • Node: 22.x

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally
  • Any dependent changes have been merged and published
  • I have signed the CLA

Additional Notes

  • No schema changes. Issue.externalUrl still exists and is still used for Jira/GitHub; SIMPLE_URL issues simply stop writing to it and ignore any stale values on read. Existing SIMPLE_URL rows with a persisted externalUrl are left as-is (harmless dead data).
  • Defense-in-depth for sync: UI hides the buttons (primary UX), API routes return 400 (direct-API defense), and SimpleUrlAdapter.getCapabilities() already returns syncIssue: false (adapter layer, unchanged).
  • Small formatting/cleanup rode along in lib/access-fast-path.ts, the model/versions routes, and load-test scripts — no behavior change in those files.

therealbrad and others added 7 commits April 15, 2026 07:11
SIMPLE_URL integrations have no API to pull from (they're intended for
link-out to third-party trackers where TestPlanIt doesn't have first-class
adapter support, e.g. MantisBT). Offering sync actions was misleading —
the SimpleUrlAdapter already reports syncIssue: false and the SyncService
rejected the call, but the UI still showed the buttons.

Changes:
- Hide per-issue Sync button on admin issues page for SIMPLE_URL
- Hide per-integration Sync button on admin integrations page for SIMPLE_URL
- Reject /api/issues/[issueId]/sync with 400 when provider is SIMPLE_URL
- Reject /api/admin/integrations/[id]/sync with 400 when provider is SIMPLE_URL

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…_URL

SIMPLE_URL integrations don't authenticate against any API (they're
link-out only). The Edit Integration form was showing:
- apiKey credential field (never used by SimpleUrlAdapter)
- Test Connection button (nothing to test)

Changes:
- Change SIMPLE_URL allowed auth types from [API_KEY] to [NONE]
- Remove the SIMPLE_URL + API_KEY field config block
- Hide the Test Connection button when provider is SIMPLE_URL

Existing SIMPLE_URL integrations with stored API_KEY auth type keep
working (the DB value is preserved); the auth type dropdown just won't
render because only NONE is offered for new selections.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Added detailed notes on Simple URL integrations in the user guide, clarifying that they do not require authentication and outlining their limitations.
- Updated the SyncIntegrationButton component to disable the sync action for Simple URL integrations, providing a disabled button instead.
- Enhanced the issue linking process for Simple URL integrations, ensuring that the external link is constructed correctly and displayed in the UI.
- Implemented logic to hide synced fields in the issue columns when only Simple URL integrations are present, improving the user experience.

This update aims to provide clearer guidance and improve the functionality related to Simple URL integrations.
- Updated the UI to ensure that the sync actions are disabled for Simple URL integrations, aligning with their intended functionality as link-out only.
- Enhanced the integration management by removing unnecessary elements related to API_KEY authentication, which is not applicable for Simple URL integrations.
- Improved user experience by ensuring that the sync buttons are hidden and that the integration settings reflect the correct authentication type.

This update aims to clarify the behavior of Simple URL integrations and streamline the user interface accordingly.
- Updated various package versions in `package.json` and `pnpm-lock.yaml` to ensure compatibility and security, including:
  - `@auth/prisma-adapter` from `^2.11.1` to `^2.11.2`
  - `@aws-sdk/client-s3` and `@aws-sdk/s3-request-presigner` from `^3.1029.0` to `^3.1030.0`
  - `@swagger-api/apidom-core` from `^1.10.1` to `^1.10.2`
  - `ai` from `^6.0.158` to `^6.0.162`
  - `bullmq` from `^5.73.4` to `^5.74.1`
  - `dompurify` from `^3.3.3` to `^3.4.0`
  - `happy-dom` from `^20.8.9` to `^20.9.0`
  - `hono` from `^4.12.12` to `^4.12.14`
  - `nanoid` from `^5.1.7` to `^5.1.9`
  - `next-auth` from `^4.24.13` to `^4.24.14`
  - `swagger-ui-react` from `^5.32.2` to `^5.32.4`
  - `undici` from `^7.24.7` to `^7.25.0`
  - Updated ESLint packages to `^8.58.2`
  - Updated PostCSS to `^8.5.10` and Prettier to `^3.8.3`
- Adjusted `pnpm-lock.yaml` to reflect the new dependency versions and ensure proper resolution.
@therealbrad therealbrad merged commit 6b0cc94 into main Apr 15, 2026
5 checks passed
@therealbrad therealbrad deleted the fix/disable-sync-simple-url branch April 15, 2026 21:34
@therealbrad
Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 0.21.14 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant