Skip to content

Add hugo flags env to Makefile targets - #59083

Open
mblag wants to merge 5 commits into
kubernetes:mainfrom
mblag:hugo-check-node-update
Open

mblag wants to merge 5 commits into
kubernetes:mainfrom
mblag:hugo-check-node-update

Conversation

@mblag

@mblag mblag commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

During CI deploy preview step and only during Hugo configuration or version updates run the best practices command --panicOnWarning

First CI run failed as expected as changes in the netlify.toml (add the panicOnWarning flag) where present and an ES localization issue (#59080) produces WARN for the hugo:

10:00:02 PM: build.command from netlify.toml                               
10:00:02 PM: Configuration or Node dependencies changed! Running strict --panicOnWarning check...
10:00:02 PM: hugo --panicOnWarning --cleanDestinationDir --enableGitInfo --buildDrafts --buildFuture --environment preview -b https://deploy-preview-59083--kubernetes-io-main-staging.netlify.app
10:00:03 PM: Start building sites …
10:00:03 PM: hugo v0.144.2-098c68fd18f48031a7145bedab30cbaede48858f+extended linux/amd64 BuildDate=2025-02-19T12:17:04Z VendorInfo=gohugoio
10:00:52 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
10:00:51 PM: WARN  Failed to get translated string for language "es" and ID "community_introduce": template: :1:652: executing "" at <.link>: can't evaluate field link in type page.PageWithContext
10:00:52 PM: Total in 49174 ms
10:00:52 PM: make: *** [Makefile:61: deploy-preview] Error 1
10:00:52 PM: ​

Second CI run succeeded after cherry picking the fix for the ES localization issue (#59080):

10:20:06 PM: ❯ Context
10:20:06 PM:   deploy-preview
10:20:06 PM: ​
10:20:06 PM: build.command from netlify.toml                               
10:20:06 PM: ────────────────────────────────────────────────────────────────
10:20:06 PM: ​
10:20:06 PM: $     if git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- netlify.toml; then
10:20:06 PM:       echo "No configuration or version updates. Running standard deploy view..."
10:20:06 PM:       git submodule update --init --recursive --depth 1 && make deploy-preview && npx -y pagefind --site public
10:20:06 PM:     else
10:20:06 PM:       echo "Configuration or Node dependencies changed! Running strict --panicOnWarning check..."
10:20:06 PM:       git submodule update --init --recursive --depth 1 && HUGO_FLAGS="--panicOnWarning" make deploy-preview && npx -y pagefind --site public
10:20:06 PM:     fi
10:20:06 PM:   
10:20:06 PM: Configuration or Node dependencies changed! Running strict --panicOnWarning check...
10:20:06 PM: hugo --panicOnWarning --cleanDestinationDir --enableGitInfo --buildDrafts --buildFuture --environment preview -b https://deploy-preview-59083--kubernetes-io-main-staging.netlify.app/
10:20:06 PM: Start building sites …
10:20:06 PM: hugo v0.144.2-098c68fd18f48031a7145bedab30cbaede48858f+extended linux/amd64 BuildDate=2025-02-19T12:17:04Z VendorInfo=gohugoio
10:21:01 PM:                    |  EN  | BN  | ZH-CN | FR  | DE  | HI  | ID  | IT  | JA  | KO  | FA  | PL  | PT-BR | RU  | ES  | UK  | VI

Third CI with standard deploy triggered with empty commit:

10:34:55 PM: build.command from netlify.toml                               
10:34:55 PM: ────────────────────────────────────────────────────────────────
10:34:55 PM: No configuration or version updates. Running standard deploy view...
10:34:55 PM: hugo  --cleanDestinationDir --enableGitInfo --buildDrafts --buildFuture --environment preview -b https://deploy-preview-59083--kubernetes-io-main-staging.netlify.app/

@kubernetes-prow kubernetes-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 5, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tengqm for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Nov 5, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from tengqm November 5, 2026 19:59
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 5, 2026
@kubernetes-prow kubernetes-prow Bot added area/localization General issues or PRs related to localization language/es Issues or PRs related to Spanish language labels Nov 5, 2026
@netlify

netlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

✅ Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 4e7e73f
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/6aef07645994f5f412ed8bf0
😎 Deploy Preview https://deploy-preview-59083--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mblag

mblag commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@Caesarsage wdyt, adding a strict hugo check when making changes to netlify.toml file ? imho it might be quite beneficial, it is how I saw the ES community banner missing. any other files that can be monitored? thanks! :)

@Caesarsage

Copy link
Copy Markdown
Contributor

Thanks @mblag, nice catch on the ES banner!

A few things:

  • Could you drop the NODE_VERSION bump and the ES fix? The ES fix is already in Fix the ES i18n community banner #59080, and a Node version bump should be its own PR.

  • $CACHED_COMMIT_REF points to this PR's previous build, not main. After the first push, later pushes skip the strict check.

  • Other files worth watching: hugo.toml, go.mod/go.sum, package*.json, layouts/ and i18n/.

@Caesarsage

Copy link
Copy Markdown
Contributor

Also I suggest you keep only the $(HUGO_FLAGS) Makefile change and add it to production-build too. Then the Prow job in kubernetes/test-infra#36793 can run the strict check. Prow compares against main, so it doesn't skip pushes, and the preview still works if the strict check fails.

@mblag

mblag commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

thanks, @Caesarsage! I can keep this PR as a test one and open a new one (and tag you there) only with the changes that will go to main. Let me get familiar with the test-infra jobs and I will proceed further with the changes. I might ping you on slack in case I do not see the e2e pipeline as I am not a member of the k8s org, working towards it:)

@lmktfy lmktfy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's more complicated, but the correct place to put that new check is likely to be via Prow and a test job. See kubernetes/test-infra#36793 for an example of what the change might look like.

Comment thread netlify.toml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think that Netlify is the right place to run this kind of check.

@lmktfy

lmktfy commented Nov 7, 2026

Copy link
Copy Markdown
Member

If we have a non-required CI test that reveals whether a PR adds new warnings: great. But, again, more work.

Let's file a new issue. Why? Because issues (not PRs) are where we discuss "what needs fixing?"; PRs are the place to discuss "is this fix the right change to close the issue".
For small changes or where only one approach could work, issues are usually not needed.

@lmktfy

lmktfy commented Nov 7, 2026

Copy link
Copy Markdown
Member

/remove-area localization
/area web-development

@kubernetes-prow kubernetes-prow Bot added area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes and removed area/localization General issues or PRs related to localization labels Nov 7, 2026
@Caesarsage

Copy link
Copy Markdown
Contributor

+1 to filing an issue first. Agreed that Prow is the right place for this. The check can build on kubernetes/test-infra#36793.

@mblag

mblag commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

thanks, @lmktfy @Caesarsage. Tim, you are totally right. Here is the filed issue #59106 (my first one, yey)

@kubernetes-prow kubernetes-prow Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. area/localization General issues or PRs related to localization and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 7, 2026
@mblag mblag changed the title [WIP] Run strict hugo check after configuration update Add hugo flags env to Makefile targets Nov 7, 2026
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/localization General issues or PRs related to localization area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/es Issues or PRs related to Spanish language sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants