Skip to content

Keep environment-agnostic global attachments and errors visible per environment (fixes #869) - #927

Open
d-braun wants to merge 2 commits into
allure-framework:mainfrom
d-braun:fix/869-global-attachments-per-environment
Open

Keep environment-agnostic global attachments and errors visible per environment (fixes #869)#927
d-braun wants to merge 2 commits into
allure-framework:mainfrom
d-braun:fix/869-global-attachments-per-environment

Conversation

@d-braun

@d-braun d-braun commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Context

Fixes #869.

Files declared via globalAttachments were only listed in the Global Attachments tab while the
environment picker was set to All. As soon as a single environment was selected, the tab showed
0 and rendered "No attachments information available" — even though such attachments aren't
environment-specific at all. In a multi-environment report that made them effectively unreachable,
because a single environment is exactly the view you work in while triaging one staging, language or
browser.

Cause

widgets/globals.json carries two views of the same data: the flat attachments list and the
per-environment attachmentsByEnv index. Global data which isn't bound to an environment is indexed
under the default environment by AllureStore (#indexGlobalAttachment /#indexGlobalError), so it
ends up in the default bucket. The frontend rendered only attachmentsByEnv[<selected env>] while
an environment was selected and therefore dropped the default bucket — the one bucket that applies
to every environment.

Solution

A shared selector, packages/web-awesome/src/utils/globals.ts, resolves the buckets to render:

  • no environment selected ("All") — every non-empty bucket, as before;
  • a single environment selected — the bucket of that environment plus the default bucket,
    because entries without an own environment are shared by all of them. This mirrors how quality
    gate results behave: filterable per environment, but global when they carry no environment;
  • default selected — the shared bucket exactly once, no duplicates;
  • reports without an attachmentsByEnv / errorsByEnv breakdown — the flat list is treated as
    environment-agnostic and stays visible in every view.

The existing rendering rules are kept: a lone default bucket renders as a plain list, anything else
renders as environment sections (the selected environment first, the shared one after it).

Applied to:

  • ReportGlobalAttachments — the reported case;
  • ReportGlobalErrors — the same widget and the same defect, e.g. the stdout/stderr attachments
    and the "Test process has failed" error dispatched by allure run carry no environment and
    disappeared the same way;
  • MainReport — the tab counters now count exactly what the tabs render.

No changes to the report data model, the core store or the generators, so existing reports are fixed
by regenerating with the new frontend, and reports without a per-environment breakdown keep working.

Checklist

Verified with yarn allure agent -- yarn workspace @allurereport/web-awesome test test/components/ReportGlobals.test.tsx test/utils/globals.test.ts → 17 passed, exit 0,
expectations: matched. Full package suite: 227 passed. yarn workspace @allurereport/web-awesome build, yarn format:check and tsc --noEmit are clean (no new diagnostics).

@d-braun
d-braun force-pushed the fix/869-global-attachments-per-environment branch 3 times, most recently from 46f3af1 to 0873807 Compare September 7, 2026 22:23
@d-braun
d-braun force-pushed the fix/869-global-attachments-per-environment branch from 0873807 to 93b5b2e Compare September 8, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global attachments disappear when a single environment is selected

1 participant