Azure devops#216
Conversation
| github.com/hashicorp/go-multierror v1.1.1 | ||
| github.com/hashicorp/go-retryablehttp v0.7.2 | ||
| github.com/ktrysmt/go-bitbucket v0.9.48 | ||
| github.com/microsoft/azure-devops-go-api/azuredevops/v6 v6.0.1 |
There was a problem hiding this comment.
latest release is v7 https://github.com/microsoft/azure-devops-go-api/releases/tag/azuredevops%2Fv7.1.0
There was a problem hiding this comment.
we can't use V7 until they fix ContinuationToken field type. It is unconsistent depending on which struct you use.
There was a problem hiding this comment.
@souleb is it related to this issue? microsoft/azure-devops-go-api#97 did you find it in a different struct?
There was a problem hiding this comment.
i've mentioned this to the relevant team and will let you know when it gets resolved
Co-authored-by: souleb <bah.soule@gmail.com> Signed-off-by: Nelly Kiboi <nellykiboi@gmail.com>
Co-authored-by: souleb <bah.soule@gmail.com> Signed-off-by: Nelly Kiboi <nellykiboi@gmail.com>
Signed-off-by: Soule BA <soule@weave.works> Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Co-authored-by: souleb <bah.soule@gmail.com> Signed-off-by: Nelly Kiboi <3062772+nellyk@users.noreply.github.com> Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Co-authored-by: souleb <bah.soule@gmail.com> Signed-off-by: Nelly Kiboi <3062772+nellyk@users.noreply.github.com> Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Co-authored-by: souleb <bah.soule@gmail.com> Signed-off-by: Nelly Kiboi <3062772+nellyk@users.noreply.github.com> Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Co-authored-by: souleb <bah.soule@gmail.com> Signed-off-by: Nelly Kiboi <3062772+nellyk@users.noreply.github.com> Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: nellyk <3062772+nellyk@users.noreply.github.com>
Signed-off-by: Soule BA <soule@weave.works>
Signed-off-by: Soule BA <soule@weave.works>
Also cleaning up and refactoring where needed. Signed-off-by: Soule BA <soule@weave.works>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #216 +/- ##
==========================================
- Coverage 59.48% 59.00% -0.49%
==========================================
Files 44 88 +44
Lines 3019 6891 +3872
==========================================
+ Hits 1796 4066 +2270
- Misses 1038 2251 +1213
- Partials 185 574 +389 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| | Test team | fluxcd-test-team | `STASH_TEST_TEAM_NAME` | | ||
|
|
||
|
|
||
| ### Azure DevOps |
There was a problem hiding this comment.
| ### Azure DevOps | |
| #### Azure DevOps |
| // No default value at POST-time. | ||
| // Added for Azure devops compatibility since it allows updating the name | ||
| // +optional | ||
| Name *string `json:"name"` |
There was a problem hiding this comment.
This type is also returned by e.g. UserRepository.Get. We should adapt the other implementations to properly fill this field. Otherwise it will be nil which feels strange, esp. since the information is available from the API types.
|
|
||
| const ( | ||
| azureTokenFile = "/tmp/azure.token" | ||
| defaultDescription = "Foo description" |
There was a problem hiding this comment.
This variable is only ever consumed once and it's not very important to declare it here (as opposed to the variable above). We should just inline it. Alternatively give it a name that make it easier to determine its intended use.
| ) | ||
|
|
||
| const ( | ||
| azureTokenFile = "/tmp/azure.token" |
| testing.Init() | ||
| rand.Seed(time.Now().UnixNano()) |
There was a problem hiding this comment.
Is it really necessary to do this in an init func as opposed to TestProvider or in the azure Provider spec? I personally avoid init wherever possible as it's really hard to control or discover when navigating the code.
| // Create if not found | ||
| if errors.Is(err, gitprovider.ErrNotFound) { | ||
| resp, err := c.Create(ctx, ref, req, toCreateOpts(opts...)...) | ||
| return resp, true, err |
There was a problem hiding this comment.
| return resp, true, err | |
| return resp, true, fmt.Errof("failed creating repository %q: %w", ref, err) |
| ) | ||
|
|
||
| const ( | ||
| emptyObjectPlaceholder = "0000000000000000000000000000000000000000" |
There was a problem hiding this comment.
This definitely needs an explanatory comment. What is it used for and why do we need it?
| gitRefPrefix = "refs/heads/" | ||
| ) | ||
|
|
||
| // BranchClient implements the gitprovider.BranchClient interface. |
There was a problem hiding this comment.
| // BranchClient implements the gitprovider.BranchClient interface. |
I think this is self-explanatory to a Go programmer.
| repositoryId := c.ref.GetRepository() | ||
| projectId := c.ref.GetIdentity() | ||
| ref := gitRefPrefix + branch | ||
| all := make([]any, 0, len(files)) |
There was a problem hiding this comment.
| all := make([]any, 0, len(files)) | |
| allFiles := make([]any, 0, len(files)) |
?
| requests := make([]gitprovider.PullRequest, len(*prs)) | ||
|
|
||
| for idx, pr := range *prs { | ||
| requests[idx] = newPullRequest(c.clientContext, &pr) |
There was a problem hiding this comment.
| requests[idx] = newPullRequest(c.clientContext, &pr) | |
| pr := pr | |
| requests[idx] = newPullRequest(c.clientContext, &pr) |
This is needed because Go reuses variables. You may end up with requests pointing to the same address for all items in the slice.
Description
New azure devops implementation.
It can effectively reconcile azuredevops repositories using the azure zsk. It uses a
PATasssh keysare not supported.CommitsandPull requestsare supported butteamspermissions are still to be implemented.cc @nellyk
Test results
https://github.com/fluxcd/go-git-providers/actions/runs/4832004149/jobs/8610205652