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

Feature: Add JFrog V2 Service Endpoint Data Source (Issue #1231) #1232

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

Conversation

jasonouellet
Copy link

@jasonouellet jasonouellet commented Nov 20, 2024

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?

Issue Number: #1231

Ading data source:

  • azuredevops_serviceendpoint_jfrog_artifactory_v2
  • azuredevops_serviceendpoint_jfrog_distribution_v2
  • azuredevops_serviceendpoint_jfrog_platform_v2
  • azuredevops_serviceendpoint_jfrog_xray_v2

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

@jasonouellet
Copy link
Author

@microsoft-github-policy-service agree

@jasonouellet jasonouellet marked this pull request as ready for review December 11, 2024 04:53
@xuzhang3 xuzhang3 linked an issue Dec 16, 2024 that may be closed by this pull request
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.

@jasonouellet Except for the properties used to retrieve resource, other properties should marked with compute=true in the scheme. You can take data_serviceendpoint_azurecr example. I only commented data_serviceendpoint_jfrog_artifactory_v2.go, all the resources needs to be updated.
Once those are fixed up I can take another look.

Comment on lines +25 to +43
"url": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.Url,
Computed: true,
Optional: true,
MinItems: 1,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"token": {
Description: "The JFrog Artifactory access token.",
Type: schema.TypeString,
Required: true,
Sensitive: true,
},
},
},
ExactlyOneOf: []string{"authentication_basic", "authentication_token"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"url": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.Url,
Computed: true,
Optional: true,
MinItems: 1,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"token": {
Description: "The JFrog Artifactory access token.",
Type: schema.TypeString,
Required: true,
Sensitive: true,
},
},
},
ExactlyOneOf: []string{"authentication_basic", "authentication_token"},
"url": {
Type: schema.TypeString,
Computed: true,
},

Comment on lines +24 to +30
"url": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.Url,
Description: "Url for the JFrog Artifactory Server",
Computed: true,
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"url": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.Url,
Description: "Url for the JFrog Artifactory Server",
Computed: true,
},
"url": {
Type: schema.TypeString,
Computed: true,
},

Comment on lines +25 to +31
"url": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.Url,
Description: "Url for the JFrog Artifactory Server",
Computed: true,
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"url": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.Url,
Description: "Url for the JFrog Artifactory Server",
Computed: true,
},
"url": {
Type: schema.TypeString,
Computed: true,
},

Comment on lines +25 to +31
"url": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.Url,
Description: "Url for the JFrog Artifactory Server",
Computed: true,
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"url": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.Url,
Description: "Url for the JFrog Artifactory Server",
Computed: true,
},
"url": {
Type: schema.TypeString,
Computed: true,
},

if err = checkServiceConnection(serviceEndpoint); err != nil {
return err
}
flattenServiceEndpointArtifactoryV2(d, serviceEndpoint)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
flattenServiceEndpointArtifactoryV2(d, serviceEndpoint)
d.Set("url", serviceEndpoint.Url)

if err = checkServiceConnection(serviceEndpoint); err != nil {
return err
}
flattenServiceEndpointArtifactoryV2(d, serviceEndpoint)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
flattenServiceEndpointArtifactoryV2(d, serviceEndpoint)
d.Set("url", serviceEndpoint.Url)


In addition to the Arguments list above - the following Attributes are exported:

* `authorization` - Specifies the Authorization Scheme Map.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* `authorization` - Specifies the Authorization Scheme Map.
* `url` - The URL of the Artifactory server to connect with.


In addition to the Arguments list above - the following Attributes are exported:

* `authorization` - Specifies the Authorization Scheme Map.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* `authorization` - Specifies the Authorization Scheme Map.
* `url` - The URL of the Artifactory server to connect with.


In addition to the Arguments list above - the following Attributes are exported:

* `authorization` - Specifies the Authorization Scheme Map.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* `authorization` - Specifies the Authorization Scheme Map.
* `url` - The URL of the Artifactory server to connect with.


In addition to the Arguments list above - the following Attributes are exported:

* `authorization` - Specifies the Authorization Scheme Map.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* `authorization` - Specifies the Authorization Scheme Map.
* `url` - The URL of the Artifactory server to connect with.

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.

Data Source - azuredevops_serviceendpoint_jfrog_[*]_v2 - Missing
2 participants