feat(sanity): add checkers to validate next/prev token refers to another one#242
Merged
Conversation
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
1250007 to
3de1998
Compare
Contributor
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds six new reference validation checkers (REF016-REF021) to ensure that next and prev fields in Sample, SampleAnnotation, and SampleData schemas either are empty or contain valid references to other records of the same type.
- Added checkers REF016-REF021 to validate bidirectional linked-list relationships
- Registered all new checkers in the reference module's
__init__.py - Updated documentation to describe the new validation rules
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| t4_devkit/sanity/reference/ref016.py | Validates Sample.next references |
| t4_devkit/sanity/reference/ref017.py | Validates Sample.prev references |
| t4_devkit/sanity/reference/ref018.py | Validates SampleAnnotation.next references |
| t4_devkit/sanity/reference/ref019.py | Validates SampleAnnotation.prev references |
| t4_devkit/sanity/reference/ref020.py | Validates SampleData.next references |
| t4_devkit/sanity/reference/ref021.py | Validates SampleData.prev references |
| t4_devkit/sanity/reference/init.py | Registers the new checker modules |
| docs/schema/requirement.md | Documents the new validation rules |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This pull request adds six new reference checkers to the sanity validation framework, each enforcing that certain fields referencing other records are either empty or valid references. These new checkers cover
nextandprevrelationships inSample,SampleAnnotation, andSampleDataschemas. The documentation is updated to reflect these new rules, and the checkers are registered for use in the framework.New reference checkers for record relationships
REF016to ensureSample.nextrefers to another record unless it is empty.REF017to ensureSample.prevrefers to another record unless it is empty.REF018to ensureSampleAnnotation.nextrefers to another record unless it is empty.REF019to ensureSampleAnnotation.prevrefers to another record unless it is empty.REF020to ensureSampleData.nextrefers to another record unless it is empty.REF021to ensureSampleData.prevrefers to another record unless it is empty.Documentation and registration
docs/schema/requirement.mdto document all six new reference rules.t4_devkit/sanity/reference/__init__.pyfor framework usage.