Skip to content

Unlock Psych dependency#9135

Merged
jekyllbot merged 4 commits intojekyll:masterfrom
yboulkaid:update-psych
Sep 29, 2022
Merged

Unlock Psych dependency#9135
jekyllbot merged 4 commits intojekyll:masterfrom
yboulkaid:update-psych

Conversation

@yboulkaid
Copy link
Copy Markdown
Contributor

@yboulkaid yboulkaid commented Sep 28, 2022

Summary

In #8918 we locked the psych
dependency because the new version shipped with ruby 3.1 was breaking
our cucumber-based tests.

This PR allows for us to relax that dependency by making our tests use
SafeYAML instead of YAML.

Context

We are using YAML.load, which works in psych 3.x but raises a
Psych::DisallowedClass when trying to parse a date with psych v4.x.

This PR fixes this by making our tests use SafeYAML instead of YAML,
as we are doing in the rest of the codebase.

Closes #9122.

@yboulkaid yboulkaid marked this pull request as ready for review September 28, 2022 07:06
@ashmaroli
Copy link
Copy Markdown
Member

At the outset, our test suite only flagged the use of YAML.load in our Cucumber helper, but what if allowing psych 4 breaks some plugins downstream?
The Jekyll Core uses SafeYAML extensively. So what if we were to switch the use of YAML.load with its SafeYAML counterpart?

@yboulkaid
Copy link
Copy Markdown
Contributor Author

I like the idea of using SafeYAML everywhere, I'll try to have a patch out later today 👍

@fauno
Copy link
Copy Markdown
Member

fauno commented Sep 28, 2022

Hi, could this be related to #8772 ?

@yboulkaid
Copy link
Copy Markdown
Contributor Author

I have now updated the PR to use SafeYAML rather than depend on psych 👍

@fauno I would say that this is not directly related to #8772 as it is smaller in scope. It does however affect it as it introduces a new place where SafeYAML has to be swapped for psych's YAML.

@yboulkaid
Copy link
Copy Markdown
Contributor Author

CI is failing on ruby 2.6 Windows with:

Failure:
TestSite#test_: configuring sites should configure cache_dir.  [C:/projects/jekyll/test/test_site.rb:81]
Minitest::Assertion: Expected false to be truthy.
Skipped:

I can't tell if this is a flake or if it's related to this though? 🤔

Copy link
Copy Markdown
Member

@ashmaroli ashmaroli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@ashmaroli
Copy link
Copy Markdown
Member

Thanks @yboulkaid
@jekyllbot: merge +fix

@jekyllbot jekyllbot merged commit 7a70a3a into jekyll:master Sep 29, 2022
jekyllbot added a commit that referenced this pull request Sep 29, 2022
github-actions bot pushed a commit that referenced this pull request Sep 29, 2022
Youssef Boulkaid: Unlock Psych dependency (#9135)

Merge pull request 9135
@jekyll jekyll locked and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update dependency constraint to allow for psych v4.0.5

4 participants