Repository navigation
feat: enable oauthV2 by removing oauthV2enabled variable - #6175
Conversation
299619c to
dcdd6d5
Compare
dbf9c2c to
afcb3b3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/1.57.x #6175 +/- ##
=================================================
Coverage ? 76.86%
=================================================
Files ? 521
Lines ? 70748
Branches ? 0
=================================================
Hits ? 54380
Misses ? 13483
Partials ? 2885 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
koladilip
left a comment
There was a problem hiding this comment.
Mostly looks good, do good testing
| // NO-OP | ||
| } | ||
|
|
||
| func (rt *Handle) handleOAuthDestResponse(params *HandleDestOAuthRespParams, authErrorCategory string) (int, string, string) { |
There was a problem hiding this comment.
Yes. In OAuth v1, we need to handle the response to determine whether we need to refresh the event or fail it. But in OAuth v2, it is done through the interceptor.
| rt.transformer = transformer.NewTransformer(rt.netClientTimeout, rt.transformerTimeout, | ||
| backendConfig, rt.reloadableConfig.oauthV2Enabled, | ||
| backendConfig, | ||
| rt.reloadableConfig.oauthV2ExpirationTimeDiff, |
There was a problem hiding this comment.
[nit-pick]
| rt.reloadableConfig.oauthV2ExpirationTimeDiff, | |
| rt.reloadableConfig.oauthExpirationTimeDiff, |
| rt.reloadableConfig.failingJobsPenaltySleep = config.GetReloadableDurationVar(2000, time.Millisecond, getRouterConfigKeys("failingJobsPenaltySleep", rt.destType)...) | ||
| rt.reloadableConfig.failingJobsPenaltyThreshold = config.GetReloadableFloat64Var(0.6, getRouterConfigKeys("failingJobsPenaltyThreshold", rt.destType)...) | ||
| rt.reloadableConfig.oauthV2Enabled = config.GetReloadableBoolVar(false, getRouterConfigKeys("oauthV2Enabled", rt.destType)...) | ||
| rt.reloadableConfig.oauthV2ExpirationTimeDiff = config.GetReloadableDurationVar(5, time.Minute, getRouterConfigKeys("oauth.expirationTimeDiff", rt.destType)...) |
There was a problem hiding this comment.
| rt.reloadableConfig.oauthV2ExpirationTimeDiff = config.GetReloadableDurationVar(5, time.Minute, getRouterConfigKeys("oauth.expirationTimeDiff", rt.destType)...) | |
| rt.reloadableConfig.oauthExpirationTimeDiff = config.GetReloadableDurationVar(5, time.Minute, getRouterConfigKeys("oauth.expirationTimeDiff", rt.destType)...) |
| } else { | ||
| resp, err = trans.client.Do(req) | ||
|
|
||
| destinationInfo := &oauthv2.DestinationInfo{ |
There was a problem hiding this comment.
[nit-pick]
| destinationInfo := &oauthv2.DestinationInfo{ | |
| destinationInfo := &oauth.DestinationInfo{ |
| ID: transformMessageCopy.Data[0].Destination.ID, | ||
| } | ||
| req = req.WithContext(cntx.CtxWithDestInfo(req.Context(), destinationInfo)) | ||
| resp, err = trans.clientOAuthV2.Do(req) |
There was a problem hiding this comment.
[nit-pick]
| resp, err = trans.clientOAuthV2.Do(req) | |
| resp, err = trans.clientOAuth.Do(req) |
| } else { | ||
| resp, err = trans.proxyClient.Do(req) | ||
| } | ||
| trans.logger.Debugn("[router delivery]", logger.NewBoolField("oauthV2Enabled", true)) |
There was a problem hiding this comment.
[nit-pick]
| trans.logger.Debugn("[router delivery]", logger.NewBoolField("oauthV2Enabled", true)) | |
| trans.logger.Debugn("[router delivery]", logger.NewBoolField("oauthEnabled", true)) |
| trans.logger.Debugn("[router delivery]", logger.NewBoolField("oauthV2Enabled", true)) | ||
| req = req.WithContext(cntx.CtxWithDestInfo(req.Context(), proxyReqParams.DestInfo)) | ||
| req = req.WithContext(cntx.CtxWithSecret(req.Context(), proxyReqParams.ResponseData.Metadata[0].Secret)) | ||
| resp, err = trans.proxyClientOAuthV2.Do(req) |
There was a problem hiding this comment.
[nit-pick]
| resp, err = trans.proxyClientOAuthV2.Do(req) | |
| resp, err = trans.proxyClientOAuth.Do(req) |
| ResponseData: tc.postParameters, | ||
| DestName: "not_found_dest", | ||
| Adapter: &mockAdapter{url: srv.URL}, | ||
| DestInfo: &v2.DestinationInfo{ |
There was a problem hiding this comment.
| DestInfo: &v2.DestinationInfo{ | |
| DestInfo: &v2.DestinationInfo{ |
similarily here it need not be v2
| skipRtAbortAlertForTransformation config.ValueLoader[bool] // represents if event delivery(via transformerProxy) should be alerted via router-aborted-count alert def | ||
| skipRtAbortAlertForDelivery config.ValueLoader[bool] // represents if transformation(router or batch) should be alerted via router-aborted-count alert def | ||
| oauthV2Enabled config.ValueLoader[bool] | ||
| oauthV2ExpirationTimeDiff config.ValueLoader[time.Duration] |
There was a problem hiding this comment.
| oauthV2ExpirationTimeDiff config.ValueLoader[time.Duration] | |
| oauthExpirationTimeDiff config.ValueLoader[time.Duration] |
🤖 I have created a release *beep* *boop* --- ## [1.57.0-rc.2](v1.56.0...v1.57.0-rc.2) (2025-08-19) ### Features * add support for manual sync mode in warehouse ([#6199](#6199)) ([6f87119](6f87119)) * enable oauthV2 by removing oauthV2enabled variable ([#6175](#6175)) ([caad8f0](caad8f0)) * **router:** support different throttler per event type ([#6181](#6181)) ([12254bb](12254bb)) * warehouse grpc API to get namespace mappings of a destination ([#6200](#6200)) ([9613236](9613236)) ### Bug Fixes * adaptive throttling not applying dynamic throttling limits consistently ([#6219](#6219)) ([478b2e1](478b2e1)) * error extractor to handle nested JSON responses ([#6209](#6209)) ([ffc0d7a](ffc0d7a)) * getting occasional unauthenticated errors from googlepubsub ([#6228](#6228)) ([cc39306](cc39306)) * handle snowpipe service restarts in destination polling logic ([#6236](#6236)) ([b76bc7f](b76bc7f)) * handling empty schema for table level schemas ([#6233](#6233)) ([cc39306](cc39306)) * histogram buckets for schema snapshots ([#6234](#6234)) ([cc39306](cc39306)) * warehouse source empty jobs ([#6204](#6204)) ([42f5ae4](42f5ae4)) ### Miscellaneous * bump the go-dependencies group with 12 updates ([#6189](#6189)) ([e6e2bcd](e6e2bcd)) * enforcing non-sugared logger ([#6066](#6066)) ([b24ded8](b24ded8)) * force new MTU metrics from 1st September 2025 onwards ([#6227](#6227)) ([154d2c3](154d2c3)) * implement configurable deduplication mirror mode ([#6224](#6224)) ([c97ad7a](c97ad7a)) * refactor Google Pub/Sub to add retry logic for auth errors ([#6229](#6229)) ([cc39306](cc39306)) * remove enableV2NotifierJob flag support ([#6196](#6196)) ([8be54bf](8be54bf)) * remove event blocking flag ([#6240](#6240)) ([e668e14](e668e14)) * remove queryWithUploadId flag support for load files ([#6192](#6192)) ([e6e2bcd](e6e2bcd)) * revert "fix: snowpipe events getting duplicated if status API fails" ([#6211](#6211)) ([777b08e](777b08e)) * skip warehouse destinations from version deprecation error extraction ([#6226](#6226)) ([87c3320](87c3320)) * stop collecting errors in proc_error jobsdb ([#6232](#6232)) ([c600968](c600968)) * throttler should emit no warning if not enabled ([#6223](#6223)) ([0773168](0773168)) * update keydb dependency ([#6222](#6222)) ([d1d64bc](d1d64bc)) * use harbor to pull docker images ([#6210](#6210)) ([6c324cf](6c324cf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [1.57.0](v1.56.0...v1.57.0) (2025-08-19) ### Features * add support for manual sync mode in warehouse ([#6199](#6199)) ([6f87119](6f87119)) * enable oauthV2 by removing oauthV2enabled variable ([#6175](#6175)) ([caad8f0](caad8f0)) * **router:** support different throttler per event type ([#6181](#6181)) ([12254bb](12254bb)) * warehouse grpc API to get namespace mappings of a destination ([#6200](#6200)) ([9613236](9613236)) ### Bug Fixes * adaptive throttling not applying dynamic throttling limits consistently ([#6219](#6219)) ([478b2e1](478b2e1)) * error extractor to handle nested JSON responses ([#6209](#6209)) ([ffc0d7a](ffc0d7a)) * getting occasional unauthenticated errors from googlepubsub ([#6228](#6228)) ([cc39306](cc39306)) * handle snowpipe service restarts in destination polling logic ([#6236](#6236)) ([b76bc7f](b76bc7f)) * handling empty schema for table level schemas ([#6233](#6233)) ([cc39306](cc39306)) * histogram buckets for schema snapshots ([#6234](#6234)) ([cc39306](cc39306)) * warehouse source empty jobs ([#6204](#6204)) ([42f5ae4](42f5ae4)) ### Miscellaneous * bump the go-dependencies group with 12 updates ([#6189](#6189)) ([e6e2bcd](e6e2bcd)) * enforcing non-sugared logger ([#6066](#6066)) ([b24ded8](b24ded8)) * force new MTU metrics from 1st September 2025 onwards ([#6227](#6227)) ([154d2c3](154d2c3)) * implement configurable deduplication mirror mode ([#6224](#6224)) ([c97ad7a](c97ad7a)) * refactor Google Pub/Sub to add retry logic for auth errors ([#6229](#6229)) ([cc39306](cc39306)) * remove enableV2NotifierJob flag support ([#6196](#6196)) ([8be54bf](8be54bf)) * remove event blocking flag ([#6240](#6240)) ([e668e14](e668e14)) * remove queryWithUploadId flag support for load files ([#6192](#6192)) ([e6e2bcd](e6e2bcd)) * revert "fix: snowpipe events getting duplicated if status API fails" ([#6211](#6211)) ([777b08e](777b08e)) * skip warehouse destinations from version deprecation error extraction ([#6226](#6226)) ([87c3320](87c3320)) * stop collecting errors in proc_error jobsdb ([#6232](#6232)) ([c600968](c600968)) * throttler should emit no warning if not enabled ([#6223](#6223)) ([0773168](0773168)) * update keydb dependency ([#6222](#6222)) ([d1d64bc](d1d64bc)) * use harbor to pull docker images ([#6210](#6210)) ([6c324cf](6c324cf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
What are the changes introduced in this PR?
This PR removes the
oauthV2Enabledfeature flag and its associated conditional logic from therouterand related components. The primary goal is to standardize on the OAuth v2 implementation, eliminating the legacy code path for OAuth v1.The changes include:
oauthV2Enabledvariable fromreloadableConfigand its initialization.transformer.NewTransformerfunction to remove theoauthV2Enabledparameter.router/worker.goto always use the OAuth v2 path for OAuth destinations.What is the related Linear task?
INT-3972: Clean up oauthv2enabled variable from router
Please explain the objectives of your changes below
The main objective is to eliminate technical debt by removing a redundant feature flag. With all integrations now migrated to OAuth v2, the
oauthV2Enabledflag is no longer necessary. This change simplifies the codebase, makes it easier to maintain, and reduces the risk of production incidents caused by misconfiguration.Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Any new dependencies introduced with this change?
No, this PR does not introduce any new dependencies. It is purely a code cleanup and refactoring effort.
Any new generic utility introduced or modified. Please explain the changes.
No new generic utilities have been introduced or modified.
Any technical or performance related pointers to consider with the change?
@coderabbitai review
Developer checklist
Reviewer checklist