Skip to content

Add deprecation warning to AutoRest CLI banner#5177

Merged
timotheeguerin merged 6 commits intomainfrom
copilot/add-deprecation-warning-logging
Feb 27, 2026
Merged

Add deprecation warning to AutoRest CLI banner#5177
timotheeguerin merged 6 commits intomainfrom
copilot/add-deprecation-warning-logging

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 25, 2026

AutoRest is being retired on July 1, 2026. This adds a visible deprecation warning to the CLI banner to notify users and direct them to migrate to TypeSpec.

Changes

  • packages/apps/autorest/src/app.ts: Added console.warn with chalk.yellow.bold styling at the end of logBanner():

    ⚠️ AutoRest is deprecated and will be retired on July 1, 2026. Please migrate to TypeSpec: https://typespec.io — details: https://github.com/Azure/autorest/issues/5175
    
    • Only shown in regular message-format mode (suppressed in JSON/YAML output, consistent with existing banner behavior)
    • Uses console.warn to write to stderr, keeping the warning semantically correct
    • Rush's test:ci command is already configured with allowWarningsInSuccessfulBuild: true in common/config/rush/command-line.json, so stderr output from the deprecation warning does not cause CI failures
  • common/changes/autorest/add-deprecation-warning_2026-02-27-13-21.json: Added Rush changelog entry (minor bump) for the deprecation warning.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copilot AI changed the title [WIP] Add deprecation warning to CLI in autorest package Add deprecation warning to AutoRest CLI banner Feb 25, 2026
Copilot AI requested a review from timotheeguerin February 25, 2026 17:10
@timotheeguerin
Copy link
Copy Markdown
Member

@copilot the CI is failing in openapi-to-typespec package test. Can you check why, this might be due to rush wrongly assuming stderr means it should fail. We want to keep it in stderr so make sure to update the test

Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 25, 2026

@copilot the CI is failing in openapi-to-typespec package test. Can you check why, this might be due to rush wrongly assuming stderr means it should fail. We want to keep it in stder...

The CI failure was caused by Rush treating any stderr output as a build failure. When generate-typespec.ts spawned autorest with stdio: "inherit", the deprecation warning written via console.warn (stderr) propagated up to Rush.

Fixed in f97dafb by changing stdio: "inherit" to stdio: ["inherit", "inherit", "pipe"] in the spawnSync call, then writing the captured stderr to stdout. This prevents Rush from seeing autorest's stderr as a failure, while still showing the deprecation warning in the output.

…wWarningsInSuccessfulBuild

Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
@azure-pipelines
Copy link
Copy Markdown

You may test this build by running autorest --reset and then either:


Add the following CLI flags
Pacakge Flag Description
@autorest/core --version:https://tinyurl.com/26zcnqo6 For changes to autorest core.
@autorest/modelerfour --use:https://tinyurl.com/2bvnsoyt For changes to modelerfour.

Or with all

autorest --version:https://tinyurl.com/26zcnqo6 --use:https://tinyurl.com/2bvnsoyt

or use the following in your autorest configuration:
# For changes to autorest core
version: "https://tinyurl.com/26zcnqo6"

# For changes to modelerfour
use-extension:
  "@autorest/modelerfour": "https://tinyurl.com/2bvnsoyt"

If this build is good for you, give this comment a thumbs up. (👍) And you should run `autorest --reset` again once you're finished testing to remove it.

Copy link
Copy Markdown
Member

@timotheeguerin timotheeguerin left a comment

Choose a reason for hiding this comment

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

@copilot please add the rush changelog for this

Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot please add the rush changelog for this

Added in d6b8ee8 — created common/changes/autorest/add-deprecation-warning_2026-02-27-13-21.json with a minor bump entry.

Copilot AI requested a review from timotheeguerin February 27, 2026 13:24
@timotheeguerin timotheeguerin marked this pull request as ready for review February 27, 2026 13:25
@azure-pipelines
Copy link
Copy Markdown

You may test this build by running autorest --reset and then either:


Add the following CLI flags
Pacakge Flag Description
@autorest/core --version:https://tinyurl.com/2ybmft4y For changes to autorest core.
@autorest/modelerfour --use:https://tinyurl.com/26b9ujy7 For changes to modelerfour.

Or with all

autorest --version:https://tinyurl.com/2ybmft4y --use:https://tinyurl.com/26b9ujy7

or use the following in your autorest configuration:
# For changes to autorest core
version: "https://tinyurl.com/2ybmft4y"

# For changes to modelerfour
use-extension:
  "@autorest/modelerfour": "https://tinyurl.com/26b9ujy7"

If this build is good for you, give this comment a thumbs up. (👍) And you should run `autorest --reset` again once you're finished testing to remove it.

@timotheeguerin timotheeguerin enabled auto-merge (squash) February 27, 2026 14:37
@timotheeguerin timotheeguerin merged commit 4c2a9d4 into main Feb 27, 2026
11 checks passed
@timotheeguerin timotheeguerin deleted the copilot/add-deprecation-warning-logging branch February 27, 2026 14:37
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.

2 participants