dotnet / dotnet/arcade

Set DOTNET_CLI_TELEMETRY_SESSIONID centrally in Arcade CI templates

Open
#17,232 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

- [ ] This issue is blocking
- [ ] This issue is causing unreasonable pain

## Background

dotnet/sdk#54447 added `DOTNET_CLI_TELEMETRY_SESSIONID`, which lets CI seed the CLI telemetry session ID so separate `dotnet` processes from the same workflow can be correlated.

The SDK repo now stamps this at workflow scope where supported, and at job scope for special workflows whose schema does not support top-level `env`:

```yaml
env:
DOTNET_CLI_TELEMETRY_SESSIONID: gha-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}
```

and its Azure DevOps pipeline entry points:

```yaml
variables:
- name: DOTNET_CLI_TELEMETRY_SESSIONID
value: azdo-$(System.CollectionId)-$(System.TeamProjectId)-$(Build.BuildId)
```

Doing this independently in every repository and workflow is easy to miss and makes the correlation format harder to keep consistent.

## Question

Could Arcade provide this identifier in a cross-cutting way for Arcade-consuming repositories, so all `dotnet` invocations in a CI run inherit it without each repository or workflow defining it manually?

For Azure DevOps, `eng/common/core-templates/job/job.yml` already supplies `DOTNET_CLI_TELEMETRY_PROFILE` when telemetry is enabled, so that template or a shared variables template may be a natural place to supply the session ID. Is there an equivalent shared integration point for GitHub Actions workflows, or should this be handled through a reusable workflow/action or Arcade's common bootstrap scripts?

## Desired behavior

- Arcade supplies a provider-prefixed, run-scoped `DOTNET_CLI_TELEMETRY_SESSIONID` by default.
- Every `dotnet` process in the same CI run inherits the same value.
- The value distinguishes repositories/projects and runs, and includes retry/attempt identity where the provider exposes it.
- Repositories can override the default when necessary.
- The convention and supported CI providers are documented and covered by template tests.

Related: https://github.com/dotnet/sdk/pull/54447

Contributor guide

Open the contributing guide

Research direction

Start with eng/common/core-templates/job/job.yml and its existing DOTNET_CLI_TELEMETRY_PROFILE setup, then inspect Arcade's shared GitHub Actions integration points, reusable workflows or actions, and common bootstrap scripts. Done means both CI providers receive consistent provider-prefixed session IDs by default, overrides remain possible, and the convention is documented with template tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, github-actions
Domain
build-system, ci-cd
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.