[tool] clean up https cert configuration handling#178139
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request refactors the HTTPS certificate configuration handling, making HttpsConfig more robust by ensuring both certificate and key paths are non-null. The changes are correctly propagated through WebAssetServer and DebuggingOptions. My review includes a suggestion to improve error handling for partial HTTPS configurations, making it more explicit for the user rather than silently failing.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the handling of HTTPS certificate configuration to ensure that both the certificate path and key path are provided. This is a good improvement for correctness and code clarity. The introduction of HttpsConfig.parse centralizes the validation logic, and making HttpsConfig fields non-nullable enforces the invariant that both paths must exist. The related code cleanups in device.dart and web_asset_server.dart are also positive changes. I have one minor suggestion to improve the error handling to be more idiomatic.
| final String? certPath; | ||
| final String? certKeyPath; | ||
| final String certPath; | ||
| final String certKeyPath; |
There was a problem hiding this comment.
I like that this is more strict now, and throwy in the static factory method!
|
@ditman – tests added! |
It's only valid if both the cert and the cert key are set. Makes the code a lot cleaner, too.
It's only valid if both the cert and the cert key are set. Makes the code a lot cleaner, too.
It's only valid if both the cert and the cert key are set. Makes the code a lot cleaner, too.
It's only valid if both the cert and the cert key are set.
Makes the code a lot cleaner, too.