Skip to content

Conversation

@hermanschaaf
Copy link
Member

This adds a test to the test suite specifically for migrations. It validates that:

  • new columns can be added
  • columns added by users get ignored
  • column ordering changes don't affect the outcome

@github-actions
Copy link

github-actions bot commented Jan 5, 2023

⏱️ Benchmark results

  • DefaultConcurrencyDFS-2 resources/s: 10,819
  • DefaultConcurrencyRoundRobin-2 resources/s: 12,241
  • Glob-2 ns/op: 172.8
  • TablesWithChildrenDFS-2 resources/s: 28,846
  • TablesWithChildrenRoundRobin-2 resources/s: 27,068
  • TablesWithRateLimitingDFS-2 resources/s: 28.27
  • TablesWithRateLimitingRoundRobin-2 resources/s: 827.3
  • BufferedScanner-2 ns/op: 11.38
  • LogReader-2 ns/op: 32.36

Copy link
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.

Looks good, do we want to repeat the write/read test after each migration? For example if there's an extra column in the table, we expect it to have a null value after write

Copy link
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.

🪄

kodiakhq bot pushed a commit to cloudquery/cloudquery that referenced this pull request Jan 5, 2023
BigQuery migrations should not fail if there are extra columns present in the table. As long as the columns are not required, it should ignore those columns and add any extra ones required by CloudQuery table schemas. This allows users to add additional columns of their own, and it means that you can upgrade to a new minor version of a source plugin and roll back later without issues.

This is tested in the new tests added in cloudquery/plugin-sdk#574

- Fixes #6364
kodiakhq bot pushed a commit to cloudquery/cloudquery that referenced this pull request Jan 5, 2023
This changes the Read query to only select the columns defined in the table schema, so that user-defined columns are ignored. Since Read is only used in tests, this only affects testing right now.

This change should allow the new test in cloudquery/plugin-sdk#574 to pass
@kodiakhq kodiakhq bot merged commit 071a4e5 into main Jan 5, 2023
@kodiakhq kodiakhq bot deleted the test-migrations branch January 5, 2023 15:25
hermanschaaf pushed a commit that referenced this pull request Jan 5, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.21.0](v1.20.0...v1.21.0)
(2023-01-05)


### Features

* **testing:** Add test for migrations
([#574](#574))
([071a4e5](071a4e5))

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants