Skip to content

Conversation

@glucaci
Copy link
Member

@glucaci glucaci commented May 2, 2025

This pull request introduces several enhancements and refactors to improve Git integration, variable handling, and pipeline configuration in the Confix.Tool project. The most important changes include adding support for Git authentication via username and token, refactoring methods to use a unified IComponentProviderContext, and introducing a VariableProviderContext for better variable management across pipelines.

Git Integration Enhancements:

  • Added GitUsernameOptions and GitTokenOptions to enable Git authentication using username and token. These options are now available in relevant pipelines (BuildCommandPipeline, ProjectBuildPipeline, RestoreCommandPipeline). [1] [2] [3] [4] [5]
  • Introduced the GitUrl.Create method to construct repository URLs with authentication credentials when provided. This method is now used in Git operations like CloneAsync and SparseCheckoutAsync. [1] [2] [3]

Refactoring for Context Unification:

  • Replaced separate parameters like CancellationToken and Logger with the unified IComponentProviderContext in methods such as FetchRefsAsync and ProcessComponentAsync to simplify method signatures and improve maintainability. [1] [2] [3] [4]

Variable Management Improvements:

  • Introduced VariableProviderContext to encapsulate variable-related parameters (context.Parameter, context.CancellationToken) and updated pipelines (BuildProjectMiddleware, RestoreProjectMiddleware, VariableCopyPipeline, VariableSetPipeline, etc.) to use this context for consistent variable handling. [1] [2] [3] [4]
  • Updated variable-related methods like ListVariables and ResolveOrThrowAsync to accept VariableProviderContext instead of CancellationToken. [1] [2] [3]

Logging Enhancements:

  • Added calls to log.LogException in Git-related logging methods (GitSparseCheckoutFailed, GitShowRefsFailed, GitCheckoutFailed) to improve error visibility and debugging. [1] [2] [3]

Copy link
Contributor

@Carael Carael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Copy link
Contributor

@Carael Carael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@glucaci glucaci merged commit e6a5ef9 into main May 5, 2025
2 checks passed
@glucaci glucaci deleted the git-configuration branch May 5, 2025 17:00
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.

3 participants