Skip to content
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

Avoid a partially nil host as sink in test muxed providers #2699

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Dec 9, 2024

This change prevents test providers from being initialized with partially nil logging sinks, which panicked in tests. Happily, the problem is restricted to MakeMuxedServer, a testing API. This was never present in production code.

Fixes #2697

@iwahbe iwahbe requested review from VenelinMartinov and a team December 9, 2024 13:56
@iwahbe iwahbe self-assigned this Dec 9, 2024
Copy link
Contributor

@VenelinMartinov VenelinMartinov left a comment

Choose a reason for hiding this comment

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

Is this another nil interface problem? 😢

Glad to see this is only a problem with tests.

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 69.46%. Comparing base (0852d64) to head (17f803f).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/pf/tfbridge/main.go 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2699      +/-   ##
==========================================
- Coverage   69.46%   69.46%   -0.01%     
==========================================
  Files         301      301              
  Lines       38637    38644       +7     
==========================================
+ Hits        26841    26845       +4     
- Misses      10273    10275       +2     
- Partials     1523     1524       +1     

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

@iwahbe iwahbe force-pushed the iwahbe/2697/avoid-partially-nil-host-interface branch from 0fa1f8d to 03503f7 Compare December 9, 2024 14:12
@iwahbe iwahbe enabled auto-merge (rebase) December 9, 2024 14:12
@iwahbe
Copy link
Member Author

iwahbe commented Dec 9, 2024

Is this another nil interface problem? 😢

Yes 😞

@iwahbe
Copy link
Member Author

iwahbe commented Dec 9, 2024

I've added a test and am merging now. I'll run tests for another bridge release as soon as this goes in.

This change prevents test providers from being initialized with partially nil logging
sinks, which panicked in tests. Happily, the problem is restricted to `MakeMuxedServer`, a
testing API. This was never present in production code.

Fixes #2697

---

This is [my least favorite go feature](https://www.iwahbe.com/blog/go-pointers-considered-confusing/).
@iwahbe iwahbe force-pushed the iwahbe/2697/avoid-partially-nil-host-interface branch from 03503f7 to 17f803f Compare December 9, 2024 14:43
@iwahbe iwahbe merged commit c1171a0 into master Dec 9, 2024
17 checks passed
@iwahbe iwahbe deleted the iwahbe/2697/avoid-partially-nil-host-interface branch December 9, 2024 15:39
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v3.97.0.

@pulumi-bot pulumi-bot mentioned this pull request Dec 9, 2024
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.

LogRedirector panic
3 participants