fix: render mfe-ports for unmounted mfes when these exist #241
+13
−6
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.
Description
The issue occurs when all MFEs (Micro Frontends) are mounted, and the
ports
section in the Docker configuration is left empty, leading to a syntax error in the generated Dockerfile. Specifically, theports:
line becomes invalid as another key follows it (auth:
) without any content. In thetutor dev
context, the issue occurs because developers mount MFEs for testing purposes. It won't reproduce fortutor local
.How to Reproduce
authn, account, communications, course-authoring, discussions, gradebook, learner-dashboard, learning, ora-grading, profile
)tutor mounts add $(pwd)/frontend-app-*
where*
represents all MFEs name one by onetutor config save
tutor dev start
OR directly check themfe-ports
section intutor-env/env/dev/docker-compose.yml
What this PR does
This PR resolves the issue by implementing logic to first check if any unmounted MFEs exist. If unmounted MFEs are found, their corresponding ports are rendered in the ports: section. This ensures that the Docker configuration is generated correctly and avoids errors caused by leaving the
ports:
section empty.TestCases:
mfe: ports:
section.mfe: ports:
section should be excluded entirely from the generated output.Closes #242