Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle refs without module #3817

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

matt2e
Copy link
Collaborator

@matt2e matt2e commented Dec 18, 2024

closes #3526

  • When validating a module, push all module decls into scopes
    • This allows refs without a module value to match local decls (like how builtins decls work)
  • Any decls with the same name are no longer allowed
    • We previously checked for decl name clashes only within the same type
    • If we allow name clashes then refs can't uniquely refer to those nodes
    • We previously had a test to allow configs and secrets with the same name, but that sounds like a mistake waiting to happen (setting a secret as a config means we won't treat it securely)
  • Centralise Ref normalisation: Validation visits child nodes before validating parent nodes, removing the need for parent nodes to handle refs without a module value

@alecthomas alecthomas mentioned this pull request Dec 18, 2024
@matt2e matt2e force-pushed the matt2e/schema-ref-normalization branch from 53c8a0b to a639a07 Compare December 19, 2024 00:27
@matt2e matt2e changed the title chore: normalise refs before validating parent nodes fix: normalise refs without a module name Dec 19, 2024
@matt2e matt2e force-pushed the matt2e/schema-ref-normalization branch from a639a07 to dc4c69a Compare December 19, 2024 01:54
@matt2e matt2e changed the title fix: normalise refs without a module name fix: handle refs without module Dec 19, 2024
@matt2e matt2e force-pushed the matt2e/schema-ref-normalization branch from dc4c69a to 1a047a5 Compare December 19, 2024 02:00
@matt2e matt2e marked this pull request as ready for review December 19, 2024 02:02
@matt2e matt2e requested a review from alecthomas as a code owner December 19, 2024 02:02
@matt2e matt2e force-pushed the matt2e/schema-ref-normalization branch from 2439e6e to a186041 Compare December 19, 2024 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schema validate has many places that fill in ref.Module if blank
1 participant