adapter: disallow using inner PlanValidity fields for SQL logic
PlanValidity may be changing in the near future to no longer track anything beyond the transient revision. Refactor places where parts of the plan validity were used for various SQL logic by explicitly requiring and passing that data instead.
Motivation
- This PR refactors existing code.
Checklist
- [ ] This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
- [ ] This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
- [ ] If this PR evolves an existing
$T ⇔ Proto$Tmapping (possibly in a backwards-incompatible way), then it is tagged with aT-protolabel. - [ ] If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
- [ ] This PR includes the following user-facing behavior changes:
- n/a
Refactor only, should be no logic changes.
Mitigations
Completing required mitigations increases Resilience Coverage.
- [x] (Required) Code Review
🔍 Detected - [ ] (Required) Feature Flag
- [ ] (Required) Integration Test
- [ ] (Required) Observability
- [x] (Required) QA Review
🔍 Detected - [ ] (Required) Run Nightly Tests
- [x] Unit Test
🔍 Detected
Risk Summary:
The pull request carries a high risk with a score of 82, influenced by the average age of files, cognitive complexity within files, and the delta of executable lines. Historically, pull requests with these characteristics are 113% more likely to introduce bugs compared to the repository's baseline. Additionally, the repository is experiencing an increasing predicted bug trend, and this pull request modifies 3 files known as hotspots for recent bug fixes. The observed bug trend in the repository has remained steady.
Note: The risk score is not based on semantic analysis but on historical predictors of bug occurrence in the repository. The attributes above were deemed the strongest predictors based on that history. Predictors and the score may change as the PR evolves in code, time, and review activity.
Bug Hotspots: What's This?
| File | Percentile |
|---|---|
| ../src/coord.rs | 99 |
| ../sequencer/inner.rs | 99 |
| ../inner/peek.rs | 95 |
Added tests for all check branches. Refactored some nearby stuff to make that easier.