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

feat(Enterprise Billing Units): add start and limit parameters to billing unit APIs #230

Merged
merged 10 commits into from
Mar 29, 2023

Conversation

Jdatechong
Copy link
Contributor

PR summary

Adds start and limit parameters to support pagination for certain Enterprise Billing Units APIs

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

Results can now be optionally paginated using the start and limit parameters.

Does this PR introduce a breaking change?

  • Yes
  • No

Test results

Ran 56 of 64 Specs in 1.330 seconds
SUCCESS! -- 56 Passed | 0 Failed | 0 Pending | 8 Skipped
PASS
ok      github.com/IBM/platform-services-go-sdk/enterprisebillingunitsv1        1.709s

@padamstx padamstx self-requested a review January 24, 2023 21:43
@padamstx padamstx self-assigned this Jan 24, 2023
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.

I've done a quick preliminary review of the PR and what you've done so far looks good, but we also would need the examples and integration tests to be updated to reflect the use of the new Pager structs.
Especially the examples since we want to encourage users to use the Pagers. The Enterprise Usage Reports service might be a good one to use as a model for updating the examples and int tests.

@CLAassistant
Copy link

CLAassistant commented Feb 2, 2023

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Jonathan Date-chong <[email protected]>
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,
please paste a screenshot of a successful run of the integration tests and examples:

cd enterprisebillingunitsv1
go test -tags=integration
go test -tags=examples

@padamstx
Copy link
Member

padamstx commented Feb 2, 2023

@Jdatechong Looks like the build for this PR also had lint errors. You can run make lint in the project root to run the linter on the code. After fixing the issues, just commit and push to your branch.

Signed-off-by: Jonathan Date-chong <[email protected]>
@Jdatechong
Copy link
Contributor Author

Results from go test -tags=integration

••••••••••••••••••••••••••••••••••••••••••••••••••••••••
Ran 56 of 66 Specs in 1.168 seconds
SUCCESS! -- 56 Passed | 0 Failed | 0 Pending | 10 Skipped
PASS
ok      github.com/IBM/platform-services-go-sdk/enterprisebillingunitsv1        1.998s

Results from go test -tags=examples

Ran 56 of 62 Specs in 1.179 seconds
SUCCESS! -- 56 Passed | 0 Failed | 0 Pending | 6 Skipped
PASS
ok      github.com/IBM/platform-services-go-sdk/enterprisebillingunitsv1        1.456s

@padamstx
Copy link
Member

padamstx commented Feb 7, 2023

My guess is that the 10 int tests and 6 examples that were skipped are due to a missing config file for your service (i.e. enterprise_billing_units.env). You can find this in the examples file:

//
// This file provides an example of how to use the Enterprise Billing Units service.
//
// The following configuration properties are assumed to be defined:
//
// ENTERPRISE_BILLING_UNITS_URL=<service url>
// ENTERPRISE_BILLING_UNITS_AUTHTYPE=iam
// ENTERPRISE_BILLING_UNITS_APIKEY=<your iam apikey>
// ENTERPRISE_BILLING_UNITS_AUTH_URL=<IAM token service URL - omit this if using the production environment>
// ENTERPRISE_BILLING_UNITS_ENTERPRISE_ID=<id of enterprise to use for examples>
// ENTERPRISE_BILLING_UNITS_BILLING_UNIT_ID=<id of billing unit to use for examples>

Edit: when you run the int tests or examples, you can use the -ginkgo.v option and you'll get more detail printed to ensure that you really are running the tests (or examples).

@Jdatechong
Copy link
Contributor Author

Results from the integration tests:

Ran 60 of 60 Specs in 36.241 seconds
SUCCESS! -- 60 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
ok      github.com/IBM/platform-services-go-sdk/enterprisebillingunitsv1        37.562s

Results from the examples:

Ran 57 of 57 Specs in 8.205 seconds
SUCCESS! -- 57 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
ok      github.com/IBM/platform-services-go-sdk/enterprisebillingunitsv1        9.537s

@padamstx padamstx merged commit 19296ca into IBM:main Mar 29, 2023
ibm-devx-sdk pushed a commit that referenced this pull request Mar 29, 2023
# [0.35.0](v0.34.0...v0.35.0) (2023-03-29)

### Features

* **Enterprise Billing Units:** add start and limit parameters to billing unit list APIs ([#230](#230)) ([19296ca](19296ca))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 0.35.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

4 participants