jenkins-infra / jenkins.io

A static site for the Jenkins automation server
https://jenkins.io
Other
322 stars 1.23k forks source link

Ruby update broke date values in Awestruct front matter #6006

Closed daniel-beck closed 1 year ago

daniel-beck commented 1 year ago

Git-bisecting shows that https://github.com/jenkins-infra/jenkins.io/pull/5936 broke date values in Awestruct front matter, causing this error in make run for me locally:

Generating site: http://localhost:4242/
could not parse /path/to/file.html.haml
While processing file 
An error occurred: Tried to load unspecified class: Date
/usr/local/lib/ruby/3.2.0/psych/class_loader.rb:99:in `find'
/usr/local/lib/ruby/3.2.0/psych/class_loader.rb:28:in `load'
(eval):2:in `date'
/usr/local/lib/ruby/3.2.0/psych/scalar_scanner.rb:66:in `tokenize'
/usr/local/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:65:in `deserialize'

Investigation identified the culprit as a file with a date in front matter. Reproduce by creating file.html.haml with these contents (minimal example):

---
layout: developerbook
title: Whatever
publication_date: 2023-01-26
---

%p
  = page.publication_date

Screenshots

$ git bisect log
git bisect start
# bad: [2e6969561ba632c14a5c1a35bcc67cbe8a0a57cc] Edit Alternative jenkins.io build tool doc for GSoC 2023 (#5998)
git bisect bad 2e6969561ba632c14a5c1a35bcc67cbe8a0a57cc
# good: [fabbe773211e734636df6118ba5ce6ec99b8438c] Prevent absolute links from adoc to www.jenkins.io and jenkins.io (#5899)
git bisect good fabbe773211e734636df6118ba5ce6ec99b8438c
# bad: [0a7b884ed287b6bdb0ff7bb2748374fb7bb628d9] Update dependency webrick to '~> 1.8.0' (#5971)
git bisect bad 0a7b884ed287b6bdb0ff7bb2748374fb7bb628d9
# good: [26a3bbd59b6c970c5dd9ce5d15b45b36e59c7797] Update alternative-jenkinsio-build-tool doc to use exclusively Antora (#5955)
git bisect good 26a3bbd59b6c970c5dd9ce5d15b45b36e59c7797
# bad: [4e605acfe29299feaddd3feebc9c553df2983cea] Update haml and tilt (#5969)
git bisect bad 4e605acfe29299feaddd3feebc9c553df2983cea
# bad: [2ab1a016d21cb7cb02740e267b68e28cd3cd6bbc] [GSoC] fix project size of "exponential" project idea (#5963)
git bisect bad 2ab1a016d21cb7cb02740e267b68e28cd3cd6bbc
# good: [6d5a84e7f0f1539ab6b8301a83ddbae101240601] [GSoC] Promote Plugin Health Score UI project idea to draft (#5959)
git bisect good 6d5a84e7f0f1539ab6b8301a83ddbae101240601
# bad: [bc498dc62bbbbe2f3dd0df4c80fa16ec133ff75a] Use Ruby 3.2.0 (#5936)
git bisect bad bc498dc62bbbbe2f3dd0df4c80fa16ec133ff75a
# good: [b82267b037d674b2f58e80fe4c7a75c9ba217c82] Update dependency anchor-js to v5 (#5946)
git bisect good b82267b037d674b2f58e80fe4c7a75c9ba217c82
# first bad commit: [bc498dc62bbbbe2f3dd0df4c80fa16ec133ff75a] Use Ruby 3.2.0 (#5936)

Possible Solution

Revert the update.

NotMyFault commented 1 year ago

I'm unable to replicate that locally, make run generates the website perfectly fine for me without named error 🤔

daniel-beck commented 1 year ago

@NotMyFault You need to create a file as described. None exists by default. (I usually have some unpublished experiments around locally, and those broke the build for me.)

MarkEWaite commented 1 year ago

@zbynek would you be willing to investigate this?

zbynek commented 1 year ago

@daniel-beck please try with new Awestruct (see https://github.com/jenkins-infra/jenkins.io/pull/6011 )