Mark all existing options as non-updateable - #377
Conversation
067b4ba to
39b05fe
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a constructed flag on Context and uses it to make all existing ContextOptions reject mutation after context construction, establishing a baseline for future “selectively updatable options” work (notably for Cryptex).
Changes:
- Add
Context.constructedand set it duringCreateContextto gate option updates. - Make all existing options in
option.goreturnErrContextOptionNotUpdatableafter construction. - Add/adjust tests to validate the new non-updatability behavior and update a test helper to mark contexts as constructed.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
context.go |
Adds the constructed flag to Context and sets it during CreateContext. |
errors.go |
Introduces ErrContextOptionNotUpdatable for post-construction option mutation attempts. |
option.go |
Adds constructed-state checks to all existing ContextOptions. |
option_test.go |
New test coverage for option “set during construction only” behavior. |
srtp_cipher_utils_test.go |
Marks test-created contexts as constructed to align with new option gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
39b05fe to
39575de
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #377 +/- ##
==========================================
+ Coverage 84.06% 84.23% +0.17%
==========================================
Files 19 19
Lines 1512 1541 +29
==========================================
+ Hits 1271 1298 +27
- Misses 134 135 +1
- Partials 107 108 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
39575de to
51b426d
Compare
Initial changes to allow changing selected options at runtime. This is needed for Cryptex implementation.
51b426d to
1842d60
Compare
Initial changes to allow changing selected options at runtime. This is needed for Cryptex implementation.