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

fix(Partner Center Sell): re-gen service after recent API definition changes #358

Merged
merged 20 commits into from
Oct 7, 2024

Conversation

HarasztiaPeter
Copy link
Contributor

@HarasztiaPeter HarasztiaPeter commented Oct 2, 2024

PR summary

PR Checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Current vs new behavior

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@HarasztiaPeter
Copy link
Contributor Author

The docs were updated as well under the https://test.cloud.ibm.com/apidocs/partner-center-sell?code=go link

@HarasztiaPeter
Copy link
Contributor Author

Screenshot 2024-10-02 at 14 25 43 Test run

@HarasztiaPeter
Copy link
Contributor Author

@padamstx padamstx self-assigned this Oct 2, 2024
@@ -3155,13 +3045,13 @@ type CatalogHighlightItem struct {
Description *string `json:"description,omitempty"`

// The description about the features of the product in translation.
DescriptionI18n map[string]string `json:"description_i18n,omitempty"`
DescriptionI18n map[string]interface{} `json:"description_i18n,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

The map[string]interface{} type results from the definition of the CatalogProductHighlightDescriptionI18n schema:

    CatalogProductHighlightDescriptionI18n:
      type: object
      description: The description about the features of the product in translation.
      additionalProperties: true

Are you sure that using interface{} for the map value type is correct? Using interface{} types just makes it harder for users to deal with the values as a type assertion would be needed. If you know that the values will be strings, then you could change additionalProperties to be:

    CatalogProductHighlightDescriptionI18n:
      type: object
      description: The description about the features of the product in translation.
      additionalProperties:
        type: string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We had issue with passing custom data, in terraform this change seems to solve that problem.

Copy link
Member

Choose a reason for hiding this comment

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

What do you mean specifically by "custom data"? Does the service support values of any type (string, boolean, integer, object, float, etc.)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Readded types

@@ -349,43 +279,52 @@ var _ = Describe(`PartnerCenterSellV1 Integration Tests`, func() {

catalogHighlightItemModel := &partnercentersellv1.CatalogHighlightItem{
Description: core.StringPtr("highlight desc"),
DescriptionI18n: map[string]string{"key1": "desc"},
DescriptionI18n: map[string]interface{}{"key1": "testString"},
Copy link
Member

Choose a reason for hiding this comment

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

Wherever you see a mock value like "testString" being used in the generated integration tests or examples code, that is an opportunity to define a realistic example value in the API definition. The added benefit is that these example values will be used in the generated examples and that means that the programming examples will look "similar" (other than language-specific differences) across the languages and will help promote easier understanding of the API.

Here's a tutorial video that discusses this:
https://secure.video.ibm.com/channel/23887899/playlist/651457/video/133486087

Copy link
Contributor Author

@HarasztiaPeter HarasztiaPeter Oct 3, 2024

Choose a reason for hiding this comment

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

Its true, but right now we do not plan to go into other languages. The main use case for this service is still terraform. Somewhere in the docs we should add the following warning:
Note - Intended for internal use only. This resource is strictly experimental and subject to change without notice.
(it has been added to related terraform docs as well.)

Copy link
Member

Choose a reason for hiding this comment

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

You could perhaps update the service table in README.md to include Experimental after the service name:
image

You could perhaps also add Note: the Partner Center Sell service is intended for internal use only. This service is strictly experimental and subject to change without notice. just after the table of "moved" services:
image
(right before Prerequisites)

Copy link
Member

Choose a reason for hiding this comment

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

Its true, but right now we do not plan to go into other languages.

Even if you are only going to produce a Go SDK and Terraform provider, the ability to generate the integration tests and examples code when a change is made to the API (without needing to make manual changes) will save you lots of time in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you don't mind the example fix would go to the next PR.

@padamstx padamstx self-requested a review October 2, 2024 18:53
Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

Removed my approval until some of the comments have been reviewed and a decision is made as to whether or not to address them.

@padamstx padamstx changed the title Update partnercentersellv1 fix(Partner Center Sell): re-gen service after recent API definition changes Oct 2, 2024
@padamstx padamstx self-requested a review October 2, 2024 18:58
HarasztiaPeter and others added 14 commits October 3, 2024 10:53
@HarasztiaPeter HarasztiaPeter force-pushed the update-partnercentersellv1 branch from a017a8b to 9a9e326 Compare October 3, 2024 08:53
padamstx

This comment was marked as outdated.

@padamstx padamstx self-requested a review October 3, 2024 18:35
Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

A couple of minor changes needed. Re: the other questions, I don't think they're showstoppers, so just let me know if you want to ignore for now and I can merge.

Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

Getting closer. Just need to resolve the default service URL and I was just curious about the change to the CM int test.

partnercentersellv1/partner_center_sell_v1.go Outdated Show resolved Hide resolved
@HarasztiaPeter
Copy link
Contributor Author

The cm test was a mistake removed it.

Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

LGTM

@padamstx padamstx merged commit 36d86ae into main Oct 7, 2024
4 checks passed
@padamstx padamstx deleted the update-partnercentersellv1 branch October 7, 2024 15:20
ibm-devx-sdk pushed a commit that referenced this pull request Oct 7, 2024
## [0.69.2](v0.69.1...v0.69.2) (2024-10-07)

### Bug Fixes

* **Partner Center Sell:** re-gen service after recent API definition changes ([#358](#358)) ([36d86ae](36d86ae))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 0.69.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

manukm-ibm pushed a commit to manukm-ibm/platform-services-go-sdk that referenced this pull request Oct 22, 2024
## [0.69.2](IBM/platform-services-go-sdk@v0.69.1...v0.69.2) (2024-10-07)

### Bug Fixes

* **Partner Center Sell:** re-gen service after recent API definition changes ([IBM#358](IBM#358)) ([36d86ae](IBM@36d86ae))

Signed-off-by: manu.k.m <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants