Conversation
fix(schema): include 'default' and 'kubevirt' in driver validation er…
…ror message Signed-off-by: Saad Ahmed <saadahmedawan224@gmail.com>
fix(schema): include 'default' and 'kubevirt' in driver validation er…
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe pull request updates the driver validation message and its test, and adds specific redaction for paths containing ChangesDriver validation
Output sanitization
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Warning Comment |
Summary
This PR addresses a minor discrepancy between the driver enum definitions and the corresponding schema error message in
src/molecule/data/molecule.json.Specifically, the schema
enumallowed"default"and"kubevirt"as valid driver names, but the custom error message defined undermessages.anyOfomitted both drivers from the error text displayed to users when driver schema validation fails.Issue / Problem Description
When an invalid or unrecognized driver name is specified in a scenario configuration (e.g.
driver: { name: "invalid_driver" }), Molecule validates the configuration againstmolecule.json.In the existing schema:
["azure", "ec2", "delegated", "default", "docker", "containers", "openstack", "podman", "vagrant", "digitalocean", "gce", "libvirt", "lxd", "kubevirt", "lima"]messages.anyOf):"is not one of ['azure', 'ec2', 'delegated', 'docker', 'containers', 'openstack', 'podman', 'vagrant', 'digitalocean', 'gce', 'libvirt', 'lxd', 'lima', 'molecule-*', 'molecule_*', 'custom-*', 'custom_*']"Because
'default'and'kubevirt'were missing frommessages.anyOf, the error hint provided incomplete guidance to the user.Proposed Changes
src/molecule/data/molecule.json:'default'and'kubevirt'to themessages.anyOferror string to match the full set of accepted driver enum values.tests/unit/model/v2/test_driver_section.py:base_error_msgintest_driver_has_errorsto match the updated error message string.Detailed Schema Comparison
"messages": { - "anyOf": "is not one of ['azure', 'ec2', 'delegated', 'docker', 'containers', 'openstack', 'podman', 'vagrant', 'digitalocean', 'gce', 'libvirt', 'lxd', 'lima', 'molecule-*', 'molecule_*', 'custom-*', 'custom_*']" + "anyOf": "is not one of ['azure', 'ec2', 'delegated', 'default', 'docker', 'containers', 'openstack', 'podman', 'vagrant', 'digitalocean', 'gce', 'libvirt', 'lxd', 'kubevirt', 'lima', 'molecule-*', 'molecule_*', 'custom-*', 'custom_*']" } <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Updated driver validation messages to include all supported backends, including `default` and `kubevirt`. * Improved command output sanitization by redacting paths that include molecule scenario directories. * **Tests** * Updated validation and output-sanitization checks to reflect the corrected behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->