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
WIP: chore(deps): upgrade pgx to v5 #6915
Conversation
Images are ready for the commit at 44009eb. To use with deploy scripts, first |
447de3e
to
e765e3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need some more fixes in the unit tests because of this change:
CommandTag is now an opaque type instead of directly exposing an underlying []byte.
See for example
=== RUN TestAlertDataStore/TestConnExec
conn_test.go:106:
Error Trace: /__w/stackrox/stackrox/pkg/postgres/tests/conn_test.go:106
Error: Expected nil, but got: pgconn.CommandTag{s:""}
Test: TestAlertDataStore/TestConnExec
conn_test.go:112:
Error Trace: /__w/stackrox/stackrox/pkg/postgres/tests/conn_test.go:112
Error: Expected nil, but got: pgconn.CommandTag{s:""}
Test: TestAlertDataStore/TestConnExec
Indeed the handling or arrays also changed causing problems https://github.com/jackc/pgx/blob/v5.4.2/CHANGELOG.md?plain=1 |
f9f38c6
to
8f100c9
Compare
e765e3b
to
3152b48
Compare
3152b48
to
30917ac
Compare
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
7b540d8
to
bbf53e7
Compare
I haven't had a chance to look at this in detail yet, but I do have a question. What level of testing have we done on this? Reason I ask is that this looks like a significant upgrade and we've seen some things in the past where pgx took some liberties with how they do things. My concern is they adjusted some behaviors and we won't necessarily see them with just vanilla CI. Things we found during scale and chaos type testing would be missed in CI. Additionally should we go through the v5 changelog and write tickets to step up to some of their improved flows such as the new way batching works, etc? |
Agreed, my review was mostly just looking at the changes surface level, but I don't believe we should bump this just because the unit tests pass. I don't know how these upgrades have been done in the past, but I'd be more comfortable with some larger scale tests on the new version. |
I concur we need some better test plan. So far I only manually verified some generated queries and besides of map nil serialization I haven't seen any differences. But queries are just a small part of what pgx does. I can enable run UI tests as they run more gql queries. Unfortunately there is no upgrade guide for pgx. I was under the impression it's mostly backward compatible. E.g.: gorm just merged it and released as bugfix release and we already are using this version. Maybe better time to merge it will be just after the release so we will have more time to catch possible bugs. We will need to bump it at some point. |
@connorgorman @mtodor could you help with perf/scale tests? |
/retest |
da0fb0b
to
baad7ef
Compare
bbf53e7
to
0edb329
Compare
baad7ef
to
f688304
Compare
f688304
to
7ccf79d
Compare
7ccf79d
to
7d1d2f6
Compare
0edb329
to
44009eb
Compare
/test all |
/test all |
1 similar comment
/test all |
/retest |
@janisz: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Closing, we can reopen it once we have a proper test plan for this upgrade. |
Description
Important changes in v5:
CommandTag
is a type[]TextArray
but now it's just a[]string
so only filtering part is needed.'null'
but now it'snull
so I added a change to use{}
withpgutils.EmptyOrMap
Checklist
If any of these don't apply, please comment below.
Testing Performed
CI