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

Use version appropriate Go module path #1321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

per1234
Copy link

@per1234 per1234 commented Oct 16, 2023

What does this PR change? What problem does it solve?

This theme is packaged as a Go module in order to allow it to be managed as a dependency of Hugo-based websites.

There are two problems that cause this theme to be difficult to use as a Go module dependency:

  • Non-compliant module path
  • Non-compliant tag names

This PR resolves the first of these problems by adding the required /v7 suffix to the Go module path, bringing it into compliance with the Go module framework.

The problem of non-compliant tag names must be fixed by an adjustment to the release procedure rather than a PR. However, this PR lays the groundwork for the use of compliant tag names in future releases.

Using a compliant module path as well as compliant tag names would benefit the users of this theme by allowing them to manage the dependency in a safe and efficient manner.

Module path

A Go module is identified by a "module path". The Go module framework requires that this path have a major version suffix if the project is at a version of 2.0.0 or above:

https://go.dev/ref/mod#major-version-suffixes

This project is at version 7.0, so its Go module path github.com/adityatelange/hugo-PaperMod violates this requirement.

Tag names

Due to the current use of a tag name format that does not meet the the semver-compliant requirement of the Go module framework, the standard procedure for installing the theme in a Hugo-based website as a Go module dependency results in a potentially unstable beta version of the theme from the tip of the theme repository's default branch being installed.

The resulting "pseudo-version" of the dependency (e.g., v0.0.0-20230826144857-efe4cb45161b) makes it so that updates of the dependency cannot be managed automatically via the popular Dependabot service.

Was the change discussed in an issue or in the Discussions before?

No

Additional Context

Following the merge of this pull request, the instructions for installation as a Go module dependency should be updated with the new module path:

 module:
   imports:
-    - path: github.com/adityatelange/hugo-PaperMod
+    - path: github.com/adityatelange/hugo-PaperMod/v7

However, this will not be a breaking change even for those using the previous module path as it will continue to function as before.

PR Checklist

  • This change adds/updates translations and I have used the template present here.
  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended.
  • This change adds a Social Icon which has a permissive license to use it.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

This theme is packaged as a Go module in order to allow it to be managed as a dependency of Hugo-based websites.

Due to the current use of a tag name format that does not meet the the semver-compliant requirement of the Go module
framework, the standard procedure for installing the theme in a Hugo-based website as a Go module dependency results in
the beta version of the theme from the tip of the theme repository's default branch being installed.

The resulting "pseudo-version" of the dependency makes it so that updates of the dependency cannot be managed
automatically via the popular Dependabot service.

A Go module is identified by a "module path". The Go module framework requires that this path have a major version
suffix if the project is at a version of 2.0.0 or above.

This project is at version 7.0, so its Go module path must have a suffix of v7 in order to be compliant with the Go
module framework.

Using a compliant module path as well as compliant tag names benefits the users of this theme by allowing them to manage
the dependency in a safe and efficient manner.
@sonarcloud
Copy link

sonarcloud bot commented Oct 16, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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

1 participant