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

Add pre-commit linting, version checking, and upgrade to Hugo latest (0.126.0) #11872

Merged
merged 1 commit into from
May 20, 2024

Conversation

cnunciato
Copy link
Contributor

@cnunciato cnunciato commented May 20, 2024

Adds the pre-commit hook (to run the linter) that we were using in pulumi-hugo, and also adds a bit of scripting to ensure required tools and versions are installed, warning on differences. Also upgrades to the latest version of Hugo (0.126.0).

Fixes #11855.

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@cnunciato cnunciato marked this pull request as ready for review May 20, 2024 19:08
@pulumi-bot
Copy link
Collaborator

@cnunciato cnunciato requested a review from sean1588 May 20, 2024 19:11
@cnunciato cnunciato requested a review from a team May 20, 2024 19:13
@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

fi
}
check_version "Node.js" "node" "node -v | sed 's/v\([0-9\.]*\).*$/\1/'" "18"
check_version "Hugo" "hugo" "hugo version | sed 's/hugo v\([0-9\.]*\).*$/\1/'" "0.111"
Copy link
Member

@sean1588 sean1588 May 20, 2024

Choose a reason for hiding this comment

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

hmmm, I think this is good, but I do wonder if this is too strict. I think many people are probably going to run into this error, even if they are building fine right now, since there are quite a few other versions other than 0.111.x that work. I think only a handful of us are currently running that specific version. Maybe something more along the lines of a warning message would be better?

Just trying to avoid having to answer a million slack questions about from people having trouble figuring out how to upgrade/downgrade to 0.111.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, agreed. I felt the same so went and looked into understanding what it'd take to address #11855, and it's not too big a deal, looks like. So I'll add that here and turn these into warnings instead.

Copy link
Member

Choose a reason for hiding this comment

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

Oh nice, yeah if it's not too much trouble to do the upgrade that would be awesome!!

@cnunciato cnunciato changed the title Add pre-commit linting, version checking Add pre-commit linting, version checking, and upgrade to Hugo latest (0.126.0) May 20, 2024
@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

"ancestors" (after 1 $ancestors)
)
-}}
{{- if ne $page.File nil -}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out the only pages that have nil File references are the tag and author pages, whose .UniqueID values already resolve to "" (so are currently being filtered out anyway). So keeping only on those pages that contain File references looks like it's fine after all.

@@ -57,7 +57,7 @@ <h2 class="text-4xl md:text-6xl bg-white px-6 mb-0 pb-6">We are Pulumi</h2>
<h3 class="font-medium text-6xl">Our purpose</h3>
<h4 class="font-medium text-4-xl">To democratize the cloud for every engineer.</h4>
<p class="text-gray-700 text-xl mb-10">We help engineers ship infrastructure faster with Infrastructure as Code in general-purpose languages.</p>
<a href="{{ relref . " /leadership" }}" class="btn-primary">Meet our leaders</a>
<a href="{{ relref . "/leadership" }}" class="btn-primary">Meet our leaders</a>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Several of these were warning on make serve, so I went ahead and fixed them.

@pulumi-bot
Copy link
Collaborator

Comment on lines +29 to +31
check_version "Node.js" "node" "node -v | sed 's/v\([0-9\.]*\).*$/\1/'" "18"
check_version "Hugo" "hugo" "hugo version | sed 's/hugo v\([0-9\.]*\).*$/\1/'" "0.126.0"
check_version "Yarn" "yarn" "yarn -v | sed 's/v\([0-9\.]*\).*$/\1/'" "1.22"
Copy link
Contributor Author

@cnunciato cnunciato May 20, 2024

Choose a reason for hiding this comment

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

It'd be awesome if we could specify these versions in one place and use them everywhere. Don't yet have any great ideas for how to do this in a way that's work both locally and in our GHA workflows, though. 🤔

Copy link
Member

Choose a reason for hiding this comment

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

for hugo not sure, but I wouldn't be surprised if there is a way to enforce the node and yarn versions in the package.json file somehow.

@cnunciato cnunciato requested a review from sean1588 May 20, 2024 21:15
@pulumi-bot
Copy link
Collaborator

Copy link
Member

@sean1588 sean1588 left a comment

Choose a reason for hiding this comment

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

thanks @cnunciato!! looks good to me. I also verified the search-index.json file produced in the preview is identical to what is in prod now, so those updates to the index.json file work and didn't regress anything! 🚀

@cnunciato cnunciato merged commit ff10dfc into master May 20, 2024
9 checks passed
@cnunciato cnunciato deleted the cnunciato/linter branch May 20, 2024 21:48
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.

update hugo cli to 0.126.x
3 participants