Skip to content

Emit compile-time deprecation warning for legacy rate-limit frontmatter#35774

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/deep-report-user-facing-warning
Closed

Emit compile-time deprecation warning for legacy rate-limit frontmatter#35774
Copilot wants to merge 3 commits into
mainfrom
copilot/deep-report-user-facing-warning

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

rate-limit is a deprecated alias of user-rate-limit, but compilation only logged this at debug level, so users had no migration signal. This change surfaces a user-facing compiler warning while keeping legacy behavior non-breaking.

  • Compiler deprecation signal (user-facing)

    • In extractRateLimitConfig, when the legacy rate-limit key is used, emit a warning to stderr via console.FormatWarningMessage.
    • Warning text explicitly points authors to user-rate-limit.
    • Warning remains non-fatal (compilation still proceeds).
  • Warning accounting

    • Increment compiler warning count for legacy-key usage to align with other compile-time warning paths.
  • Integration warning coverage

    • Extend rate_limit_experimental_warning_test.go with a legacy rate-limit case asserting:
      • deprecation warning is emitted
      • replacement key (user-rate-limit) is named
      • non-legacy cases do not emit the legacy warning.
if legacyKey {
	fmt.Fprintln(os.Stderr, console.FormatWarningMessage(
		"'rate-limit' is deprecated. Use 'user-rate-limit' instead."))
	c.IncrementWarningCount()
}

Copilot AI and others added 2 commits May 29, 2026 19:40
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Emit user-facing compile warning for deprecated rate-limit field Emit compile-time deprecation warning for legacy rate-limit frontmatter May 29, 2026
Copilot AI requested a review from gh-aw-bot May 29, 2026 19:46
@pelikhan pelikhan closed this May 29, 2026
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.

[deep-report] Emit a user-facing compile warning for the legacy rate-limit field

3 participants