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

Archetype - popped global scopes are incorrectly resolved #1069

Open
romain-grecourt opened this issue Sep 24, 2024 · 0 comments
Open

Archetype - popped global scopes are incorrectly resolved #1069

romain-grecourt opened this issue Sep 24, 2024 · 0 comments
Labels
4.x archetype bug Something isn't working
Milestone

Comments

@romain-grecourt
Copy link
Contributor

Problem

Popped global scopes are incorrectly resolved.

Because strict parenting is enforced when pushing scope, a previously popped global scope cannot be resolved otherwise it may result into errors if it is pushed from a different path.

E.g.

push flavor global=true
push app-type global=true
push media global=false
pop media
pop app-type
push media global=false

The last push fails because flavor.app-type.media is resolved instead of creating flavor.media and flavor.app-type.media is not a direct child of flavor.

Fix

We need to update Context.popScope to clear the edge and merge the values in the parent scope.

Compatibility

If this issue impacts older releases of the engine, we will need to start processing the archetypes at build time to produce compatibles scripts.

@romain-grecourt romain-grecourt added bug Something isn't working archetype 4.x labels Sep 24, 2024
@romain-grecourt romain-grecourt added this to the 4.0.12 milestone Sep 24, 2024
romain-grecourt added a commit to romain-grecourt/helidon-build-tools that referenced this issue Sep 24, 2024
Fixes helidon-io#1069

- Update Context.popScope to clear the edge and merge values in the parent
- Move ContextScope.isModel to ContextValue.isModel as values are propagated
- Add support for handlebar tag escape with []
- Cleanup OutputGeneratorTest.testContextValues
- Fix MergedModelTest.testResolveWithNonRootContext to use a global context
@romain-grecourt romain-grecourt modified the milestones: 4.0.12, 4.0.13 Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x archetype bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant