Skip to content

Conversation

@tmeckel
Copy link
Owner

@tmeckel tmeckel commented Nov 10, 2025

Closes: #65

Add UniqueByString and UniqueErrors helpers to deduplicate slices
based on fmt.Stringer.String() and error.Error() respectively.
Add RemoteSet.MarshalLogArray and Remote.MarshalLogObject implementations
to enable structured logging of git remote information via zap. The methods
serialize remote entries and their fields (Name, Resolved, FetchURL, PushURL),
safely handling nil URLs.  This allows remotes to be included directly in zap logs as objects/arrays for better observability without changing existing behavior.
Introduce package-level error variables to represent common failure
cases when resolving organizations:
- ErrURLNotFoundForOrganization: failed to get URL for organization
- ErrOrganizationNotFound: organization not found
- ErrDefaultOrganizationNotSet: no default organization defined
Update auth_config to use errors.As when detecting KeyNotFoundError, add structured
zap logging when retrieving organization URLs, and return specific sentinel
errors for missing URL, missing default organization, and unknown organization.
Return a clear error when the repository has no configured remotes and
wrap the specific organization-mapping error when remotes cannot be
mapped to an organization. Also add debug logging of the resolved
remotes. This prevents nil or confusing results from TranslateRemotes
and provides better diagnostics for configuration issues.
Introduce concurrent checks per organization using goroutines and a
sync.WaitGroup to improve responsiveness when verifying authentication
status. Pre-parse configuration and organization URLs, validate that the
configured URL matches the organization name, and propagate detailed
errors for mismatches or API failures.
Capture error returned by TranslateRemotes and assert.NoError to ensure
any unexpected errors cause the test to fail.
Add unit tests for OrganizationFromURL covering dev.azure.com https,
visualstudio.com https, ssh URLs, invalid path, and non-AzDO URLs.
Tests set AZDO_CONFIG_DIR to use test config and assert expected
organization names and error messages.
Add OrganizationFromURL to extract an Azure DevOps organization from a
validated URL. The helper supports dev.azure.com and visualstudio.com
host styles and handles SSH/path variants. This simplifies organization
extraction logic and centralizes validation/error handling.
Add logging and error aggregation when translating git remotes to AzDO
remotes. Introduce a zap Array encoder helper for RemoteSet, import
required packages, and change TranslateRemotes to return (RemoteSet, error).
Collect and deduplicate errors from URL translation and Repository parsing,
and return a joined error when no remotes were produced.
Add support for the Azure DevOps serviceendpoint client throughout the codebase.
This includes:
- expose ServiceEndpoint in the ClientFactory interface and implement it in
  internal/azdo/factory.go
- import the serviceendpoint package in connection.go
- update mocks to include ServiceEndpoint methods
- update vendor to include the new modules
Add a new service-endpoint top-level command and implement a fully
featured list subcommand for listing service connections within a
project.
Replace linear slices.Contains lookup with a hashset for faster ID membership
checks and preallocate the filtered slice to reduce allocations.
Clarify in help and reference docs that string flags like --auth-scheme,
--endpoint-id, and --name accept multiple values either by repeating the
flag or by separating values with a comma.
@tmeckel tmeckel merged commit 332b461 into master Nov 10, 2025
1 check passed
@tmeckel tmeckel deleted the tmeckel/issue65 branch November 10, 2025 15:54
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.

feat: Implement azdo service-endpoint list command

1 participant