fix(deploy-check): resolve the context to a file instead of a package root - #95
Merged
Merged
Conversation
… root The preview passed the pulled context package's root directory as --context-dir. The toolkit looks for cluster-context-public.yml directly inside the directory it is given and does not search, so with the nested context/public/ layout that oras produces it exited ENOENT: no such file or directory, open '/home/runner/work/_temp/deploy-preview-context/cluster-context-public.yml' on all five fragments. This passed locally because the directory used there was the one that holds the file, not the package root, so the two layouts were never compared. The discovered file is now always passed as --context-path, which works for either layout. Two tests cover it: every render must receive a --context-path that exists and ends in cluster-context-public.yml, and a nested package must resolve to the nested file. Reintroducing --context-dir fails the first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
deploy-previewfailed on every service repo PR after v0.15.0 landed, with all five fragments reporting:The preview passed the pulled context package's root as
--context-dir. The toolkit looks forcluster-context-public.ymldirectly inside the directory it is given and does not search, so the nestedcontext/public/layout thatoras pullproduces cannot be found that way.This passed local verification because the directory I pointed at was the one that holds the file, not a package root — so the flat and nested layouts were never compared. The unit tests missed it for the same reason: the stub toolkit records arguments but does not enforce the real
--context-dirsemantics.Change
The discovered file is always passed as
--context-path, which works for either layout.findClusterContextalready searched recursively and preferredcontext/public/; its result is now used rather than discarded.Coverage
Two tests, both against the nested layout:
rendercall receives a--context-paththat exists and ends incluster-context-public.yml, and no--context-dirReintroducing
--context-dirfails the first. Verified end to end against a deliberately nested local package: five fragments render and the scorecard passes.