gohugoio / hugoThemesSiteBuilder

The source for https://themes.gohugo.io
https://themes.gohugo.io
Apache License 2.0
214 stars 194 forks source link

How to handle missing Git refs #364

Closed bep closed 10 months ago

bep commented 11 months ago

I'm about to fix/get the build running, but thought I would open this issue to discuss how we handle this in the future.

In my head there are 2 common error situation.

  1. invalid version: unknown revision
  2. checksum mismatch for the go.sum file.

For the two variants above:

  1. Is most likely unversioned theme (we use the last commit ref) where the theme owner have done a git push -f so the ref is gone. It could also be a versioned theme where the theme author has deleted the tag on GitHub.
  2. This is most likely a versioned theme where a theme author has replaced the tag on GitHub.

Assuming this is most likely the theme authors' mistake, we could just remove the problematic themes, but the pragmatic approach is probably:

  1. Remove the theme from build/go.mod and commit. It will be reconstructed from themes.txt.
  2. Remove the build/go.sum and commit it.

/cc @hugo-sid

hugo-sid commented 11 months ago

Assuming this is most likely the theme authors' mistake, we could just remove the problematic themes, but the pragmatic approach is probably:

  1. Remove the theme from build/go.mod and commit. It will be reconstructed from themes.txt.
  2. Remove the build/go.sum and commit it.

I agree that this is a better way to handle things. Removing the theme from build/go.mod & build/go.sum is not sufficient. In the past, when dealing with CI problems, I had to remove the theme from these files as well:

References:

bep commented 11 months ago

Removing the theme from build/go.mod & build/go.sum is not sufficient. In the past, when dealing with CI problems, I had to remove the theme from these files as well:

Note that I'm talking about the 2 specific error cases above, not "every CI problem".

hugo-sid commented 11 months ago

Note that I'm talking about the 2 specific error cases above, not "every CI problem".

I see.

One commendable action you've taken is removal of the cache step in the GitHub action workflow.

bep commented 10 months ago

I'm working on fixing the build / making it more robust now.

bep commented 10 months ago

I have adjusted the builds to improve this, esp. see my comment in f844650f2793dbdac9116286da7684a5a780b84d I'm closing this for now.