Feat(validation): Add support for Prefix keys - #93
Conversation
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
8295702 to
c2819e5
Compare
c2819e5 to
59e2349
Compare
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
==========================================
+ Coverage 88.63% 89.20% +0.56%
==========================================
Files 79 81 +2
Lines 15304 16364 +1060
==========================================
+ Hits 13565 14597 +1032
- Misses 1739 1767 +28
🚀 New features to boost your workflow:
|
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Guillaume Mulocher <gmulocher@arista.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Guillaume Mulocher <gmulocher@arista.com>
…p across 1 directory (aristanetworks#143) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…12e35e16 to e79a6962e0d4c0c17b229090214935d2e33f8354 (aristanetworks#147) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…0dab7590f9b7d to cef221092ed1bacb1cc03d23a2d87d1d172e277b (aristanetworks#145) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…istanetworks#146) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Guillaume Mulocher <gmulocher@arista.com>
…rks#150) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Guillaume Mulocher <gmulocher@arista.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Guillaume Mulocher <gmulocher@arista.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
📝 WalkthroughWalkthroughThis PR upgrades pyavd-utils from v0.0.5 to v0.0.6, introducing a major refactor of dictionary schema key resolution with support for dynamic-key overrides and prefix-based matching, while hardening CI workflows with pinned action versions and explicit permissions. The changes span schema definitions, validation pipelines, Python bindings, dependency updates, and tooling configuration. ChangesDictionary Schema Refactor with Prefix and Dynamic Key Support
Schema Utilities Updated for Key Resolution
Validation Dict Key Matching with Dynamic Override Support
AVD Schema Crate Lint and Visibility Updates
Password Codec Dependency and Binding Updates
Version Bump and Dependency Updates (v0.0.5 → v0.0.6)
GitHub Actions Workflows: Permissions and Action Pinning
Pre-Commit and Dependabot Configuration Updates
Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Possibly related PRs
Suggested reviewers
|
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/pull-request-autofix.yml:
- Around line 14-15: The workflow currently sets repository contents permission
to read (permissions: contents: read) which prevents the autofix action from
pushing commits; change the permissions block to grant write access for contents
(so the autofix-ci/action can create commits) by updating the permissions key
that references contents: read to allow write (e.g., contents: write) and ensure
the job that runs autofix-ci/action retains that permission so the push step
succeeds.
In `@Cargo.toml`:
- Around line 13-15: The THIRD_PARTY_LICENSES.txt metadata is out of sync with
Cargo.toml/Cargo.lock: Cargo.toml pins pyo3-build-config at 0.28.3 but the
license file (pyavd_utils/THIRD_PARTY_LICENSES.txt) still lists
pyo3-build-config (and other PyO3 entries) as 0.27.2; update the license
metadata to match the actual dependency version (0.28.3) by regenerating the
license file using your license-export tool or run the same process that
produced THIRD_PARTY_LICENSES.txt, or alternatively align the Cargo.toml pins
back to 0.27.2 so versions match consistently (referencing pyo3-build-config,
pyo3, pyo3-log entries when making the change).
In `@rust/avdschema/src/schema/dict/dynamic_keys.rs`:
- Around line 62-80: The current search over self.prefix_configs uses find_map
which returns the first non-None result and can let an early
InvalidSuffix/AllowedOtherSuffix mask a later Valid match; change the logic in
the block that calls prefix_configs.iter().find_map(...) so that you iterate all
configs: return immediately if any config.resolve_match(key) yields
PrefixMatchResult::Valid (wrap into DictKeyMatch::Prefix), otherwise remember
the first seen InvalidSuffix or AllowedOtherSuffix and after the loop return
that remembered DictKeyMatch variant if present, else DictKeyMatch::UnknownKey;
reference symbols: prefix_configs, resolve_match,
PrefixMatchResult::{Valid,InvalidSuffix,AllowedOtherSuffix}, and
DictKeyMatch::{Prefix,PrefixInvalidSuffix,PrefixAllowedOtherSuffix,UnknownKey}.
In `@rust/pyvalidation/benches/performance.rs`:
- Around line 19-27: The benchmark currently calls init_store_from_file inside
bencher.iter which only does real initialization on the first call (OnceLock),
so subsequent iterations measure the OnceLock error path; fix by not calling
init_store_from_file repeatedly: perform a single initialization outside the
bencher.iter (call init_store_from_file(schema_file.to_owned()) once before
group.bench_function) if you only need one-time setup, or if you actually want
to measure cold initialization cost, change the benchmark to spawn a fresh
process per iteration (or use a per-iteration external setup) so
init_store_from_file runs in a new process each time; refer to
init_store_from_file, OnceLock, and the group.bench_function/bencher.iter call
to locate where to change.
In `@rust/validation/src/lib.rs`:
- Around line 4-25: Replace the large crate-level allow block with a documented,
tracked remediation plan: open a tracking issue (link/ID) for removing/triaging
the lint suppressions and update the file's allow attribute (#![allow(...)] in
lib.rs) to either narrow scope (apply to specific test modules or files) or keep
only unavoidable lints while leaving a TODO comment referencing the new issue;
prioritize fixing clippy::indexing_slicing and missing_docs first and list them
in the issue with incremental tasks to remove each lint suppression from the
allow list (mention the exact lint names from the current block such as
missing_docs and clippy::indexing_slicing and any other high-risk entries).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: b6e6681c-0007-434e-a5ce-b1020d1013aa
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (67)
.github/actions/rn-pr-labeler-action/action.yml.github/dependabot.yml.github/workflows/build-wheel.yml.github/workflows/codecov.yml.github/workflows/pull-request-autofix.yml.github/workflows/pull-request-conflict.yml.github/workflows/pull-request-management.yml.github/workflows/pull-request-rn-labeler.yml.github/workflows/pull-request-triage.yml.github/workflows/release.yml.github/workflows/stale.yml.github/workflows/zizmor.yml.pre-commit-config.yamlCargo.tomlpyavd_utils/THIRD_PARTY_LICENSES.txtpyavd_utils/__init__.pypyproject.tomlrust/avdschema/Cargo.tomlrust/avdschema/src/inherit.rsrust/avdschema/src/lib.rsrust/avdschema/src/resolve/mod.rsrust/avdschema/src/resolve/resolve_ref.rsrust/avdschema/src/resolve/walker.rsrust/avdschema/src/schema/any.rsrust/avdschema/src/schema/base/documentation_options.rsrust/avdschema/src/schema/base/mod.rsrust/avdschema/src/schema/dict.rsrust/avdschema/src/schema/dict/dynamic_keys.rsrust/avdschema/src/schema/dict/mod.rsrust/avdschema/src/schema/dict/prefix_keys.rsrust/avdschema/src/schema/list.rsrust/avdschema/src/schema/str.rsrust/avdschema/src/store.rsrust/avdschema/src/utils/dump.rsrust/avdschema/src/utils/load.rsrust/avdschema/src/utils/macros.rsrust/avdschema/src/utils/mod.rsrust/avdschema/src/utils/schema_data.rsrust/avdschema/src/utils/schema_from_path.rsrust/passwords/Cargo.tomlrust/passwords/src/cbc/mod.rsrust/passwords/src/lib.rsrust/passwords/src/simple_7/mod.rsrust/pypasswords/Cargo.tomlrust/pypasswords/build.rsrust/pypasswords/src/lib.rsrust/pypasswords/src/tests/mod.rsrust/pypasswords/src/tests/test_simple_7.rsrust/pyvalidation/Cargo.tomlrust/pyvalidation/benches/performance.rsrust/pyvalidation/build.rsrust/pyvalidation/src/lib.rsrust/validation/Cargo.tomlrust/validation/src/context.rsrust/validation/src/feedback.rsrust/validation/src/lib.rsrust/validation/src/validatable/mod.rsrust/validation/src/validatable/serde_json_impl.rsrust/validation/src/validatable/tests.rsrust/validation/src/validatable/yaml_parser_impl.rsrust/validation/src/validation/boolean.rsrust/validation/src/validation/dict.rsrust/validation/src/validation/int.rsrust/validation/src/validation/list.rsrust/validation/src/validation/store.rsrust/validation/src/validation/str.rsrust/yaml-parser/src/avdschema_data_impl.rs
💤 Files with no reviewable changes (1)
- rust/avdschema/src/schema/dict.rs
| permissions: | ||
| contents: read |
There was a problem hiding this comment.
Grant write permission for autofix commits.
Line 14-15 sets contents: read, but Line 47-48 attempts to push fixes via autofix-ci/action. With read-only contents, the commit-back step cannot write.
Suggested fix
permissions:
- contents: read
+ contents: write📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| permissions: | |
| contents: read | |
| permissions: | |
| contents: write |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/pull-request-autofix.yml around lines 14 - 15, The
workflow currently sets repository contents permission to read (permissions:
contents: read) which prevents the autofix action from pushing commits; change
the permissions block to grant write access for contents (so the
autofix-ci/action can create commits) by updating the permissions key that
references contents: read to allow write (e.g., contents: write) and ensure the
job that runs autofix-ci/action retains that permission so the push step
succeeds.
| pyo3 = { version = "0.27.2" } | ||
| pyo3-build-config = { version = "0.27.2" } | ||
| pyo3-log = { version = "0.13.1" } | ||
| pyo3-build-config = { version = "0.28.3" } | ||
| pyo3-log = { version = "0.13.3" } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Workspace pins in Cargo.toml =="
rg -n '^\s*(pyo3|pyo3-build-config|pyo3-log)\s*=' Cargo.toml
echo
echo "== Resolved versions in Cargo.lock =="
LOCK_FILE="$(fd '^Cargo.lock$' | head -n1)"
if [ -n "${LOCK_FILE:-}" ]; then
rg -n '^(name = "(pyo3|pyo3-build-config|pyo3-log)"|version = )' "$LOCK_FILE" -A1
else
echo "Cargo.lock not found"
fi
echo
echo "== License manifest entries =="
rg -n 'pyo3-build-config|pyo3-ffi|pyo3-macros-backend|pyo3-macros|pyo3 0\.27\.2' pyavd_utils/THIRD_PARTY_LICENSES.txtRepository: aristanetworks/pyavd-utils
Length of output: 27960
Align PyO3 dependency versions with generated license metadata (pyo3-build-config 0.28.3).
Cargo.toml (lines 13-15) pins pyo3-build-config to 0.28.3, Cargo.lock includes pyo3-build-config 0.28.3, but pyavd_utils/THIRD_PARTY_LICENSES.txt still lists pyo3-build-config 0.27.2 (with the rest of the PyO3 family at 0.27.2). This is a dependency/metadata drift that can break compliance/release documentation consistency—regenerate/update the license metadata to include 0.28.3 (or align the dependency pins).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Cargo.toml` around lines 13 - 15, The THIRD_PARTY_LICENSES.txt metadata is
out of sync with Cargo.toml/Cargo.lock: Cargo.toml pins pyo3-build-config at
0.28.3 but the license file (pyavd_utils/THIRD_PARTY_LICENSES.txt) still lists
pyo3-build-config (and other PyO3 entries) as 0.27.2; update the license
metadata to match the actual dependency version (0.28.3) by regenerating the
license file using your license-export tool or run the same process that
produced THIRD_PARTY_LICENSES.txt, or alternatively align the Cargo.toml pins
back to 0.27.2 so versions match consistently (referencing pyo3-build-config,
pyo3, pyo3-log entries when making the change).
| self.prefix_configs | ||
| .as_ref() | ||
| .and_then(|prefix_configs| { | ||
| prefix_configs | ||
| .iter() | ||
| .find_map(|config| match config.resolve_match(key) { | ||
| Some(PrefixMatchResult::Valid(prefix_key_match)) => { | ||
| Some(DictKeyMatch::Prefix(prefix_key_match)) | ||
| } | ||
| Some(PrefixMatchResult::InvalidSuffix) => { | ||
| Some(DictKeyMatch::PrefixInvalidSuffix) | ||
| } | ||
| Some(PrefixMatchResult::AllowedOtherSuffix) => { | ||
| Some(DictKeyMatch::PrefixAllowedOtherSuffix) | ||
| } | ||
| None => None, | ||
| }) | ||
| }) | ||
| .unwrap_or(DictKeyMatch::UnknownKey) |
There was a problem hiding this comment.
Prefer valid prefix matches over early invalid-prefix outcomes across configs.
The current find_map returns the first non-None prefix result, so InvalidSuffix/AllowedOtherSuffix from an earlier config can mask a valid match from a later config.
Suggested fix
- self.prefix_configs
- .as_ref()
- .and_then(|prefix_configs| {
- prefix_configs
- .iter()
- .find_map(|config| match config.resolve_match(key) {
- Some(PrefixMatchResult::Valid(prefix_key_match)) => {
- Some(DictKeyMatch::Prefix(prefix_key_match))
- }
- Some(PrefixMatchResult::InvalidSuffix) => {
- Some(DictKeyMatch::PrefixInvalidSuffix)
- }
- Some(PrefixMatchResult::AllowedOtherSuffix) => {
- Some(DictKeyMatch::PrefixAllowedOtherSuffix)
- }
- None => None,
- })
- })
- .unwrap_or(DictKeyMatch::UnknownKey)
+ if let Some(prefix_configs) = self.prefix_configs.as_ref() {
+ let mut fallback: Option<DictKeyMatch<'a>> = None;
+ for config in prefix_configs {
+ match config.resolve_match(key) {
+ Some(PrefixMatchResult::Valid(prefix_key_match)) => {
+ return DictKeyMatch::Prefix(prefix_key_match);
+ }
+ Some(PrefixMatchResult::AllowedOtherSuffix) => {
+ fallback.get_or_insert(DictKeyMatch::PrefixAllowedOtherSuffix);
+ }
+ Some(PrefixMatchResult::InvalidSuffix) => {
+ if fallback.is_none() {
+ fallback = Some(DictKeyMatch::PrefixInvalidSuffix);
+ }
+ }
+ None => {}
+ }
+ }
+ return fallback.unwrap_or(DictKeyMatch::UnknownKey);
+ }
+ DictKeyMatch::UnknownKey🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rust/avdschema/src/schema/dict/dynamic_keys.rs` around lines 62 - 80, The
current search over self.prefix_configs uses find_map which returns the first
non-None result and can let an early InvalidSuffix/AllowedOtherSuffix mask a
later Valid match; change the logic in the block that calls
prefix_configs.iter().find_map(...) so that you iterate all configs: return
immediately if any config.resolve_match(key) yields PrefixMatchResult::Valid
(wrap into DictKeyMatch::Prefix), otherwise remember the first seen
InvalidSuffix or AllowedOtherSuffix and after the loop return that remembered
DictKeyMatch variant if present, else DictKeyMatch::UnknownKey; reference
symbols: prefix_configs, resolve_match,
PrefixMatchResult::{Valid,InvalidSuffix,AllowedOtherSuffix}, and
DictKeyMatch::{Prefix,PrefixInvalidSuffix,PrefixAllowedOtherSuffix,UnknownKey}.
| fn benchmark_init_store_from_file(criterion: &mut Criterion) { | ||
| let schema_file = get_store_gz_path(); | ||
| let mut group = c.benchmark_group("sample-size-10"); | ||
| let mut group = criterion.benchmark_group("sample-size-10"); | ||
| group.sample_size(10); // Lowering the sample size from the default 1000 since tests in this group are expected to take longer. | ||
| group.bench_function("init_store_from_fragments", |b| { | ||
| b.iter(|| init_store_from_file(schema_file.to_owned())) | ||
| group.bench_function("init_store_from_fragments", |bencher| { | ||
| bencher.iter(|| init_store_from_file(schema_file.to_owned())); | ||
| }); | ||
| group.finish(); | ||
| } |
There was a problem hiding this comment.
Benchmark is measuring the OnceLock error path after the first iteration.
init_store_from_file initializes a global OnceLock only once (rust/pyvalidation/src/lib.rs), so repeated calls inside bencher.iter mostly benchmark immediate failure, not store initialization/resolve cost.
Suggested fix
use criterion::Criterion;
use criterion::criterion_group;
use criterion::criterion_main;
+use avdschema::Store;
use pyvalidation::validation::get_validated_data;
-use pyvalidation::validation::init_store_from_file;
use test_schema_store::get_store_gz_path;
@@
fn benchmark_init_store_from_file(criterion: &mut Criterion) {
let schema_file = get_store_gz_path();
let mut group = criterion.benchmark_group("sample-size-10");
group.sample_size(10); // Lowering the sample size from the default 1000 since tests in this group are expected to take longer.
group.bench_function("init_store_from_fragments", |bencher| {
- bencher.iter(|| init_store_from_file(schema_file.to_owned()));
+ bencher.iter(|| {
+ let store = Store::from_file(Some(&schema_file)).expect("load store");
+ let _ = store.as_resolved().expect("resolve store");
+ });
});
group.finish();
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn benchmark_init_store_from_file(criterion: &mut Criterion) { | |
| let schema_file = get_store_gz_path(); | |
| let mut group = c.benchmark_group("sample-size-10"); | |
| let mut group = criterion.benchmark_group("sample-size-10"); | |
| group.sample_size(10); // Lowering the sample size from the default 1000 since tests in this group are expected to take longer. | |
| group.bench_function("init_store_from_fragments", |b| { | |
| b.iter(|| init_store_from_file(schema_file.to_owned())) | |
| group.bench_function("init_store_from_fragments", |bencher| { | |
| bencher.iter(|| init_store_from_file(schema_file.to_owned())); | |
| }); | |
| group.finish(); | |
| } | |
| use criterion::Criterion; | |
| use criterion::criterion_group; | |
| use criterion::criterion_main; | |
| use avdschema::Store; | |
| use pyvalidation::validation::get_validated_data; | |
| use test_schema_store::get_store_gz_path; | |
| fn benchmark_init_store_from_file(criterion: &mut Criterion) { | |
| let schema_file = get_store_gz_path(); | |
| let mut group = criterion.benchmark_group("sample-size-10"); | |
| group.sample_size(10); // Lowering the sample size from the default 1000 since tests in this group are expected to take longer. | |
| group.bench_function("init_store_from_fragments", |bencher| { | |
| bencher.iter(|| { | |
| let store = Store::from_file(Some(&schema_file)).expect("load store"); | |
| let _ = store.as_resolved().expect("resolve store"); | |
| }); | |
| }); | |
| group.finish(); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rust/pyvalidation/benches/performance.rs` around lines 19 - 27, The benchmark
currently calls init_store_from_file inside bencher.iter which only does real
initialization on the first call (OnceLock), so subsequent iterations measure
the OnceLock error path; fix by not calling init_store_from_file repeatedly:
perform a single initialization outside the bencher.iter (call
init_store_from_file(schema_file.to_owned()) once before group.bench_function)
if you only need one-time setup, or if you actually want to measure cold
initialization cost, change the benchmark to spawn a fresh process per iteration
(or use a per-iteration external setup) so init_store_from_file runs in a new
process each time; refer to init_store_from_file, OnceLock, and the
group.bench_function/bencher.iter call to locate where to change.
| // TODO: Reevaluate the allow | ||
| #![allow( | ||
| missing_docs, | ||
| missing_debug_implementations, | ||
| clippy::as_conversions, | ||
| clippy::cast_possible_truncation, | ||
| clippy::cast_precision_loss, | ||
| clippy::default_trait_access, | ||
| clippy::empty_structs_with_brackets, | ||
| clippy::field_scoped_visibility_modifiers, | ||
| clippy::float_cmp, | ||
| clippy::from_iter_instead_of_collect, | ||
| clippy::indexing_slicing, | ||
| clippy::min_ident_chars, | ||
| clippy::match_wildcard_for_single_variants, | ||
| clippy::option_option, | ||
| clippy::partial_pub_fields, | ||
| clippy::shadow_unrelated, | ||
| clippy::struct_excessive_bools, | ||
| clippy::trivially_copy_pass_by_ref, | ||
| reason = "Existing validation models and tests predate workspace lint inheritance" | ||
| )] |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Document technical debt: Large lint allowance block.
The broad #![allow(...)] block suppresses many important lints including missing_docs, clippy::indexing_slicing, and others. While the TODO acknowledges this needs re-evaluation, consider tracking this technical debt with an issue to incrementally address these warnings.
Consider creating a tracking issue and incrementally addressing the most valuable lints first (e.g., clippy::indexing_slicing for safety, missing_docs for API clarity).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rust/validation/src/lib.rs` around lines 4 - 25, Replace the large
crate-level allow block with a documented, tracked remediation plan: open a
tracking issue (link/ID) for removing/triaging the lint suppressions and update
the file's allow attribute (#![allow(...)] in lib.rs) to either narrow scope
(apply to specific test modules or files) or keep only unavoidable lints while
leaving a TODO comment referencing the new issue; prioritize fixing
clippy::indexing_slicing and missing_docs first and list them in the issue with
incremental tasks to remove each lint suppression from the allow list (mention
the exact lint names from the current block such as missing_docs and
clippy::indexing_slicing and any other high-risk entries).
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Change Summary
Add support for Prefix keys like
custom_structured_configuration_Also needs a follow up PR updating the metaschema and schema in AVD.
Related Issue(s)
Get proper validation of custom structured configuration.
Fixes #77 since it is actually caused by missing validation of custom structured configuration.
Component(s) name
Proposed changes
How to test
Added unit tests here. Will need an AVD change to fully test it end to end.
Checklist
User Checklist
Repository Checklist
Summary by CodeRabbit
New Features
Bug Fixes & Improvements
Dependencies
Chores