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

Disabling first time experience in CI #12195

Open
jaredpar opened this issue Jun 25, 2020 · 16 comments
Open

Disabling first time experience in CI #12195

jaredpar opened this issue Jun 25, 2020 · 16 comments
Milestone

Comments

@jaredpar
Copy link
Member

What are the recommended steps to disable the first time experience and telemetry in CI? Specifically for GitHub Actions. I've tried using the environment variables suggested in other issues but this has no impact.

    - name: Restore
      run: dotnet restore
      env:
        DOTNET_CLI_TELEMETRY_OPTOUT: 1
        DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1

This still produces the first time output when running restore (on all OS):

image

@timheuer
Copy link
Member

Same as #3828?

@jaredpar
Copy link
Member Author

@timheuer #3828 is a long issue with many comments. It's very difficult to pullout a concrete actionable message in that issue. The change I listed here was done by pulling out what information I could find in that issue and it didn't work.

@timheuer
Copy link
Member

timheuer commented Jun 25, 2020

@jaredpar if you add DOTNET_NOLOGO: true this disables. Now this is in .300 i added it as well and it suppresses. I think this was your goal right? Ex: https://github.com/timheuer/buildtest/runs/808185371?check_suite_focus=true#step:4:1

@jaredpar
Copy link
Member Author

Yep that works. Thanks!

Do we have this documented anywhere though in a MD file? Or is the expectation that customers should be going through GitHub issues to discover this?

@timheuer
Copy link
Member

@jaredpar yep it is in the docs under environment vars section: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet#environment-variables

@marcpopMSFT marcpopMSFT added this to the Discussion milestone Jun 25, 2020
@PathogenDavid
Copy link
Contributor

Is it intentional that DOTNET_NOLOGO doesn't work in preview releases? I've been debugging why it wasn't working for me and eventually I figured out using 3.1.300 instead of 5 preview 6 fixed it.

.NET 5 Preview 6:

Run dotnet build

Welcome to .NET 5.0!
---------------------
SDK Version: 5.0.100-preview.6.20318.15

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. The data is anonymous. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

.NET Core 3.1.300

Run dotnet build
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

@timheuer
Copy link
Member

@PathogenDavid I think in previews we keep it for telemetry warning, is that right @marcpopMSFT -- or could just be a bug :-)

@PathogenDavid
Copy link
Contributor

PathogenDavid commented Jul 21, 2020

I'm starting to lean more towards bug.

I was messing around with it some more and found out that if I opt-out of telemetry that part of the notice (and only that part) goes away. That reminded me that I still had the ASP.NET certificate enabled, so I disabled it and it's still being generated. Tried with .NET Core 3.1.300 and it doesn't happen there.

Edit: Happens with preview 7 too: Welcome message and certificate

I dug a little bit, turns out that was a red herring. Turns out the real issue there is that the ASP.NET certificate notice is part of the welcome message, so it's printed regardless of whether a certificate was actually generated.

@PathogenDavid
Copy link
Contributor

PathogenDavid commented Jul 22, 2020

Got it figured it out. The DOTNET_NOLOGO changes aren't in .NET 5 yet. I assume the feature was added sometime between when dotnet/cli was merged into this repo for .NET 5 development and now (or something like that.)

It looks like #12424 will fix this for future previews.

@marcpopMSFT
Copy link
Member

@PathogenDavid You are correct. We didn't have automatic code flow from 3.1 into our .net 5 branches but we have caught up with that PR and are monitoring for additional changes we'll need in the future so we should be good for a future PR.

@KirillOsenkov
Copy link
Member

A customer on Twitter is mentioning that dotnet msbuild does not respect the DOTNET_NOLOGO environment variable: https://twitter.com/jasonkarns/status/1320030746619334656

Is this a bug?

@PathogenDavid
Copy link
Contributor

PathogenDavid commented Oct 25, 2020

DOTNET_NOLOGO does what it's supposed to with dotnet msbuild:

image

I think that Jason is expecting it to do the same thing as /nologo, which isn't how it's documented in either of the two places I could find. (Here and here)

It's probably unnecessarily confusing to have two different concepts use nologo, but I imagine it's way too late to switch to DOTNET_NOWELCOME.

@ericsampson
Copy link

ericsampson commented Oct 25, 2020

This is a separate topic, but would it make sense to have DOTNET_SKIP_FIRST_TIME_EXPERIENCE set to true by default in GitHub Actions hosted runners? Just thinking that the % of users that will know to set this is probably small, and that in aggregate worldwide having it default true could probably save some carbon emissions (and customer build minute $) :D

@ericsampson
Copy link

would it not be somewhat logical to change things so that setting DOTNET_NOLOGO=1 would also disable the MSBuild welcome output when its run via 'dotnet msbuild' ?

@PathogenDavid
Copy link
Contributor

PathogenDavid commented Oct 25, 2020

@ericsampson That's probably a better request for actions/setup-dotnet. Also IIRC DOTNET_SKIP_FIRST_TIME_EXPERIENCE was superseded by DOTNET_NOLOGO.

Also since we're talking about carbon emissions you should probably set DOTNET_GENERATE_ASPNET_CERTIFICATE to false unless you actually need it.

(Also also if you're really concerned about minutes and carbon emissions, you should probably use custom build agents that have everything you need pre-installed.)

would also disable the MSBuild welcome output when its run via 'dotnet msbuild' ?

In my opinion, it absolutely should not. What MSBuild prints is not really a welcome message. It's telling you the version of MSBuild being run, which personally is something I'd want in my CI logs.

@ericsampson
Copy link

@PathogenDavid fair point - I guess there's no MSBUILD_NOLOGO equivalent.
It's just unfortunate that there is a naming collision between DOTNET_NOLOGO and dotnet msbuild /nologo, which leads people to assume the former will set the latter - but we can't go back in time : )

I don't believe that DOTNET_NOLOGO results in the nuget cache skipping. it doesn't supercede the _SKIP_FTE flag, unless I'm mistaken.

FWIW, there's a bunch of .NET Core SDKs pre-installed on the Actions hosted runners - but it's really not clear to me from the setup-dotnet runner documentation if it's smart enough to use those if there's a match, or just always installs the specified SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants