dpc10ster / RJafroc

Artificial Intelligence: Evaluating AI, optimizing AI
19 stars 8 forks source link

Github actions `pkgdown` workflow fails to build file `NEWS.md` #74

Closed dpc10ster closed 2 years ago

dpc10ster commented 2 years ago

The build fails only if the file NEWS.md is present in the project root.

As a temporary fix I have moved it to directory inst and renamed it to my_NEWS.md (if the renamed file is in the project root then I get the same failure as with the original file name).

Of course this means that the Changelog feature is no longer present in the project website.

pwep commented 2 years ago

Looking at the action's log, there is a warning being generated when reading the news file (usually NEWS.md). I can replicate the error locally by calling pkgdown::build_news(). A total of 14 warnings are generated. I have pinned it down to the line below. https://github.com/dpc10ster/RJafroc/blob/7e82dedd02a53c7af74154fa16709d74ea08081c/inst/my_NEWS.md?plain=1#L76 The ? followed by some characters, wrapped in the inline code ticks, seems to generate the warnings. Replace the ? with a * and the warnings no longer occur. The * would be the correct character to use to match the intent of the sentence. The warnings feel like they have been introduced by a markdown parser we depend on, so outside of our control.

dpc10ster commented 2 years ago

Thank you! That fixed it. Dev

On Fri, Jun 10, 2022 at 5:50 PM Peter Phillips @.***> wrote:

Looking at the action's log, there is a warning being generated when reading the news file (usually NEWS.md). I can replicate the error locally by calling pkgdown::build_news(). A total of 14 warnings are generated. I have pinned it down to the line below.

https://github.com/dpc10ster/RJafroc/blob/7e82dedd02a53c7af74154fa16709d74ea08081c/inst/my_NEWS.md?plain=1#L76 The ? followed by some characters, wrapped in the inline code ticks, seems to generate the warnings. Replace the ? with a and the warnings no longer occur. The would be the correct character to use to match the intent of the sentence. The warnings feel like they have been introduced by a markdown parser we depend on, so outside of our control.

— Reply to this email directly, view it on GitHub https://github.com/dpc10ster/RJafroc/issues/74#issuecomment-1152786449, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH4NJRCZ3KA47CMHIQAUCODVOPBCJANCNFSM5YEOILJA . You are receiving this because you were assigned.Message ID: @.***>

dpc10ster commented 2 years ago

The error message is:

In if (has_name(index, topic)) { ... :
  the condition has length > 1 and only the first element will be used

repeated 14 times.

How did you get to line 76 as the cause for these warnings? Just curious.

pwep commented 2 years ago

As you identified, the action failure was caused by the NEWS.md file. After looking at the action log, I made a simple NEWS.md file and started adding news sections until I got the warnings, and eventually was able to isolate the line. The ? and . characters were a likely cause of the warnings. The inline code block is not being executed, just rendered in HTML in the code style, and these were only warnings, not full errors. Duplicate line 76 and you get 28 warnings. Thank goodness pkgdown::build_news() was available, as it allowed me to focus on building just the news file rather than the whole package.

dpc10ster commented 2 years ago

Hi Peter; Thanks for the explanation; my mistake was not using pkgdown to locally reproduce the problem;

On Sat, Jun 11, 2022 at 3:20 PM Peter Phillips @.***> wrote:

As you identified, the action failure was caused by the NEWS.md file. After looking at the action log, I made a simple NEWS.md file and started adding news sections until I got the warnings, and eventually was able to isolate the line. The ? and . characters were a likely cause of the warnings. The inline code block is not being executed, just rendered in HTML in the code style, and these were only warnings, not full errors. Duplicate line 76 and you get 28 warnings. Thank goodness pkgdown::build_news() was available, as it allowed me to focus on building just the news file rather than the whole package.

— Reply to this email directly, view it on GitHub https://github.com/dpc10ster/RJafroc/issues/74#issuecomment-1152985027, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH4NJRHYA4ZNJTQJYZMTA6DVOTRJBANCNFSM5YEOILJA . You are receiving this because you were assigned.Message ID: @.***>