Skip to content

Fix a random issue with the parse-problem-doc.pl script. - #1492

Merged
pstaabp merged 1 commit into
openwebwork:developfrom
drgrice1:bugfix/pg-docs-workflow
Aug 5, 2026
Merged

Fix a random issue with the parse-problem-doc.pl script.#1492
pstaabp merged 1 commit into
openwebwork:developfrom
drgrice1:bugfix/pg-docs-workflow

Conversation

@drgrice1

@drgrice1 drgrice1 commented Aug 5, 2026

Copy link
Copy Markdown
Member

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.

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.
@drgrice1

drgrice1 commented Aug 5, 2026

Copy link
Copy Markdown
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.

@pstaabp
pstaabp merged commit df0c1b8 into openwebwork:develop Aug 5, 2026
3 checks passed
@drgrice1
drgrice1 deleted the bugfix/pg-docs-workflow branch August 5, 2026 15:28
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.

3 participants