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

Custom service endpoint support #683

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Bug-Solver
Copy link

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?

Added behavior to allow the creation of "custom" service endpoints. It is possible to write custom extensions for Azure DevOps. However, the creation cannot be automated through Terraform as ever type of service connection has been hard coded.

This PR is a copy of #628 which appears to have gone stale after the initial PR.
That later version has been expanded upon and the failing unit test have been enhanced to include the new functionality

Issue Number:

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?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Other information

Pedro Kuramoto and others added 3 commits December 30, 2022 21:14
Added custom data attribute to allow more attributes to be passed
Added the plugin to the provider unit tests
@Bug-Solver
Copy link
Author

@microsoft-github-policy-service agree

@Bug-Solver Bug-Solver changed the title Feature/serviceendpoint Custom service endpoint support Dec 30, 2022
Type: schema.TypeMap,
Description: "Optional payload required for the creation of the endpoint",
}
secretHashKey, secretHashSchema := tfhelper.GenerateSecreteMemoSchema("password")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hash keys can be deleted. This functions has be deprecated.

@Bug-Solver Bug-Solver requested a review from xuzhang3 January 3, 2023 19:55
@xuzhang3
Copy link
Collaborator

xuzhang3 commented Jan 4, 2023

@Bug-Solver Can you add some test case for this resource? The document should be documented in azuredevops.erb

Description: "The password or token key to use for the Custom service connection.",
Sensitive: true,
Optional: true,
DiffSuppressFunc: tfhelper.DiffFuncSuppressSecretChanged,
Copy link
Collaborator

Choose a reason for hiding this comment

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

recommend remove the DiffSuppressFunc as this functions used to handle the hash encoded data which has ben deprecated and no hash key defined for password in this schema.

d.Set("server_url", *serviceEndpoint.Url)
d.Set("username", (*serviceEndpoint.Authorization.Parameters)["username"])
d.Set("data", *serviceEndpoint.Data)
tfhelper.HelpFlattenSecret(d, "password")
Copy link
Collaborator

Choose a reason for hiding this comment

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

tfhelper.HelpFlattenSecret(d, "password") can be delete

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.

2 participants