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

Adjust deprecation timing and message #13333

Closed
jmooring opened this issue Feb 2, 2025 · 4 comments · Fixed by #13335
Closed

Adjust deprecation timing and message #13333

jmooring opened this issue Feb 2, 2025 · 4 comments · Fixed by #13335

Comments

@jmooring
Copy link
Member

jmooring commented Feb 2, 2025

I know this has been discussed before, but here's my thinking:

  1. I suspect very few people, if any, use the --logLevel info flag to check for new deprecations. So we're effectively giving users a "6 releases from now" notice instead of a "12 releases from now" notice. I propose to start warning immediately, not after 6 releases.

  2. After 12 releases we're telling people we're going to remove the feature, but from their perspective it has already been removed. I propose to adjust the message as shown below.

diff --git a/common/hugo/hugo.go b/common/hugo/hugo.go
index eecf4bc2f..a1fe2b875 100644
--- a/common/hugo/hugo.go
+++ b/common/hugo/hugo.go
@@ -418,7 +418,7 @@ func Deprecate(item, alternative string, version string) {
 func DeprecateLevel(item, alternative, version string, level logg.Level) {
 	var msg string
 	if level == logg.LevelError {
-		msg = fmt.Sprintf("%s was deprecated in Hugo %s and will be removed in Hugo %s. %s", item, version, CurrentVersion.Next().ReleaseVersion(), alternative)
+		msg = fmt.Sprintf("%s was deprecated in Hugo %s and subsequently removed. %s", item, version, alternative)
 	} else {
 		msg = fmt.Sprintf("%s was deprecated in Hugo %s and will be removed in a future release. %s", item, version, alternative)
 	}
@@ -437,10 +437,8 @@ func deprecationLogLevelFromVersion(ver string) logg.Level {
 	case minorDiff >= 12:
 		// Start failing the build after about a year.
 		return logg.LevelError
-	case minorDiff >= 6:
-		// Start printing warnings after about six months.
-		return logg.LevelWarn
 	default:
-		return logg.LevelInfo
+		// Start warning immediately.
+		return logg.LevelWarn
 	}
 }
@jmooring
Copy link
Member Author

jmooring commented Feb 2, 2025

Or... info message for 1 release, warn for 12 releases after that, error after that.

@bep
Copy link
Member

bep commented Feb 2, 2025

In my head, the "info grace period" is mainly targeted at theme authors (like myself). I may not read the INFO output, but I do read release notes and this gives me a chance to adjust my themes before people start creating issues on my themes.

We can certainly adjust the timing, but I suggest we find some middle ground, e.g. info for 3 releases then ...

@bep bep removed the NeedsTriage label Feb 2, 2025
@jmooring
Copy link
Member Author

jmooring commented Feb 2, 2025

OK, info for 3, warning for 12 after that, then error. The main thing is to give 12 months of highly-visible notice (i.e., WARNING). If you approve I'll submit changes.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants