Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuelang.org: a page with errors is never "seen" in serve mode #2826

Closed
myitcv opened this issue Feb 15, 2024 · 2 comments
Closed

cuelang.org: a page with errors is never "seen" in serve mode #2826

myitcv opened this issue Feb 15, 2024 · 2 comments

Comments

@myitcv
Copy link
Member

myitcv commented Feb 15, 2024

What page were you looking at?

https://alpha.cuelang.org/

What version of the site were you looking at?

cue-lang/cuelang.org@eb2ecd6

What did you do?

  • Modified content/docs/tutorial/working-with-a-custom-module-registry/en.md to have an error, by duplicating the cue version block (which means the block name is used twice)
  • Ran ./_scripts/serve.bash
  • Observed the error in the output:
** /home/myitcv/dev/cuelang/cuelang.org/content/docs/tutorial/working-with-a-custom-module-registry/en.md: node type "script" declares label "cue version" multiple times:
        /home/myitcv/dev/cuelang/cuelang.org/content/docs/tutorial/working-with-a-custom-module-registry/en.md:55:8
        /home/myitcv/dev/cuelang/cuelang.org/content/docs/tutorial/working-with-a-custom-module-registry/en.md:60:8
  • Fixed the error by deleting the duplicate block.
  • Saved the filed.

What did you expect?

The "watch" in serve mode to see the file, and re-run the preprocessor for that page because the inputs have changed.

What did you see instead?

The preprocessor does not. So I cannot recover from this error situation.

The same situation happens when an error is introduced. The preprocessor for some reason appears to "drop" the watch on the page.

cueckoo pushed a commit to cue-lang/cuelang.org that referenced this issue Feb 17, 2024
Per https://cuelang.org/issue/2826, currently if the serve mode of the
preprocessor sees an error, the preprocessor can never recover from that
error state. Even if an error in a page is fixed, the preprocessor
thinks that there is still an error and hence never transforms the fixed
page, hence the rendered HTML page (via Hugo) never updates.

This CL fixes a bug in the serve mode of the executor that did not reset
the error status after the handling of a watched event (or batch of
events).

Fixes cue-lang/cue#2826.

Preprocessor-No-Write-Cache: true
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I72231fd8df31945465eb81c48060c2612a0aa192
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Feb 18, 2024
Per https://cuelang.org/issue/2826, currently if the serve mode of the
preprocessor sees an error, the preprocessor can never recover from that
error state. Even if an error in a page is fixed, the preprocessor
thinks that there is still an error and hence never transforms the fixed
page, hence the rendered HTML page (via Hugo) never updates.

This CL fixes a bug in the serve mode of the executor that did not reset
the error status after the handling of a watched event (or batch of
events).

Fixes cue-lang/cue#2826.

Preprocessor-No-Write-Cache: true
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I72231fd8df31945465eb81c48060c2612a0aa192
Dispatch-Trailer: {"type":"trybot","CL":1176998,"patchset":1,"ref":"refs/changes/98/1176998/1","targetBranch":"alpha"}
cueckoo pushed a commit to cue-lang/cuelang.org that referenced this issue Feb 20, 2024
Per https://cuelang.org/issue/2826, currently if the serve mode of the
preprocessor sees an error, the preprocessor can never recover from that
error state. Even if an error in a page is fixed, the preprocessor
thinks that there is still an error and hence never transforms the fixed
page, hence the rendered HTML page (via Hugo) never updates.

This CL fixes a bug in the serve mode of the executor that did not reset
the error status after the handling of a watched event (or batch of
events).

Fixes cue-lang/cue#2826.

Preprocessor-No-Write-Cache: true
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I72231fd8df31945465eb81c48060c2612a0aa192
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Feb 20, 2024
Per https://cuelang.org/issue/2826, currently if the serve mode of the
preprocessor sees an error, the preprocessor can never recover from that
error state. Even if an error in a page is fixed, the preprocessor
thinks that there is still an error and hence never transforms the fixed
page, hence the rendered HTML page (via Hugo) never updates.

This CL fixes a bug in the serve mode of the executor that did not reset
the error status after the handling of a watched event (or batch of
events).

Fixes cue-lang/cue#2826.

Preprocessor-No-Write-Cache: true
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I72231fd8df31945465eb81c48060c2612a0aa192
Dispatch-Trailer: {"type":"trybot","CL":1176998,"patchset":2,"ref":"refs/changes/98/1176998/2","targetBranch":"alpha"}
cueckoo pushed a commit to cue-lang/cuelang.org that referenced this issue Feb 20, 2024
Per https://cuelang.org/issue/2826, currently if the serve mode of the
preprocessor sees an error, the preprocessor can never recover from that
error state. Even if an error in a page is fixed, the preprocessor
thinks that there is still an error and hence never transforms the fixed
page, hence the rendered HTML page (via Hugo) never updates.

This CL fixes a bug in the serve mode of the executor that did not reset
the error status after the handling of a watched event (or batch of
events).

Fixes cue-lang/cue#2826.

Preprocessor-No-Write-Cache: true
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I72231fd8df31945465eb81c48060c2612a0aa192
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1176998
Reviewed-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
TryBot-Result: CUEcueckoo <cueckoo@gmail.com>
@jpluscplusm
Copy link
Collaborator

Merging https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1176998 only solved half the problem - the preprocessor. Hugo still can't recover after a failure processing its directives.

Steps to reproduce:

  • run _scripts/serve.bash at a known-good site state
  • break hugo with an incorrect directive. e.g. Add {{< info to any page
  • observe the Hugo error page served at http://localhost:1313
  • unbreak the page and observe the preprocessor write the now-correct page into the hugo hierarchy
  • refresh http://localhost:1313
  • observe the Hugo error page still being served

I'm not sure if this is an actual Hugo problem, or if the way we're dropping the "fixed" files into the hugo directory isn't triggering a full re-examination of the (now fixed) error state; or something else.

@myitcv myitcv changed the title alpha.cuelang.org: a page with errors is never "seen" in serve mode cuelang.org: a page with errors is never "seen" in serve mode May 1, 2024
@myitcv
Copy link
Member Author

myitcv commented May 1, 2024

I've captured the hugo problem in #3109

@myitcv myitcv closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants