Skip to content

Add stage container label to update-dependencies-internal pipeline runs#7002

Merged
lbussell merged 8 commits into
dotnet:nightlyfrom
lbussell:update-deps-labels
Jan 21, 2026
Merged

Add stage container label to update-dependencies-internal pipeline runs#7002
lbussell merged 8 commits into
dotnet:nightlyfrom
lbussell:update-deps-labels

Conversation

@lbussell
Copy link
Copy Markdown
Member

Working towards #6915.

Adds a label like Container - stage-1234567 to update-dependencies-internal pipeline runs.

AI generated description

This pull request introduces significant improvements to dependency injection, environment abstraction, and Azure Pipelines integration within the eng/update-dependencies tooling. The changes refactor several services to use interfaces and dependency injection, add new abstractions for environment and build labeling, and improve testability and maintainability by removing direct environment variable access. Additionally, new extension methods are introduced for streamlined service registration.

Dependency Injection and Service Abstractions

  • Refactored AzdoAuthProvider, AzdoHttpClient, and PipelineArtifactProvider to use interfaces (IAzdoAuthProvider, IPipelineArtifactProvider), enabling easier mocking and testing. Extension methods for registering these services with IServiceCollection were added. [1] [2] [3] [4] [5] [6] [7]
  • Introduced IEnvironmentService and its implementation to encapsulate environment variable access, replacing direct Environment.GetEnvironmentVariable calls throughout the codebase. [1] [2]

Azure Pipelines Integration and Build Labeling

  • Added IBuildLabelService and its implementation to allow tagging Azure Pipelines builds programmatically, with extension methods for DI registration. [1] [2]
  • Updated logic for creating PR branch names to accept a build ID parameter, improving uniqueness and testability. Environment detection and build ID retrieval now use IEnvironmentService. [1] [2] [3] [4] [5]

Code Cleanup and Documentation

  • Removed the obsolete AzurePipelinesHelper class, consolidating environment logic into EnvironmentService.
  • Updated .github/instructions/csharp.instructions.md to discourage comments like // Arrange, // Act, or // Assert in unit tests.

Service Registration and Composition

  • Simplified service registration in Program.cs by using new extension methods for environment, build label, and artifact provider services.

These changes collectively modernize the codebase, improve testability, and make Azure Pipelines integration more robust and maintainable.

@lbussell lbussell requested a review from a team as a code owner January 21, 2026 18:16
@lbussell
Copy link
Copy Markdown
Member Author

Test run of update-deps-internal-unofficial: build#2884441

@lbussell lbussell enabled auto-merge (squash) January 21, 2026 18:49
@lbussell lbussell merged commit 43cf529 into dotnet:nightly Jan 21, 2026
124 of 125 checks passed
@lbussell lbussell deleted the update-deps-labels branch January 21, 2026 19:07
lbussell added a commit to lbussell/dotnet-docker that referenced this pull request Feb 6, 2026
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

Successfully merging this pull request may close these issues.

2 participants