Skip to content

feat(ruby): mark deprecated elements with YARD tags and opt-in warnings - #8477

Merged
Vincent Biret (baywet) merged 4 commits into
microsoft:mainfrom
andreaTP:feat/ruby-deprecation-support
Oct 27, 2026
Merged

Vincent Biret (baywet) merged 4 commits into
microsoft:mainfrom
andreaTP:feat/ruby-deprecation-support

Conversation

@andreaTP

@andreaTP Andrea Peruffo (andreaTP) commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes microsoft/kiota-ruby#64. Builds on #8476.

Deprecated operations, paths, models, enums, properties and parameters get a YARD @deprecated tag with the description's text, date, removal date and version. Calling a deprecated operation or path also calls ::Kernel.warn(..., category: :deprecated), which stays silent unless the program enables Warning[:deprecated], like Ruby's own deprecations.

On GitHub's description (38 deprecated operations) this gives 159 tags and 88 warnings, RuboCop clean; client.classrooms warns only when enabled. A Ruby IT spec checks that a deprecated path warns only when enabled.

@andreaTP
Andrea Peruffo (andreaTP) requested a review from a team as a code owner October 27, 2026 12:53
Copilot AI balanced review requested due to automatic review settings October 27, 2026 12:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unqualified warning calls can invoke generated warn accessors and raise ArgumentError even when deprecation warnings are disabled.

1 open issue
What changed in this PR

Adds deprecation documentation and opt-in runtime warnings to generated Ruby SDKs. Also corrects navigation accessors to inherit deprecation metadata from their destination path.

Changes:

  • Adds YARD deprecation tags and parameter notes using shared message formatting.
  • Emits categorized warnings for deprecated calls while keeping request generators quiet.
  • Adds writer tests, navigation metadata coverage, and a Ruby integration test.
File Description
tests/​Kiota.Builder.Tests/​Writers/​Ruby/​CodePropertyWriterTests.cs Tests property tags and navigation warnings.
tests/​Kiota.Builder.Tests/​Writers/​Ruby/​CodeMethodWriterTests.cs Tests warning formatting, escaping, and parameter notes.
tests/​Kiota.Builder.Tests/​Writers/​Ruby/​CodeEnumWriterTests.cs Tests enum deprecation tags.
tests/​Kiota.Builder.Tests/​Writers/​Ruby/​CodeClassDeclarationWriterTests.cs Tests class deprecation tags.
tests/​Kiota.Builder.Tests/​KiotaBuilderTests.cs Tests destination-path deprecation metadata.
tests/​Kiota.Builder.IntegrationTests/​GeneratesUritemplateHints.yaml Adds deprecated path and query parameter fixtures.
src/​Kiota.Builder/​Writers/​Ruby/​RubyConventionService.cs Centralizes deprecation messages, tags, and warnings.
src/​Kiota.Builder/​Writers/​Ruby/​CodePropertyWriter.cs Emits property tags and navigation warnings.
src/​Kiota.Builder/​Writers/​Ruby/​CodeMethodWriter.cs Emits method warnings, tags, and parameter notes.
src/​Kiota.Builder/​Writers/​Ruby/​CodeEnumWriter.cs Emits enum deprecation tags.
src/​Kiota.Builder/​Writers/​Ruby/​CodeClassDeclarationWriter.cs Emits class deprecation tags.
src/​Kiota.Builder/​KiotaBuilder.cs Takes navigation deprecation metadata from the child path.
it/​ruby/​spec/​query-params/​integration_test_query_params.rb Checks warning opt-in behavior and caller location.
CHANGELOG.md Documents Ruby deprecation support and the navigation correction.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 27, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Runtime deprecation warnings display XML entities instead of the original schema text.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Decode XML-escaped deprecation text before Ruby escaping

src/​Kiota.Builder/​Writers/​Ruby/​RubyConventionService.cs:217

ToDeprecationInformation() XML-escapes schema descriptions, so Use "new-api" instead is printed as Use "new-api" instead when deprecation warnings are enabled. Decode the message before Ruby-literal escaping so warnings display the original text. Add a regression case using schema-derived, XML-escaped deprecation text.

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 27, 2026 16:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

Static review found no unresolved blocking issues, and focused regression coverage addresses metadata propagation, warning escaping, and opt-in behavior.

No open issues 🎉

Review effort: Balanced

@baywet
Vincent Biret (baywet) added this pull request to the merge queue Oct 27, 2026
Merged via the queue into microsoft:main with commit d09f697 Oct 27, 2026
338 checks passed
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.

generation - add deprecation support to Ruby

3 participants