diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 25e9b35..cbed2d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -98,6 +98,41 @@ jobs: COMPARISON_REPORT: ${{ steps.comparison.outputs.comparison-report }} run: python -c "import os, pathlib; report = pathlib.Path(os.environ['COMPARISON_REPORT']).read_text(encoding='utf-8'); assert 'Devscope PR comparison' in report and '| Metric | Base | Head | Delta |' in report" + - name: Test advanced review and HTML artifacts + if: github.event_name == 'pull_request' + uses: ./ + id: review + with: + review: 'true' + fail-on-new: 'true' + devscope-ref: 68c1fa668de53f71920e263bbb1f2325cb5f44d0 + + - name: Verify advanced reports and real CLI regression gate + if: github.event_name == 'pull_request' + shell: bash + env: + HTML_REPORT: ${{ steps.review.outputs.review-html }} + JSON_REPORT: ${{ steps.review.outputs.review-json }} + NEW_WARNINGS: ${{ steps.review.outputs.new-warnings }} + run: | + python - <<'PY' + import json, os, pathlib, subprocess + html = pathlib.Path(os.environ['HTML_REPORT']).read_text(encoding='utf-8') + data = json.loads(pathlib.Path(os.environ['JSON_REPORT']).read_text(encoding='utf-8')) + assert data['kind'] == 'review' and data['new_warnings'] == 0 + assert os.environ['NEW_WARNINGS'] == '0' + assert 'Filter files and evidence' in html and 'History-aware hotspots' in html + fixture = pathlib.Path('test-repo').resolve() + base = subprocess.check_output(['git', '-C', str(fixture), 'rev-parse', 'HEAD'], text=True).strip() + (fixture / 'regression.py').write_text('pass\n' * 501, encoding='utf-8') + subprocess.run(['git', '-C', str(fixture), 'add', '.'], check=True) + subprocess.run(['git', '-C', str(fixture), '-c', 'commit.gpgsign=false', 'commit', '-m', 'Regression fixture'], check=True) + output = fixture / 'gate.json' + result = subprocess.run(['devscope', 'review', str(fixture), '--base', base, '--fail-on-new', '--format', 'json', '--output', str(output)]) + assert result.returncode == 2 + assert json.loads(output.read_text(encoding='utf-8'))['new_warnings'] == 1 + PY + - name: Report test results if: always() shell: bash diff --git a/CHANGELOG.md b/CHANGELOG.md index c4b7f4d..bb1e00a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# Development: advanced review + +- Opt-in review checklists, history evidence and package scopes. +- New-warning gates that retain reports before failing. +- Coverage input and exact-head provenance assertion. +- HTML/JSON/Markdown artifacts and structured outputs. +- Validated review options, bounded summaries and cross-platform integration tests. +- Development default CLI version moves to published 0.2.0; advanced review uses a source pin until 0.3.0 is released. + +## 1.2.0 — 2026-12-04 + +Published reliable PR/push gates, structured outputs, read-only comment behavior, +Windows threshold rendering fixes and opt-in PR comparisons. The v1 tag points +to this release; comparisons can use the published CLI 0.2.0. + # Changelog All notable changes to this project will be documented in this file. diff --git a/README.md b/README.md index e478baf..7062adc 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,14 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: EhsanAzish80/devscope-action@ee711970e3a18ea07430ca9027f862af4311239c + - uses: EhsanAzish80/devscope-action@v1.2.0 id: devscope with: fail-under: B + devscope-version: '0.2.0' ``` -The quick start pins the merged gate fixes; the floating `@v1` tag has not yet been updated. By default, the Action installs the published PyPI package. Results are available as `health`, `risk`, `onboarding`, and `grade` outputs. It posts one updated PR comment when the workflow token has write permission. PRs from forks often receive a read-only token; in that case the comment is skipped and the analysis and threshold check still run. +Action 1.2.0 is released and is also available through `@v1`. By default, the Action installs the published PyPI package. Results are available as `health`, `risk`, `onboarding`, and `grade` outputs. It posts one updated PR comment when the workflow token has write permission. PRs from forks often receive a read-only token; in that case the comment is skipped and the analysis and threshold check still run. ## Inputs @@ -34,9 +35,16 @@ The quick start pins the merged gate fixes; the floating `@v1` tag has not yet b | `max-risk` | unset | Highest accepted risk label: Low, Medium, High | | `max-onboarding` | unset | Highest accepted onboarding label: Easy, Moderate, Hard | | `github-token` | `github.token` | Token for PR comments | -| `devscope-version` | `0.1.1` | Published PyPI version to install | +| `devscope-version` | `0.2.0` | Published PyPI version to install | | `devscope-ref` | unset | Full upstream CLI commit SHA to install instead of the PyPI version | | `compare` | `false` | Add an advisory comparison on `pull_request` events | +| `review` | `false` | Advanced checklist, history, new-warning gate and report artifacts | +| `fail-on-new` | `false` | Fail for new review warnings; requires `review: true` | +| `package` | unset | One repository-relative package scope for review | +| `coverage` | unset | LCOV or Cobertura report path, generated before this step | +| `coverage-commit` | unset | Coverage producer's commit; must match the PR head | +| `coverage-root` | unset | Original repository-root prefix in coverage paths | +| `artifact-name` | `devscope-review` | Review artifact name prefix (OS is appended) | When a threshold is set, it applies to **both pull requests and pushes**. Analysis errors fail the job instead of producing a default grade. The grade is based on file layout, test-file ratio, Git activity, and hotspots. The test-file ratio is not code coverage. Read [the CLI guide](https://github.com/EhsanAzish80/Devscope#what-the-report-tells-you) before using a grade as a gate. @@ -45,8 +53,7 @@ For a fork PR, do not switch to `pull_request_target` and execute untrusted code ## PR comparison Save this as `.github/workflows/devscope.yml`, or copy the complete -[example workflow](examples/pr-comparison.yml). The Action integration commit is -pinned so the workflow can run before a new Action tag or CLI package is released. +[example workflow](examples/pr-comparison.yml). It uses the released comparison engine. ```yaml name: Devscope PR comparison @@ -62,13 +69,11 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - # Pinned integration commit; @v1 does not include comparison yet. - - uses: EhsanAzish80/devscope-action@b2058cd71ef51077b36cf1b9e84958f6d4b0a45a + - uses: EhsanAzish80/devscope-action@v1.2.0 id: devscope with: compare: 'true' - # Merged CLI commit containing compare; not an unreleased PyPI version. - devscope-ref: d9849fddd644f98a67985115af74c74ff0a5230e + devscope-version: '0.2.0' ``` The report includes count deltas and added, removed or changed review areas from @@ -79,8 +84,9 @@ advisory; the existing grade/risk/onboarding thresholds remain absolute gates. `compare` defaults to `false` and is skipped outside pull requests. When enabled: -- Use a compare-capable CLI. The pinned `devscope-ref` above is a verified merged - commit; the default PyPI version `0.1.1` does not have `compare`. +- Use CLI 0.2.0 or newer for comparison. The released Action 1.2.0 retains its + older 0.1.1 default; set `devscope-version` as shown. The development Action + defaults to 0.2.0. - Check out the exact PR head with full history. Both event SHAs must be available. Shallow or missing history fails the comparison with a setup message. - Set `path` to the Git repository root. Subdirectory comparisons are not supported. @@ -92,6 +98,68 @@ later steps in the same job. It is empty when comparison is disabled or skipped. Long comments are truncated with a pointer to the full job summary. Git activity, symlinks, submodules and Git archive export-ignored files are excluded. +## Advanced review (development) + +Advanced review requires the 0.3.0 CLI source and this development Action; it is +not included in the released Action 1.2.0 or CLI 0.2.0. The complete +[review workflow](examples/review.yml) uses exact source pins: + +```yaml +name: Devscope review guidance +on: pull_request +permissions: + contents: read + pull-requests: write +jobs: + review: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + # Source pins until the advanced Action and CLI are released. + - uses: EhsanAzish80/devscope-action@2c2f8f7d7e9d873057708bc6bb42e9c49c840dc9 + with: + devscope-ref: 68c1fa668de53f71920e263bbb1f2325cb5f44d0 + review: 'true' + fail-on-new: 'true' + # After generating coverage in an earlier step, optionally add: + # coverage: coverage.info + # coverage-commit: ${{ github.event.pull_request.head.sha }} +``` + +Review mode supersedes the basic comparison when both flags are enabled. It adds: + +- A changed-file checklist with exact-commit source links, target-history counts, + co-change suggestions and evidence for each warning. +- Repo-wide history hotspots, package summaries, and optional measured patch coverage. +- HTML, JSON and Markdown artifacts retained for 7 days. Download `review.html` + for the self-contained, filterable offline report. The OS is appended to the + artifact name; set a different `artifact-name` for repeated uses in one job. +- `review-html`, `review-json` and `new-warnings` outputs, alongside the existing + `comparison-report` Markdown path. + +Commit `.devscope.json` and an optional `.devscope-baseline.json` on the target +branch. Both snapshots use target policy, so a PR cannot disable its own gate. +`fail-on-new` is opt-in and only blocks new configured warnings; it does not +block existing or accepted warnings. Invalid Boolean values and review-only +options without `review: true` fail setup. The report and artifacts are produced +before a new-warning gate failure, allowing reviewers to inspect the evidence. +Absolute grade/risk/onboarding gates remain separate. + +Generate coverage for the exact PR head before invoking the Action. When setting +`coverage`, also set `coverage-commit` to that SHA. This is a caller assertion, +not independent verification of freshness. Lines absent from the report remain +unmapped/unknown, not automatically uncovered. The initial warning rules are +configurable large source files and zero-hit added executable lines in supplied +coverage. Size, churn and co-change signals remain heuristics. + +Configuration, baseline identity, package scopes, coverage mapping and onboarding +commands are explained in the [CLI feature guide](https://github.com/EhsanAzish80/Devscope/blob/68c1fa668de53f71920e263bbb1f2325cb5f44d0/README.md#review-guidance-030-development). +For repository exploration use `devscope onboard`; it displays declared commands +without executing them. Reports contain paths and metadata, not source code. + ## Development Run the shell integration checks locally: @@ -102,6 +170,6 @@ python3 -m unittest discover -s tests -p 'test_*.py' node --test tests/comment.test.cjs ``` -The published `@v1` tag is unchanged. Use the pinned commits above to try the relevant behavior. Once a CLI package containing `compare` is released, you can use its `devscope-version` and omit `devscope-ref`; until then, the default remains the published `0.1.1` package. CI exercises the comparison against the pinned CLI on Ubuntu, macOS and Windows. +Released Action 1.2.0 is available via `@v1`; CLI 0.2.0 is on PyPI. Advanced review remains source-only pending review and release. CI tests comparison, advanced report artifacts, permissive gates and a real new-warning regression gate on Ubuntu, macOS and Windows. MIT licensed. See [LICENSE](LICENSE). diff --git a/action.yml b/action.yml index c3ee88e..91748c3 100644 --- a/action.yml +++ b/action.yml @@ -30,7 +30,7 @@ inputs: devscope-version: description: 'PyPI version of devscope to install' required: false - default: '0.1.1' + default: '0.2.0' devscope-ref: description: 'Optional full commit SHA from EhsanAzish80/Devscope; overrides devscope-version' required: false @@ -39,8 +39,45 @@ inputs: description: 'Include an advisory PR comparison (requires a compare-capable CLI, full history and repository-root path)' required: false default: 'false' + review: + description: 'Enable history-aware review guidance and HTML/JSON artifacts on pull requests (requires CLI 0.3.0 or matching source ref)' + required: false + default: 'false' + fail-on-new: + description: 'Fail only for new configured warnings (requires review: true)' + required: false + default: 'false' + package: + description: 'Optional repository-relative package scope for review' + required: false + default: '' + coverage: + description: 'Optional path to an LCOV or Cobertura report generated before this step' + required: false + default: '' + coverage-commit: + description: 'Commit for which coverage was generated; must match the PR head' + required: false + default: '' + coverage-root: + description: 'Source-root prefix recorded in the coverage report' + required: false + default: '' + artifact-name: + description: 'Review artifact name prefix; change when using review more than once per job' + required: false + default: 'devscope-review' outputs: + review-html: + description: 'Path to the offline HTML review report' + value: ${{ steps.compare.outputs.html-path }} + review-json: + description: 'Path to structured review data' + value: ${{ steps.compare.outputs.json-path }} + new-warnings: + description: 'Number of new review warnings (empty outside review mode)' + value: ${{ steps.compare.outputs.new-warnings }} comparison-report: description: 'Path to the Markdown comparison report (empty when disabled or outside a PR)' value: ${{ steps.compare.outputs.report-path }} @@ -60,6 +97,16 @@ outputs: runs: using: 'composite' steps: + - name: Validate review options + shell: bash + env: + REVIEW_ENABLED: ${{ inputs.review }} + COMPARE_ENABLED: ${{ inputs.compare }} + NEW_GATE: ${{ inputs.fail-on-new }} + PACKAGE_SCOPE: ${{ inputs.package }} + COVERAGE_REPORT: ${{ inputs.coverage }} + run: bash "${{ github.action_path }}/scripts/validate-options.sh" + - name: Set up Python uses: actions/setup-python@v5 with: @@ -90,14 +137,30 @@ runs: - name: Compare PR snapshots id: compare - if: github.event_name == 'pull_request' && inputs.compare == 'true' + if: github.event_name == 'pull_request' && (inputs.compare == 'true' || inputs.review == 'true') shell: bash env: DEVSCOPE_PATH: ${{ inputs.path }} + DEVSCOPE_REVIEW: ${{ inputs.review }} + DEVSCOPE_FAIL_ON_NEW: ${{ inputs.fail-on-new }} + DEVSCOPE_PACKAGE: ${{ inputs.package }} + DEVSCOPE_COVERAGE: ${{ inputs.coverage }} + DEVSCOPE_COVERAGE_COMMIT: ${{ inputs.coverage-commit }} + DEVSCOPE_COVERAGE_ROOT: ${{ inputs.coverage-root }} + DEVSCOPE_REPO_URL: ${{ github.server_url }}/${{ github.repository }} DEVSCOPE_BASE: ${{ github.event.pull_request.base.sha }} DEVSCOPE_HEAD: ${{ github.event.pull_request.head.sha }} run: python "${{ github.action_path }}/scripts/compare.py" + - name: Upload review reports + if: github.event_name == 'pull_request' && inputs.review == 'true' + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.artifact-name }}-${{ runner.os }} + path: ${{ steps.compare.outputs.artifacts-dir }} + if-no-files-found: error + retention-days: 7 + - name: Post PR comment if: github.event_name == 'pull_request' uses: actions/github-script@v7 @@ -124,3 +187,10 @@ runs: DEVSCOPE_MAX_RISK: ${{ inputs.max-risk }} DEVSCOPE_MAX_ONBOARDING: ${{ inputs.max-onboarding }} run: bash "${{ github.action_path }}/scripts/check-thresholds.sh" + + - name: Enforce new-issue gate + if: steps.compare.outputs.gate-failed == 'true' + shell: bash + run: | + echo 'Devscope found new configured review warnings. See the PR report or downloaded artifact.' >&2 + exit 2 diff --git a/examples/pr-comparison.yml b/examples/pr-comparison.yml index 3d39f59..b8b0cb0 100644 --- a/examples/pr-comparison.yml +++ b/examples/pr-comparison.yml @@ -11,10 +11,8 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - # Pinned integration commit; @v1 does not include comparison yet. - - uses: EhsanAzish80/devscope-action@b2058cd71ef51077b36cf1b9e84958f6d4b0a45a + - uses: EhsanAzish80/devscope-action@v1.2.0 id: devscope with: compare: 'true' - # Merged CLI commit containing compare; not an unreleased PyPI version. - devscope-ref: d9849fddd644f98a67985115af74c74ff0a5230e + devscope-version: '0.2.0' diff --git a/examples/review.yml b/examples/review.yml new file mode 100644 index 0000000..dfd305d --- /dev/null +++ b/examples/review.yml @@ -0,0 +1,22 @@ +name: Devscope review guidance +on: pull_request +permissions: + contents: read + pull-requests: write +jobs: + review: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + # Source pins until the advanced Action and CLI are released. + - uses: EhsanAzish80/devscope-action@2c2f8f7d7e9d873057708bc6bb42e9c49c840dc9 + with: + devscope-ref: 68c1fa668de53f71920e263bbb1f2325cb5f44d0 + review: 'true' + fail-on-new: 'true' + # After generating coverage in an earlier step, optionally add: + # coverage: coverage.info + # coverage-commit: ${{ github.event.pull_request.head.sha }} diff --git a/scripts/compare.py b/scripts/compare.py index a2974d9..cd3a928 100644 --- a/scripts/compare.py +++ b/scripts/compare.py @@ -1,5 +1,6 @@ -"""Write one committed PR comparison to the job summary and expose its report path.""" +"""Generate committed comparisons/reviews before optional comments and gates.""" +import json import os from pathlib import Path import re @@ -24,46 +25,116 @@ def main(): ).stdout.strip() if prefix: raise ValueError( - "Comparison path must be a Git repository root; subdirectory comparisons are not supported" + "Comparison path must be a Git repository root; use package input for review subdirectories" ) - # Capture before writing anything so unavailable refs cannot publish a partial report. - report = subprocess.run( - [ + directory = Path( + tempfile.mkdtemp( + prefix="devscope-comparison-", dir=os.environ.get("RUNNER_TEMP") + ) + ) + environment = {**os.environ, "PYTHONIOENCODING": "utf-8", "PYTHONUTF8": "1"} + outputs = {} + if os.environ.get("DEVSCOPE_REVIEW") == "true": + from devscope.reports import report_html, report_markdown + + json_path = directory / "review.json" + args = [ "devscope", - "compare", + "review", str(path), "--base", base, "--head", head, "--format", - "markdown", - ], - check=True, - capture_output=True, - text=True, - encoding="utf-8", - env={**os.environ, "PYTHONIOENCODING": "utf-8", "PYTHONUTF8": "1"}, - ).stdout - directory = Path( - tempfile.mkdtemp( - prefix="devscope-comparison-", dir=os.environ.get("RUNNER_TEMP") + "json", + "--output", + str(json_path), + ] + for env_name, option in ( + ("DEVSCOPE_PACKAGE", "--package"), + ("DEVSCOPE_COVERAGE", "--coverage"), + ("DEVSCOPE_COVERAGE_COMMIT", "--coverage-commit"), + ("DEVSCOPE_COVERAGE_ROOT", "--coverage-root"), + ): + if os.environ.get(env_name): + args += [option, os.environ[env_name]] + gated = os.environ.get("DEVSCOPE_FAIL_ON_NEW") == "true" + if gated: + args.append("--fail-on-new") + process = subprocess.run( + args, capture_output=True, text=True, encoding="utf-8", env=environment ) - ) + if ( + process.returncode not in ((0, 2) if gated else (0,)) + or not json_path.exists() + ): + raise subprocess.CalledProcessError( + process.returncode or 1, args, stderr=process.stderr + ) + data = json.loads(json_path.read_text(encoding="utf-8")) + repo_url = os.environ.get("DEVSCOPE_REPO_URL") + report = report_markdown(data, repo_url) + html_path = directory / "review.html" + html_path.write_text(report_html(data, repo_url), encoding="utf-8") + outputs.update( + { + "json-path": str(json_path), + "html-path": str(html_path), + "artifacts-dir": str(directory), + "new-warnings": str(data["new_warnings"]), + "gate-failed": str(process.returncode == 2).lower(), + } + ) + else: + report = subprocess.run( + [ + "devscope", + "compare", + str(path), + "--base", + base, + "--head", + head, + "--format", + "markdown", + ], + check=True, + capture_output=True, + text=True, + encoding="utf-8", + env=environment, + ).stdout report_path = directory / "comparison.md" report_path.write_text(report, encoding="utf-8") + outputs["report-path"] = str(report_path) + summary_text = report + if len(report.encode("utf-8")) > 900000: + summary_text = ( + report.encode("utf-8")[:750000].decode("utf-8", errors="ignore") + + "\n\nReport truncated; full Markdown is available through the comparison-report output.\n" + ) with open(os.environ["GITHUB_STEP_SUMMARY"], "a", encoding="utf-8") as summary: - summary.write(report + "\n") - with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as outputs: - outputs.write(f"report-path={report_path}\n") + summary.write(summary_text + "\n") + with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output_file: + for name, value in outputs.items(): + output_file.write(f"{name}={value}\n") if __name__ == "__main__": try: main() - except (ValueError, OSError, subprocess.CalledProcessError): + except ( + ImportError, + ValueError, + OSError, + subprocess.CalledProcessError, + KeyError, + ) as error: print( - "PR comparison failed. Use a compare-capable Devscope commit, use a repository-root path, checkout the PR head with fetch-depth: 0, and ensure both refs are available.", + "Devscope reporting failed. Use a CLI supporting the selected mode, a repository-root path, full Git history, and valid PR refs. Coverage requires a matching coverage-commit.", file=sys.stderr, ) + if isinstance(error, subprocess.CalledProcessError) and error.stderr: + print(error.stderr.replace("::", ": :"), file=sys.stderr) raise SystemExit(1) diff --git a/scripts/validate-options.sh b/scripts/validate-options.sh new file mode 100644 index 0000000..b3da906 --- /dev/null +++ b/scripts/validate-options.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail +for flag in "${REVIEW_ENABLED:-false}" "${COMPARE_ENABLED:-false}" "${NEW_GATE:-false}"; do + if [[ "$flag" != true && "$flag" != false ]]; then + echo 'review, compare and fail-on-new accept only true or false' >&2 + exit 1 + fi +done +if [[ "${NEW_GATE:-false}" == true && "${REVIEW_ENABLED:-false}" != true ]]; then + echo 'fail-on-new requires review: true' >&2 + exit 1 +fi +if [[ -n "${PACKAGE_SCOPE:-}${COVERAGE_REPORT:-}" && "${REVIEW_ENABLED:-false}" != true ]]; then + echo 'package and coverage inputs require review: true' >&2 + exit 1 +fi diff --git a/tests/test-action.sh b/tests/test-action.sh index 5269747..5ed1998 100644 --- a/tests/test-action.sh +++ b/tests/test-action.sh @@ -48,3 +48,18 @@ grep -qx -- '--fail-under' "$MOCK_CI_ARGS" grep -qx -- '--max-risk' "$MOCK_CI_ARGS" echo 'Action scripts passed.' + + +REVIEW_ENABLED=true NEW_GATE=true bash scripts/validate-options.sh +if REVIEW_ENABLED=false NEW_GATE=true bash scripts/validate-options.sh; then + echo 'A new-warning gate without review unexpectedly passed' >&2 + exit 1 +fi +if REVIEW_ENABLED=false COVERAGE_REPORT=coverage.xml bash scripts/validate-options.sh; then + echo 'Coverage without review unexpectedly passed' >&2 + exit 1 +fi +if COMPARE_ENABLED=tru bash scripts/validate-options.sh; then + echo 'Invalid comparison option unexpectedly passed' >&2 + exit 1 +fi diff --git a/tests/test_comparison.py b/tests/test_comparison.py index 2e0be1c..1d75f0d 100644 --- a/tests/test_comparison.py +++ b/tests/test_comparison.py @@ -5,6 +5,8 @@ from pathlib import Path import subprocess import tempfile +import types +import sys import unittest from unittest.mock import patch @@ -96,6 +98,73 @@ def test_subdirectory_is_rejected(self): compare.main() self.assertEqual(run.call_count, 1) + def test_review_gate_retains_reports_and_transports_options(self): + renderer = types.ModuleType("devscope.reports") + renderer.report_markdown = lambda data, url: "## Devscope review checklist\n" + renderer.report_html = lambda data, url: "