Implement Annotation config types#106
Open
dmartmillan wants to merge 20 commits into
Open
Conversation
3 tasks
There was a problem hiding this comment.
Pull request overview
This PR introduces a Rust-native annotation configuration model (serde/YAML compatible) plus validation logic and unit tests, wiring the new annotation module into the crate and CI.
Changes:
- Added serde-compatible annotation config types (
AnnotationType,AnnotationDelimiter,AnnotationFormat, and config structs) and re-exported them viasrc/annotation/mod.rs. - Implemented YAML parse + validation entrypoints (
parse_and_validate,validate_config) and added unit tests for config round-trips and validation scenarios. - Updated build tooling and CI to run Rust tests, added stricter clippy settings, and introduced
serde/yaml_serdedependencies.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
src/annotation/config.rs |
New serde/YAML config enums + structs for annotation configuration. |
src/annotation/mod.rs |
New module entrypoint and public re-exports for config + validator APIs. |
src/annotation/validator.rs |
New YAML parse + validation logic for annotation configs. |
src/lib.rs |
Exposes annotation module publicly and enables in-crate unit tests. |
src/tests/mod.rs |
Adds crate unit test module root. |
src/tests/test_annotation/mod.rs |
Adds annotation test module wiring. |
src/tests/test_annotation/test_config.rs |
Round-trip YAML serialization/deserialization tests for enums + config defaults. |
src/tests/test_annotation/test_validator.rs |
Tests for validator success and error cases. |
Cargo.toml |
Adds serde and yaml_serde dependencies needed for YAML config support. |
Cargo.lock |
Lockfile updates for new dependencies. |
Makefile |
Adds fmt/fix targets and makes clippy warnings fatal in lint/check. |
.github/workflows/openvariant_tester.yml |
Runs Rust tests in CI in addition to existing Python tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…lab/openvariant into 64-implement-annotation-config-types
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.
This pull request corresponds to Implement Annotation config types, implement Annotation configuration and its validator along with its tests. Relates to #64 issue.
In a way of mimicking
openvariant/annotation/config_annotation.pyandopenvariant/annotation/annotation.pyfrom Python-based implementation.src/annotation/config.rs, which defines the Annotation structure.src/annotation/validator.rs, including the main functions for parsing and validating the format of Annotation YAML files.src/tests/test_annotation/, which can be run withmake test.For the moment, I didn't think about Warnings, only error. But they can be added.
If there are any tests missing, or if the validation is missing something, let me know. Also, I added tests inside
src/folder which I don't know if the best practice... because we have Python-based tests in the main folder astests/