Skip to content

Global attachments disappear when a single environment is selected #869

Description

@d-braun

What happened?

Description

Files declared via globalAttachments are only visible in the "Global Attachments" tab while the environment
picker is set to "All". As soon as a single environment is selected, the tab shows 0 and renders
"No attachments information available" — even though the attachments are not environment-specific by nature.

In a multi-environment report this makes global attachments effectively invisible: an environment is exactly the view
you work in when you look at one staging, one language or one browser.

How can we reproduce it?

Steps to reproduce

Minimal repro (Allure 3.15.0, awesome plugin, no test framework involved):

allurerc.mjs

export default {                                                                                                                                                                                                                   
    name: "Global attachment repro",                                                                                                                                                                                               
    output: "./allure-report",                                                                                                                                                                                                     
    globalAttachments: ["notes.txt"],                                                                                                                                                                                              
    environments: {                                                                                                                                                                                                                
        "env-a": { matcher: ({labels}) => labels?.some(l => l.name === "environment" && l.value === "a") },                                                                                                                        
        "env-b": { matcher: ({labels}) => labels?.some(l => l.name === "environment" && l.value === "b") },                                                                                                                        
    },                                                                                                                                                                                                                             
    plugins: {                                                                                                                                                                                                                     
        awesome: { import: "@allurereport/plugin-awesome", options: {reportName: "Global attachment repro"} },                                                                                                                     
    },                                                                                                                                                                                                                             
};                                                                                                                                                                                                                                 

notes.txt

a global attachment                                                                                                                                                                                                                

allure-results/1-result.json (and a second one with "value": "b", other ids)

{"uuid":"u1","historyId":"h1","testCaseId":"tc1","name":"testA","fullName":"suite.TestA.testA",                                                                                                                                    
 "status":"passed","start":0,"stop":1000,"labels":[{"name":"environment","value":"a"}]}                                                                                                                                            

Then:

  1. allure generate allure-results --config allurerc.mjs --output allure-report
  2. Serve allure-report and open it
  3. Environment picker on "All" → tab reads "Global Attachments 1", notes.txt is listed ✔
  4. Switch the picker to env-a (or env-b) → tab reads "Global Attachments 0", body says
    "No attachments information available" ✘

What did you expect?

Expected behaviour

A global attachment is by definition not bound to one environment, so it should be listed in every view — either
always, or at least when it carries the default environment that the core assigns to it.

Actual behaviour

Visible only with the picker on "All"; 0 for every concrete environment.

Notes from the source

  • AllureReport.start (@allurereport/core/dist/report.js) resolves the globalAttachments globs and dispatches
    sendGlobalAttachment(...); the generated widgets/globals.json shows "environment": "default" for each entry.
  • The frontend (@allurereport/web-awesome) loads widgets/globals.json — a single fixed path — and renders nothing
    for global attachments while an environment is selected.
  • For comparison, the Quality Gate tab behaves differently: its widget is keyed by environment id
    ({ "<env>": [ … ] }) and its entries do show up with a single environment selected. Global attachments have no
    such key, and end up filtered out.

Environment

Environment

allure (CLI) 3.15.0
plugin @allurereport/plugin-awesome (report footer: Ver: 3.15.0)
Node.js v24.19.0 (also seen with v25.6.1)
OS macOS 26.6.1; same behaviour on the Linux and Windows CI agents
Report mode multi-file (singleFile: false)

Additional context

Those are exactly the files someone opens while triaging one staging, and that is the view where they
are currently unreachable. The only way to read them today is switching the picker back to "All", which is easy to miss.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions