Skip to content

chore(datadog): Move fetch functions, add back codegen for services#10816

Merged
kodiakhq[bot] merged 5 commits intomainfrom
datadog-cleanup
May 17, 2023
Merged

chore(datadog): Move fetch functions, add back codegen for services#10816
kodiakhq[bot] merged 5 commits intomainfrom
datadog-cleanup

Conversation

@hermanschaaf
Copy link
Copy Markdown
Contributor

This change:

  • restores the services codegen code accidentally removed in feat(datadog): Migrate codegen to transformations #6424. We are still relying on it for the generation of service interfaces and mocks
  • moves resolvers out of _fetch.go files into the main resource files, as is now standard practice
  • updates the contribution guide

There are no user-facing changes here, only refactoring and developer-facing changes.

@hermanschaaf hermanschaaf requested review from a team and shimonp21 and removed request for a team May 16, 2023 13:50
@cq-bot cq-bot added the datadog label May 16, 2023
@hermanschaaf hermanschaaf requested review from bbernays and removed request for shimonp21 May 16, 2023 13:50
@@ -0,0 +1,188 @@
package services
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This file was just restored from the Git history, no changes

@hermanschaaf
Copy link
Copy Markdown
Contributor Author

hermanschaaf commented May 16, 2023

This relates to #10780, where it was reported that the contribution guide was out-of-date. Once we merge the services codegen back in and update the contribution guide, it should be possible to create new resources using the contribution guide again, so we can post an update in that ticket.

Copy link
Copy Markdown
Contributor

@candiduslynx candiduslynx left a comment

Choose a reason for hiding this comment

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

needs to point to plugin-sdk/v2, others are nits

### Before you Start
When adding support for new APIs, you may need to add a new service to the client. To do this:
1. open `codegen/services/clients.go` and add the client from the Datadog SDK to the list of clients
2. run `make gen-mocks` to generate the service interface and mocks
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. run `make gen-mocks` to generate the service interface and mocks
2. Run `make gen-mocks` to generate the service interface and mocks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks for the suggestion

"strings"
"text/template"

"github.com/cloudquery/plugin-sdk/caser"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"github.com/cloudquery/plugin-sdk/caser"
"github.com/cloudquery/plugin-sdk/v2/caser"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed

@hermanschaaf hermanschaaf added the automerge Automatically merge once required checks pass label May 17, 2023
@kodiakhq kodiakhq bot merged commit d2d9015 into main May 17, 2023
@kodiakhq kodiakhq bot deleted the datadog-cleanup branch May 17, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants