Skip to content

CI CD Integration Hub 1940

CI Agent edited this page Oct 19, 2026 · 1 revision

CI/CD Integration Hub (Issue #1940)

Overview

The CI/CD Integration Hub is the documentation half of the CI/CD feature (parent #1064). Its sibling, the CI/CD Result Publishing screen, is the results half — it accepts and ingests pipeline artifacts. The hub is the in-app reference an integrator opens before wiring a pipeline: it explains the publish workflow end-to-end, the accepted result formats, the two authentication options, the error contract, and hands out four copy-ready pipeline snippets. Net-new for 2.0.1: neither TestLink 1.9.20 nor the initial 2.0.1 BFF layer shipped any CI/CD integration screen.

CI/CD Integration hub — normal state

Scope of Behaviour

  • Publish workflow (5 steps): prepare results (JUnit XML / JSON) → authenticate (session cookie or API key) → POST multipart field file to the publish endpoint → TestLink parses into a test plan/build → open Automation Test Reports.
  • Result formats: JUnit XML (ubiquitous CI output) and TestLink JSON (flat test list), each with a short "when to use it".
  • Authentication: session cookie plus the X-Requested-With: XMLHttpRequest CSRF header, or a per-plan API key; the exact header shape is shown.
  • Example pipelines: four copy-ready snippets — GitHub Actions, GitLab CI, Jenkins and plain curl. Every snippet posts to action=publish, sends the report as the multipart field file and carries -H "X-Requested-With: XMLHttpRequest" (the header the shared CSRF guard requires).
  • Error codes: seven documented failures (missing file, bad format, auth, forbidden, unknown action, oversized payload, server error) with cause and fix.
  • Related in TestLink: deep links (current tproject_id / tplan_id, target=_top) to CI/CD Result Publishing, Automation Test Reports, the REST API Reference and the OpenAPI Specification.
  • Toolbar: Refresh, Documentation (back) and a live filter over steps, formats, auth modes, examples, errors and related links, with a translated no-match state.

UI Features (Dashio)

  • Intro card with a live endpoint chip api/cicdpublish/index.php?action=publish.
  • Numbered 5-step workflow cards.
  • Result-format cards and authentication cards.
  • Four example-pipeline cards, each with a code block and a Copy button (toast "Copied to clipboard").
  • Seven-row error-code table (HTTP status, machine code, description).
  • Related deep-link cards.
  • State cards: not_authenticated / session_expired (401 with a Log in action → /login.php?note=expired), forbidden (403), invalid_request (400), method_not_allowed (405) and server_error (500), each with the localized title/body and the raw HTTP nnn - code line.

API

  • BFF: /api/cicd/index.php?action=init — returns the endpoint, HTTP methods, step/format/auth/model lists, four example snippets (plain data, rendered client-side via .text()), the error catalogue and related links. Every label is an i18n key (cicdhub.*); snippets are opaque DATA.
  • Security: session auth + bffSameOriginGuard + bffEnforceSession; GET|HEAD only (405 otherwise); machine codes 400 unknown_action, 401 not_authenticated|session_expired, 403 foreign-origin.
  • Wiring: $actions->cicdHub in lib/functions/common.php; Documentation ASIDE entry after OpenAPI Specification (icon fas fa-code-branch); $TLS_title_cicd_hub in all 19 server locales; cicdhub.* (69 keys) + footers.cicdHub in all 10 client bundles.

Verification

  • Browser suite Issue #1940 = 23/23 PASS (tmp/TLU_Test_Cases.md, append-only; gate TLU_REQUIRE_SUITE="Issue #1940" bash ai/verify_test_suites.sh → 34 PASS / 0 FAIL).
  • bash ai/verify_i18n_coverage.sh → 9/9 bundles, 8975 keys, 0 missing.
  • BFF curl matrix: anon 401, authed init 200, HEAD 200, bad action 400, authed POST 405, foreign-origin POST 403.
  • Browser (admin + anon): full render (5 steps / 2 formats / 2 auth / 4 examples / 7 errors / 4 related), junit filter, no-match empty state, copy toast, EN↔RO locale, 401 state card with login bounce, refresh, back button, console clean.
  • Event Viewer clean (no Error/Warning rows).

Screenshots

  • Normal state — full hub, English.
  • Filter — search github narrowing to one example.
  • Romanian locale — fully translated UI.
  • 401 state card — anonymous access, content hidden, login action shown.

Filter Romanian locale 401 state

Notes

  • The example snippets are deliberately plain (non-localized) code — translating them would break copy-paste. The UI around them is fully localized.
  • The snippets are the canonical shapes the CI/CD Result Publishing screen accepts, so the hub and the publish screen cannot drift on the wire contract.
  • Refs #1940 / parent #1064.

Clone this wiki locally