-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix PR Build Failures Due to Hugo Version Mismatch #1495
Open
ibrahimjaved12
wants to merge
10
commits into
main
Choose a base branch
from
fix-hugo-resource-Err-removal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Netlify Deployments: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Device | URL |
---|---|
mobile | https://ocw-hugo-themes-www-pr-1495--ocw-next.netlify.app/ |
Device | URL |
---|---|
mobile | https://ocw-hugo-themes-www-pr-1495--ocw-next.netlify.app/search/ |
Device | URL |
---|---|
mobile | https://ocw-hugo-themes-course-v2-pr-1495--ocw-next.netlify.app/ |
Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead
ibrahimjaved12
changed the title
Fix PR build failure caused by Hugo resource.Err removal in 0.141.0
Fix PR build failure caused by Hugo resource.Err removal
Jan 21, 2025
ibrahimjaved12
force-pushed
the
fix-hugo-resource-Err-removal
branch
from
January 22, 2025 07:01
bd56a76
to
082fbc3
Compare
ibrahimjaved12
changed the title
Fix PR build failure caused by Hugo resource.Err removal
Fix PR build failure caused by resource.Err removal in latest version
Jan 22, 2025
ibrahimjaved12
changed the title
Fix PR build failure caused by resource.Err removal in latest version
Fix PR Build Failures Due to Hugo Version Mismatch
Jan 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/6548
Description (What does it do?)
Hugo's latest version is
0.141.0
, whereas:0.112.7
.latest
version.Which means, if
latest
version has any breaking changes, they would have an effect on our PR checks. Which is why our build is currently failing with the errors:execute of template failed: template: partials/featured_course_cards.html:27:24: executing "partials/featured_course_cards.html" at <.Err>: can't evaluate field Err in type resource.Resource: Resource.Err was removed in Hugo v0.141.0 and replaced with a new try keyword, see
We could fix them by using
try
keyword, but we would still have a version mismatch between what we use for production, and what we use for these tests.Apart from this, there are more breaking changes in the latest version so we would have to incrementally upgrade Hugo to get there.
This PR upgrades Hugo version from
0.112.7
to0.115.4
.Additional Context - Why
0.115.4
?From
0.115.4
to0.117.0
it seems there are some internal changes due to which our jest tests became super slow.FAIL tests-e2e/jest/build-failures.test.ts (24.125 s)
The 3 tests fail because of timeout. After removing the timeout, they pass at 152 seconds:
For
0.117.0
, the release notes indicate:Particularly, the second one seems related, where it adds exponential backoff for retry for HTTP errors. The tests that are taking much longer time actually have
504
in them. From the code in Hugo PR for0.117.0
:temporaryHTTPCodes := []int{408, 429, 500, 502, 503, 504}
So for now, I'm upgrading to
0.115.4
to fix the breaking build check on our PRs. But I shared the R&D because it may be helpful for next upgrade.How can this be tested?
Run
yarn install
Run
yarn start course
andyarn start www
and make sure everything is working fine.For detailed testing, you can follow this PR instructions: #1167