Skip to content

feat: Vercel source plugin#5548

Merged
kodiakhq[bot] merged 22 commits intocloudquery:mainfrom
disq:feat/vercel-source-plugin
Dec 14, 2022
Merged

feat: Vercel source plugin#5548
kodiakhq[bot] merged 22 commits intocloudquery:mainfrom
disq:feat/vercel-source-plugin

Conversation

@disq
Copy link
Copy Markdown
Member

@disq disq commented Dec 12, 2022

  • Read / auto-detect teams in Configure
  • Domains
  • Domain Records
  • Teams
  • Team Members
  • Deployments
  • Deployment Checks
  • Projects
  • Project Environments

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 12, 2022

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

  • Table vercel_deployment_checks was added
  • Table vercel_deployments was added
  • Table vercel_domain_records was added
  • Table vercel_domains was added
  • Table vercel_project_envs was added
  • Table vercel_projects was added
  • Table vercel_team_members was added
  • Table vercel_teams was added

@disq disq force-pushed the feat/vercel-source-plugin branch from 7c9fe57 to 303a677 Compare December 12, 2022 15:20
@disq disq marked this pull request as ready for review December 12, 2022 18:15
@disq disq requested review from a team, bbernays, erezrokah and yevgenypats and removed request for a team December 12, 2022 18:15
@disq
Copy link
Copy Markdown
Member Author

disq commented Dec 12, 2022

Fetching vercel_deployment_checks hits rate limits (for the CQ project at least) so the example has it in skip_tables.

Played with having a since_days (was since_duration until I found out time.Duration string representation didn't support days/months...) and putting it in every request inside since (by passing in url.Values to the services constructor and copying the values on each req as it's a map underneath) which didn't work (on the server side) for some reason.

Copy link
Copy Markdown
Member

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

🚀

@@ -0,0 +1,7 @@
# Vercel Plugin
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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, it will end with merge conflicts and pain so I'm waiting until the review is over

val = ts.Format(time.RFC3339) + fmt.Sprintf(" (in %s)", time.Until(ts).Round(time.Second))
}

return nil, fmt.Errorf("request to %s failed: %s. Rate limit will reset at: %s", path, res.Status, val)
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.

Probably a follow up, but we can add retry logic if the reset window is not large

Copy link
Copy Markdown
Contributor

@yevgenypats yevgenypats left a comment

Choose a reason for hiding this comment

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

Looks good. One major comment and then I'll give it another round of reviews:

Can we avoid using mocks here and use the same approach we now use in GCP and Azure with a test http server and providing a test baseURL or a test httpClient ? This should reduce the amount of boilerplate, make it inline with all other plugins and give even better test coverage.

@disq
Copy link
Copy Markdown
Member Author

disq commented Dec 13, 2022

Looks good. One major comment and then I'll give it another round of reviews:

Can we avoid using mocks here and use the same approach we now use in GCP and Azure with a test http server and providing a test baseURL or a test httpClient ? This should reduce the amount of boilerplate, make it inline with all other plugins and give even better test coverage.

@yevgenypats done PTAL

@disq disq requested a review from yevgenypats December 13, 2022 18:26
@disq disq requested a review from hermanschaaf as a code owner December 13, 2022 18:30
Copy link
Copy Markdown
Contributor

@yevgenypats yevgenypats left a comment

Choose a reason for hiding this comment

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

Nice! Looks great. Had one nit.

@disq disq force-pushed the feat/vercel-source-plugin branch from 47a96ed to 4c98911 Compare December 14, 2022 14:40
@kodiakhq kodiakhq bot merged commit aab7f73 into cloudquery:main Dec 14, 2022
@disq disq deleted the feat/vercel-source-plugin branch December 14, 2022 15:51
kodiakhq bot pushed a commit that referenced this pull request Dec 15, 2022
🤖 I have created a release *beep* *boop*
---


## 1.0.0 (2022-12-15)


### Features

* Vercel source plugin ([#5548](#5548)) ([aab7f73](aab7f73))


### Bug Fixes

* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.12.4 ([#5649](#5649)) ([b4aa889](b4aa889))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.12.5 ([#5661](#5661)) ([b354b8a](b354b8a))

---
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