lomavuokraus/docs/redmine.html
Tero Halla-aho 0bb709d9c5
Some checks failed
CI / checks (push) Has been cancelled
chore: fix audit alerts and formatting
2026-02-04 12:43:03 +02:00

96 lines
3.1 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Redmine Integration</title>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<header>
<h1>Redmine Integration</h1>
<div class="meta">
File tickets automatically when tests fail and review open work by
tracker.
</div>
</header>
<main class="grid">
<section class="card">
<h2>Setup</h2>
<ul>
<li>
Env vars (see <code>.env.example</code>): <code>REDMINE_URL</code>,
<code>REDMINE_API_KEY</code>, <code>REDMINE_PROJECT_ID</code>,
<code>REDMINE_TRACKER_BUG_ID</code>,
<code>REDMINE_TRACKER_SECURITY_ID</code> (optional, falls back to
bug), <code>REDMINE_ASSIGNEE_ID</code> (optional default owner).
</li>
<li>
Uses the Redmine REST API with the API key for authentication.
</li>
<li>
Ensure the API key is scoped to the project and can create issues.
</li>
</ul>
</section>
<section class="card">
<h2>Automatic tickets on failures</h2>
<ul>
<li>
<code>scripts/run-test-suite.sh</code> now files a Redmine issue
whenever any check fails. Security-related failures (npm audit,
Trivy, ZAP) use the security tracker when configured.
</li>
<li>
Issues are de-duplicated by fingerprinting the suite/target +
failure details; reruns of the same failing state will re-use the
open ticket instead of creating a duplicate.
</li>
<li>
Manual wrapper for other test commands:
<code>./scripts/run-tests-with-redmine.sh npm test</code> (set
<code>TEST_NAME</code> or <code>TRACKER</code> to override labels).
</li>
</ul>
</section>
<section class="card">
<h2>CLI tools</h2>
<ul>
<li>
List open tickets grouped by tracker:
<code
>REDMINE_URL=... REDMINE_API_KEY=... REDMINE_PROJECT_ID=...
./scripts/redmine-report.js list-open</code
>
</li>
<li>
Manual issue creation from a log file:
<code
>./scripts/redmine-report.js create-test-issue --suite my-tests
--failures-file /path/to/log --tracker bug</code
>
</li>
<li>
Outputs go to stdout; non-zero exit code on API errors so CI can
fail fast.
</li>
</ul>
</section>
<section class="card">
<h2>Notes</h2>
<ul>
<li>
Tickets include a short fingerprint in the subject and description;
keep it when editing so future runs keep de-duplicating.
</li>
<li>
Summary/log paths are included in the issue body to help locate
artifacts from the run.
</li>
</ul>
</section>
</main>
</body>
</html>