Skip to content

chore: enforcing non-sugared logger - #6066

Merged
fracasula merged 82 commits into
masterfrom
nonSugaredLogger
Aug 5, 2025
Merged

fracasula merged 82 commits into
masterfrom
nonSugaredLogger

Conversation

@fracasula

Copy link
Copy Markdown
Collaborator

Description

Enforcing non-sugared logger as a best practice for better performance and to always use structured logging.

Linear Ticket

< Linear_Link >

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@codecov

codecov Bot commented Jun 27, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.92717% with 1049 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.62%. Comparing base (42f5ae4) to head (49771ab).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
warehouse/identity/identity.go 24.81% 100 Missing ⚠️
services/oauth/oauth.go 29.33% 53 Missing ⚠️
jobsdb/jobsdb.go 54.28% 47 Missing and 1 partial ⚠️
warehouse/integrations/deltalake/deltalake.go 45.00% 44 Missing ⚠️
warehouse/integrations/snowflake/snowflake.go 64.48% 38 Missing ⚠️
warehouse/router/identities.go 0.00% 32 Missing ⚠️
warehouse/integrations/redshift/redshift.go 70.87% 30 Missing ⚠️
warehouse/archive/archiver.go 40.00% 27 Missing ⚠️
enterprise/reporting/error_reporting.go 16.12% 26 Missing ⚠️
...ehouse/integrations/azure-synapse/azure-synapse.go 71.26% 25 Missing ⚠️
... and 118 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6066      +/-   ##
==========================================
- Coverage   76.80%   76.62%   -0.19%     
==========================================
  Files         511      514       +3     
  Lines       69867    70682     +815     
==========================================
+ Hits        53661    54157     +496     
- Misses      13305    13625     +320     
+ Partials     2901     2900       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fracasula
fracasula marked this pull request as ready for review August 5, 2025 07:43
@fracasula
fracasula enabled auto-merge (squash) August 5, 2025 09:31
@fracasula
fracasula disabled auto-merge August 5, 2025 14:27
@fracasula
fracasula merged commit b24ded8 into master Aug 5, 2025
@fracasula
fracasula deleted the nonSugaredLogger branch August 5, 2025 14:27
This was referenced Aug 18, 2025
mihir20 pushed a commit that referenced this pull request Aug 18, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.57.0-rc.1](v1.56.0...v1.57.0-rc.1)
(2025-08-18)


### Features

* add support for manual sync mode in warehouse
([#6199](#6199))
([6f87119](6f87119))
* **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).
ItsSudip pushed a commit that referenced this pull request Aug 19, 2025
🤖 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).
mihir20 pushed a commit that referenced this pull request Aug 19, 2025
🤖 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).
fracasula added a commit that referenced this pull request Oct 23, 2026
# Description

Enforces `errors.AsType[T](err)` (Go 1.26+) over `errors.As`, the same
rule as rudderlabs/rudder-go-kit#1262 and
rudder-ingestion-svc.

- **`.golangci.yml`** — a `forbidigo` rule rejects the standard library
`errors.As`.
- **`AGENTS.md`** — a "Never Do" entry next to the other linter-enforced
bans, so agents write `errors.AsType` in the first place.
- **23 call sites migrated** — jobsdb, router, notifier, geolocation,
the embedded warehouse transformer, and the warehouse API, source and
integrations (BigQuery, ClickHouse, Glue, Redshift, Snowflake).
Behaviour is unchanged.

Notes on the less mechanical ones:

- **`switch` cases** (`services/notifier`, `warehouse/source`) —
`errors.AsType` runs before the `switch`, since a `case` can't declare
variables; case order is unchanged.
- **Value-type targets** — `errors.As(err,
&maxminddb.InvalidDatabaseError{})` and `errors.As(err,
&invalidDestinationCredErr{})` matched the value type, so they become
`errors.AsType[maxminddb.InvalidDatabaseError]` and
`errors.AsType[invalidDestinationCredErr]`. Both implement `error` on
the value.
- **`jobsdb/jobsdb_test.go`** — ignored the `errors.As` result and then
dereferenced `e`; it now asserts `ok` first, so a non-`*pq.Error` fails
the test instead of panicking.

## `CLAUDE.md` and `.junie` point at `AGENTS.md`

`AGENTS.md` already holds the guidelines, but nothing pointed Claude
Code at it: there was no root `CLAUDE.md`, and since #6066
`.junie/guidelines.md` and `init/CLAUDE.md` have been symlinks to an
`.ai-agent/guidelines.md` that was never committed. A second commit adds
a root `CLAUDE.md` symlink to `AGENTS.md`, repoints
`.junie/guidelines.md` at it, and removes `init/CLAUDE.md`, which Claude
Code would only read when working inside `init/`.

## Verification

- The rule was checked against the unmigrated code first: a
`forbidigo`-only golangci-lint run flagged all 23 calls, and reports
nothing after the migration. That run type-checks every package, tests
included.
- `gofumpt -extra` reports no changes on the touched files.
- Ran locally: `router` (`TestRedact*`), `services/geolocation`, and the
warehouse transformer `utils` timestamp tests.
- Not run locally: jobsdb, notifier and the warehouse integration
suites, which need Docker or cloud credentials. CI covers them.

## Linear Ticket

None.

## Security

- [x] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants