Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ArgoCD service connections #501

Merged
merged 16 commits into from
Jan 4, 2022

Conversation

jaroslav-svoboda
Copy link
Contributor

@jaroslav-svoboda jaroslav-svoboda commented Dec 13, 2021

All Submissions:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.
  • I ran lint checks locally prior to submission.
  • Have you checked to ensure there aren't other open PRs for the same update/change?

What about the current behavior has changed?

Add New Resource azuredevops_serviceendpoint_argocd

Issue Number: N/A

Does this introduce a change to go.mod, go.sum or vendor/?

  • Yes
  • No

Does this introduce a breaking change?

  • Yes
  • No

Any relevant logs, error output, etc?

N/A

Other information

Inspired by Artifactory resources or to be correct based on Artifactory resource.

Adds support for this service extension:
Argo CD Extension for Azure Pipelines

@ghost
Copy link

ghost commented Dec 13, 2021

CLA assistant check
All CLA requirements met.

@jaroslav-svoboda jaroslav-svoboda changed the title Feat/argocd WIP: Feat/argocd Dec 13, 2021
@jaroslav-svoboda jaroslav-svoboda changed the title WIP: Feat/argocd WIP: Add support for ArgoCD service connections Dec 13, 2021
jaroslav-svoboda and others added 3 commits December 13, 2021 14:30
We stopped hearing from agent Hosted Agent...
.. Dev container build ... Bash exited with code '1'
@jaroslav-svoboda
Copy link
Contributor Author

The Azure DevOps infrastructure was a bit sick. Third attempt was successful.

@jaroslav-svoboda jaroslav-svoboda changed the title WIP: Add support for ArgoCD service connections Add support for ArgoCD service connections Dec 13, 2021
@jaroslav-svoboda jaroslav-svoboda marked this pull request as ready for review December 13, 2021 15:58
@xuzhang3
Copy link
Collaborator

@jaroslav-svoboda Is this new service connection from market place? Can you share the install link?

@xtrasolver
Copy link

Hi @xuzhang3, I have already provided link in Other information section:

Adds support for this service extension:
Argo CD Extension for Azure Pipelines

Copy link
Collaborator

@xuzhang3 xuzhang3 left a comment

Choose a reason for hiding this comment

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

@jaroslav-svoboda LGTM, a bit change request.

  1. since this service endpoint is not an official extension, can you add a notice to the doc that user need to install the https://marketplace.visualstudio.com/items?itemName=scb-tomasmortensen.vsix-argocd for their organization before using this resource.
  2. The website/docs/r/serviceendpoint_argocd.html.markdown should add to https://github.com/microsoft/terraform-provider-azuredevops/blob/main/website/azuredevops.erb

@xuzhang3
Copy link
Collaborator

==> Checking that code complies with gofmt requirements...
==> Sourcing .env file if avaliable
=== PAUSE TestAccServiceEndpointArgoCD_complete
=== RUN   TestAccServiceEndpointArgoCD_update
=== PAUSE TestAccServiceEndpointArgoCD_update
=== RUN   TestAccServiceEndpointArgoCD_RequiresImportErrorStep
=== PAUSE TestAccServiceEndpointArgoCD_RequiresImportErrorStep
=== CONT  TestAccServiceEndpointArgoCD_basic
=== CONT  TestAccServiceEndpointArgoCD_update
=== CONT  TestAccServiceEndpointArgoCD_RequiresImportErrorStep
=== CONT  TestAccServiceEndpointArgoCD_complete
--- PASS: TestAccServiceEndpointArgoCD_basic (134.19s)
--- PASS: TestAccServiceEndpointArgoCD_complete (160.59s)
--- PASS: TestAccServiceEndpointArgoCD_update (175.82s)
--- PASS: TestAccServiceEndpointArgoCD_RequiresImportErrorStep (201.05s)
PASS
ok      github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/acceptancetests        201.828s

@xuzhang3
Copy link
Collaborator

xuzhang3 commented Dec 29, 2021

@xtrasolver I was confused which type of authorization you use. When I create a new ArgoCD service endpoints with the example in the document. The authorization is UsernamePassword, but I can only set one property - token while UsernamePassword support two parameters: username and password.
If the authorization is UsernamePassword, this resource should support two parameter: username and password
If the authorization is Token then only one parameter: token .

You can get service endpoint by API:https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpoints/{endpointId}?api-version=6.0-preview.4

@jaroslav-svoboda
Copy link
Contributor Author

@xuzhang3 I fixed authentication. Currently it supports both authentication methods. I fetched code from main, so it supports v6 api too.

jaroslav-svoboda and others added 2 commits December 31, 2021 11:46
Co-authored-by: xuzhang3 <57888764+xuzhang3@users.noreply.github.com>
@xuzhang3
Copy link
Collaborator

xuzhang3 commented Jan 4, 2022

=== RUN   TestAccServiceEndpointArgoCD_basic
=== PAUSE TestAccServiceEndpointArgoCD_basic
=== RUN   TestAccServiceEndpointArgoCD_basic_usernamepassword
=== PAUSE TestAccServiceEndpointArgoCD_RequiresImportErrorStepUsernamePassword
=== CONT  TestAccServiceEndpointArgoCD_basic
=== CONT  TestAccServiceEndpointArgoCD_update
=== CONT  TestAccServiceEndpointArgoCD_RequiresImportErrorStep
=== CONT  TestAccServiceEndpointArgoCD_RequiresImportErrorStepUsernamePassword
=== CONT  TestAccServiceEndpointArgoCD_complete_token
=== CONT  TestAccServiceEndpointArgoCD_complete_usernamepassword
=== CONT  TestAccServiceEndpointArgoCD_update_usernamepassword
=== CONT  TestAccServiceEndpointArgoCD_basic_usernamepassword
--- PASS: TestAccServiceEndpointArgoCD_basic_usernamepassword (147.71s)
--- PASS: TestAccServiceEndpointArgoCD_complete_token (174.66s)
--- PASS: TestAccServiceEndpointArgoCD_complete_usernamepassword (203.83s)
--- PASS: TestAccServiceEndpointArgoCD_basic (242.95s)
--- PASS: TestAccServiceEndpointArgoCD_RequiresImportErrorStep (329.37s)
--- PASS: TestAccServiceEndpointArgoCD_update (408.37s)
--- PASS: TestAccServiceEndpointArgoCD_RequiresImportErrorStepUsernamePassword (417.25s)
--- PASS: TestAccServiceEndpointArgoCD_update_usernamepassword (472.03s)
PASS
ok      github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/acceptancetests        473.142s

Copy link
Collaborator

@xuzhang3 xuzhang3 left a comment

Choose a reason for hiding this comment

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

LGTM

@xuzhang3 xuzhang3 merged commit 60f2c2d into microsoft:main Jan 4, 2022
@jaroslav-svoboda jaroslav-svoboda deleted the feat/argocd branch January 5, 2022 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants