allure-framework / allure-framework/allure3

PublishAllureReport@2: allureDownloadUrl with Allure 3 source tar.gz fails (expects allure-2.36.0/bin)

Closed
#799 1 comment 0 reactions 1 assignee Claimed by @formaceft-93 View on GitHub
Dominant language
HTML
Stars
401
Forks
58
Avg merge
2d 20h
Merged PRs (30d)
34

Description

## Summary

`PublishAllureReport@2` (marketplace `qameta.allure-azure-pipelines` **2.1.5**) forces the **Allure 2** install path whenever `allureDownloadUrl` (or any `allureVersion`) is set. Pointing `allureDownloadUrl` at the Allure 3 GitHub **source** archive fails:

```
Downloading Allure Report from custom url:
https://github.com/allure-framework/allure3/archive/refs/tags/v3.14.3.tar.gz
Caching tool: allure 2.36.0 x64
Error: Directory does not exist: ...\allure-2.36.0\bin
at makeAllureFromUrl → publishAllure2Report
```

## Root cause (from published VSIX `tasks/PublishAllureReport/index.ts`)

```ts
if (allureVersionInput || allureDownloadUrlInput) {
await publishAllure2Report(...); // always Allure 2
return;
}
await publishAllure3Report(...);
```

`makeAllureFromUrl` then hard-codes:

```ts
prependPath(path.join(extractPath, `allure-${allureVersion || "2.36.0"}`, "bin"));
```

The URL `allure-framework/allure3/archive/refs/tags/v3.14.3.tar.gz` is monorepo **source**, not a CLI with `bin/`. Allure 3 generation in the task already uses **bundled** `@allurereport/*` npm packages — it must not go through `allureDownloadUrl`.

Additional packaging bug: **`reportDir` is documented on the marketplace page but missing from `task.json` inputs** in 2.1.5.

## Expected behavior

| Inputs | Path |
| --- | --- |
| empty `allureVersion` + empty `allureDownloadUrl` | Allure **3** (bundled generator / `reportDir`) |
| `allureVersion: 2.x` and/or Allure **2** release `.tgz` URL | Allure **2** CLI |
| `allureDownloadUrl` → allure3 source archive | **Clear error** (not a silent 2.36.0 bin path failure) |

## Proposed fix

Contribution fork with tests (reconstructed from VSIX 2.1.5; `allure-framework/allure-vsts` is archived and no public @2 repo exists under the org):

- Repo: https://github.com/grootstebozewolf/allure-azure-pipelines
- Changes: routing helpers + reject Allure 3 source URLs; dynamic `*/bin/allure` discovery; add `reportDir` to `task.json`; bump **2.1.6**
- Tests: `tasks/PublishAllureReport/routing.test.ts` (7 passed)

## Workaround (until marketplace ships a fix)

Do **not** set `allureDownloadUrl` / `allureVersion` for Allure 3:

```yaml
- task: PublishAllureReport@2
inputs:
testResultsDir: '$(Build.SourcesDirectory)/allure-results'
reportName: 'Living Documentation'
```

Or pre-generate single-file with `allure@3` (npm) and set `reportDir` only.

## Related

- Discussions: https://github.com/orgs/allure-framework/discussions/3200
- Discussions: https://github.com/orgs/allure-framework/discussions/3261

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.