Skip to content

feat(fastly): Migrate codegen to transformations#6470

Merged
kodiakhq[bot] merged 2 commits intomainfrom
feat/fastly_migrate_codegen
Jan 9, 2023
Merged

feat(fastly): Migrate codegen to transformations#6470
kodiakhq[bot] merged 2 commits intomainfrom
feat/fastly_migrate_codegen

Conversation

@yevgenypats
Copy link
Copy Markdown
Contributor

No description provided.

@yevgenypats yevgenypats requested review from a team and hermanschaaf January 7, 2023 14:18
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 7, 2023

This PR has the following changes to source plugin(s) tables:

  • Table fastly_account_events: column order changed for id
  • Table fastly_account_events: column order changed for ip
  • Table fastly_account_users: column order changed for id
  • Table fastly_auth_tokens: column order changed for id
  • Table fastly_auth_tokens: column order changed for ip
  • Table fastly_service_backends: column order changed for name
  • Table fastly_service_backends: column order changed for service_id
  • Table fastly_service_backends: column order changed for service_version
  • Table fastly_service_backends: column order changed for sslca_cert
  • Table fastly_service_domains: column order changed for comment
  • Table fastly_service_domains: column order changed for created_at
  • Table fastly_service_domains: column order changed for deleted_at
  • Table fastly_service_health_checks: column order changed for name
  • Table fastly_service_health_checks: column order changed for service_id
  • Table fastly_service_health_checks: column order changed for service_version
  • Table fastly_service_versions: column order changed for number
  • Table fastly_service_versions: column order changed for service_id
  • Table fastly_services: column order changed for id

@cq-bot cq-bot added the fastly label Jan 7, 2023
@@ -1,175 +0,0 @@
package services
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.

I think this file is useful but it can be made part of the make gen-mocks command.

As an aside (not for this PR), I'm also thinking it would be good to move these to the SDK at some point, with it being used in quite a few plugins now I think we can see how it can be generalized. That would reduce the amount of code for this specific plugin as well.

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.

We can also discuss this live but I looked a bit at the services codegen again and it seems that it is not a lot of work to add a new interface for each table we develop. I think "codegen based development" is a real barrier to entry for developers and if it doesn't provide the 5,10x speed I would skip this completely.

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.

I very strongly disagree here - most of the time a new plugin author needs to do it only once when setting up the plugin, and after that (if you used the automation) it rarely needs to be changed again. So it shouldn't be a barrier to adding new tables or contribution in general (in fact, the opposite). It's far, far less work to point to one struct and say "generate the interface for it" than it is to copy-paste every relevant function on that struct, modify all the import paths appropriately, and then make sure the mockgen comments for it are correct as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would add that auto generating the interfaces ensures that when we update dependencies those get auto updated as well

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.

I chatted with @yevgenypats about this; we agreed to move the interface generation functionality to the plugin SDK for those plugins that use mockgen tests and have complex enough clients to justify it.

@yevgenypats yevgenypats added the automerge Automatically merge once required checks pass label Jan 9, 2023
@kodiakhq kodiakhq bot merged commit 60c0f14 into main Jan 9, 2023
@kodiakhq kodiakhq bot deleted the feat/fastly_migrate_codegen branch January 9, 2023 15:21
kodiakhq bot pushed a commit that referenced this pull request Jan 10, 2023
🤖 I have created a release *beep* *boop*
---


## [1.1.0](plugins-source-fastly-v1.0.1...plugins-source-fastly-v1.1.0) (2023-01-10)


### Features

* **fastly:** Migrate codegen to transformations ([#6470](#6470)) ([60c0f14](60c0f14))


### Bug Fixes

* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.18.0 ([#6339](#6339)) ([158365a](158365a))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.19.0 ([#6363](#6363)) ([ae6967c](ae6967c))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.20.0 ([#6376](#6376)) ([d6187ec](d6187ec))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.21.0 ([#6382](#6382)) ([5baea40](5baea40))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.22.0 ([#6516](#6516)) ([b7e4e73](b7e4e73))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.23.0 ([#6522](#6522)) ([ce24f1d](ce24f1d))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.24.1 ([#6553](#6553)) ([392b848](392b848))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.

4 participants