Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allure 2.24.0 always enables analytics #2123

Closed
1 task done
arnulfojr opened this issue Sep 26, 2023 · 2 comments · Fixed by #2139
Closed
1 task done

Allure 2.24.0 always enables analytics #2123

arnulfojr opened this issue Sep 26, 2023 · 2 comments · Fixed by #2139
Labels
type:bug Something isn't working

Comments

@arnulfojr
Copy link

Describe the Bug

On the 2.24.0 release the support for generating single file reports introduced a bug that completely ignores the environment variable to disable analytics on the generated html report.

The usage in the template is

</#list>
<#if analyticsDisable == false>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FVWC4GKEYS"></script>

To the extend of my understanding (rather limited) the configuration is later overwritten by the hard coded values here:

dataModel.put("reportDataFiles", reportDataFiles);
}
dataModel.put("analyticsDisable", false);
dataModel.put("reportUuid", UUID.randomUUID().toString());
dataModel.put("allureVersion", "dev");
template.process(dataModel, writer);

ignoring the config set by

final Boolean noAnalytics = Optional.ofNullable(System.getenv(Constants.NO_ANALYTICS))

dataModel.put(Constants.NO_ANALYTICS, noAnalytics);

Steps to Reproduce

Generate the report with the env variable ALLURE_NO_ANALYTICS=true the generated report will still have analytics.

Snapshot from a report:

<script src="app.js"></script>
    <script src="plugin/behaviors/index.js"></script>
    <script src="plugin/screen-diff/index.js"></script>
    <script src="plugin/packages/index.js"></script>
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-FVWC4GKEYS"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'G-FVWC4GKEYS');
        gtag('allureVersion', 'dev')
        gtag('reportUuid', 'uuid-like');

Expected Behaviour

it does not include the analytics

Screenshots or Additional Context

<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
    <meta charset="utf-8">
    <title>Allure Report</title>
    <link rel="favicon" href="favicon.ico">
    <link rel="stylesheet" type="text/css" href="styles.css">
    <link rel="stylesheet" type="text/css" href="plugin/screen-diff/styles.css">
</head>
<body>
    <div id="alert"></div>
    <div id="content">
        <span class="spinner">
            <span class="spinner__circle"></span>
        </span>
    </div>
    <div id="popup"></div>
    <script src="app.js"></script>
    <script src="plugin/behaviors/index.js"></script>
    <script src="plugin/screen-diff/index.js"></script>
    <script src="plugin/packages/index.js"></script>
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-FVWC4GKEYS"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'G-FVWC4GKEYS');
        gtag('allureVersion', 'dev')
        gtag('reportUuid', 'uuid-like-string')
    </script>
</body>
</html>

What Language are you using?

JavaScript, TypeScript

What Framework/Allure Integration you are using?

allure-commandline

What version of Allure Integration you are using?

2.24.0

What version of Allure Report you are using?

2.24.0

Code of Conduct

  • I agree to follow this project's Code of Conduct
@arnulfojr arnulfojr added triage type:bug Something isn't working labels Sep 26, 2023
@baev
Copy link
Member

baev commented Sep 26, 2023

Thanks for the report, I'll look at this as soon as possible

@arnulfojr
Copy link
Author

(for cross referencing only) related ticket #2018

@baev baev mentioned this issue Oct 5, 2023
2 tasks
@baev baev closed this as completed in #2139 Oct 5, 2023
baev added a commit that referenced this issue Oct 5, 2023
@baev baev removed the triage label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants