Fix a random issue with the parse-problem-doc.pl script. - #1492
Merged
Conversation
The script works by generating the metadata for the files in the `tutorial/sample-problems` directory. That is a hash whose keys are the filenames and whose values are hash references containing the metadata for the files. Then the keys of that hash are iterated over, and the sample problem documentation rendered. In that process a subdirectory of the output location is created for the file if it does not already exist. Since hashes are not ordered, the order the files are iterated over will be different each time. So if the `tutorial/sample-problems/VectorCalc/VectorFieldGraph3D/VectorFieldGraph3D1.pg` problem happens to be processed before any of the other problems in the `tutorial/sample-problems/VectorCalc` directory, then the `mkdir` call attempts to create the output subdirectory `VectorCalc/VectorFieldGraph3D` which fails because the `VectorCalc` subdirectory does not yet exist and `mkdir` is not recursive. To fix this use the `Mojo::File` `make_path` method instead, which is recursive. It is not essential to hotfix this. If the job fails when a hotfix goes in, then we just need to rerun the job, and hope that file, which is the only one with directory depth 2, is not processed before the other files in the directory the next time it is run.
Member
Author
|
Note that I already reran the job from when the release candidate branch was merged into main, and it succeeded the second time. |
somiaj
approved these changes
Aug 5, 2026
pstaabp
approved these changes
Aug 5, 2026
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.
The script works by generating the metadata for the files in the
tutorial/sample-problemsdirectory. That is a hash whose keys are the filenames and whose values are hash references containing the metadata for the files. Then the keys of that hash are iterated over, and the sample problem documentation rendered. In that process a subdirectory of the output location is created for the file if it does not already exist. Since hashes are not ordered, the order the files are iterated over will be different each time. So if thetutorial/sample-problems/VectorCalc/VectorFieldGraph3D/VectorFieldGraph3D1.pgproblem happens to be processed before any of the other problems in thetutorial/sample-problems/VectorCalcdirectory, then themkdircall attempts to create the output subdirectoryVectorCalc/VectorFieldGraph3Dwhich fails because theVectorCalcsubdirectory does not yet exist andmkdiris not recursive.To fix this use the
Mojo::Filemake_pathmethod instead, which is recursive.It is not essential to hotfix this. If the job fails when a hotfix goes in, then we just need to rerun the job, and hope that file, which is the only one with directory depth 2, is not processed before the other files in the directory the next time it is run.