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

Return of the YAML aliases :) #1677

Merged
merged 4 commits into from Dec 8, 2023

Conversation

zor-el
Copy link
Contributor

@zor-el zor-el commented Dec 2, 2023

Hi @denisdefreyne, it's been a long time since we've last been in touch. How are you? :)

Detailed description

This is the fix for #1676. See details there.

FYI, the last commit is solely a refactoring to establish single responsibility for YAML parser invocations, while the prior commits fix the invocations in the multiple places where they occurred.

3 commits:

  • commit 1: Fix YAML invocation for nanoc.yaml
  • commit 2: Fix YAML invocations in other places
  • commit 3: Factor out business rules for YAML invocation
    => single responsibility, less verbose YAML access, centrally testable (test included)

(Fix for configuration-breaking change)

Fixes breaking changes in YAML processing, [Issue nanoc#1676]

[Issue nanoc#1676]: nanoc#1676

Broken upstream with Psych 4 (https://bugs.ruby-lang.org/issues/17866) and reinforced in Nanoc with [PR 1583](nanoc#1583), commit `8882be18101315c7c65ee88dded328d3d44b30db`.

#### Details

Psych 4 has introduced a [severe breaking change](https://bugs.ruby-lang.org/issues/17866) - YAML anchors and aliases are no longer recognized by default.

Nanoc enforces Psych >= 4 since [PR 1583](nanoc#1583), commit `8882be18101315c7c65ee88dded328d3d44b30db`. This prevents `gem 'psych', '<4'` as first aid in one's own Gemfile.

Net result: All `nanoc.yaml` configurations and content front matters that make use of anchors are since broken.
Reason: Single responsibility.
@zor-el zor-el marked this pull request as ready for review December 2, 2023 06:10
@zor-el zor-el changed the title Bring back yaml aliases The return of the yaml aliases :) Dec 2, 2023
@zor-el zor-el changed the title The return of the yaml aliases :) The return of the YAML aliases :) Dec 2, 2023
@zor-el zor-el changed the title The return of the YAML aliases :) Return of the YAML aliases :) Dec 2, 2023
The GitHub CI pipeline errored out unexpectedly, even though
I did follow the [official code contribution workflow]
(including `bundle exec rake test`).

The error seems to indicate (somewhat convolutedly)
the need to add the new module to nanoc-core.manifest.

I'm giving this a try.

[nanoc#375]: https://github.com/nanoc/nanoc/actions/runs/7068481942
[official code contribution workflow]: https://nanoc.app/contributing/
@zor-el
Copy link
Contributor Author

zor-el commented Dec 4, 2023

@denisdefreyne, hey, I've updated the PR in an attempt to fix the CI issue. Would you like to give it another nudge?

@denisdefreyne
Copy link
Member

@zor-el Looks like there are some Rubocop changes that break main. Will fix those soon.

@denisdefreyne denisdefreyne merged commit e9100b5 into nanoc:main Dec 8, 2023
3 of 4 checks passed
@denisdefreyne
Copy link
Member

@zor-el Thank you!

@denisdefreyne
Copy link
Member

@zor-el This is released as 4.12.19 today. I credited you as zor-el; lemme know if you’d like to change it!

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.

None yet

2 participants