Skip to content

refactor: return 410 GONE for deprecated endpoints and restrict old CLI to only codemod run #1565

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

amirabbas-gh
Copy link
Collaborator

📚 Description

This PR introduces a breaking change by:

  • Refactoring deprecated backend endpoints to return a 410 GONE HTTP error.
  • Disabling all old CLI commands except for codemod run.

These changes aim to clean up legacy functionality, reduce confusion for users, and encourage the use of supported interfaces only.

🧪 Test Plan

  • Verified that requests to deprecated endpoints return a 410 GONE response with the correct message.
  • Ran old CLI commands to confirm that only codemod run is allowed.

@amirabbas-gh amirabbas-gh requested a review from mohebifar June 27, 2025 16:49
Copy link

vercel bot commented Jun 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
codemod ⬜️ Ignored (Inspect) Visit Preview Jun 28, 2025 0:49am

Copy link

pkg-pr-new bot commented Jun 27, 2025

Open in StackBlitz

npm i https://pkg.pr.new/codemod@1565

commit: 4ac01c4

Comment on lines 2 to 3
"@codemod-com/backend": major
"codemod": major
Copy link
Member

Choose a reason for hiding this comment

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

We should make this a minor or patch version upgrade. We also don't need to bump backend.

Suggested change
"@codemod-com/backend": major
"codemod": major
"codemod": patch

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mohebifar done

Comment on lines 10 to 15
Reply: ApiResponse<CreateAPIKeyResponse>;
}> = async (request: UserDataPopulatedRequest, reply) => {
return reply.code(410).send({
errorText:
"This endpoint is no longer supported. Please use the new CLI instead.",
error: GONE,
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to block any of the API key endpoints

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mohebifar fixed

Comment on lines 15 to 18
return reply.code(410).send({
errorText:
"This endpoint is no longer supported. Please use the new CLI instead.",
error: GONE,
Copy link
Member

Choose a reason for hiding this comment

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

This is incorrect. We need to prevent publishing "new codemods". But releasing a new version for the "existing codemods" should be allowed.

This is preventing any publish command.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mohebifar done

Comment on lines 11 to 13
return reply.code(410).send({
error:
"This endpoint is no longer supported. Please use the new CLI instead.",
Copy link
Member

Choose a reason for hiding this comment

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

Un-publishing should be allowed even encouraged 😁

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mohebifar done

Comment on lines 23 to 24
import { handleLoginCliCommand } from "#commands/login.js";
import { handleLogoutCliCommand } from "#commands/logout.js";
Copy link
Member

Choose a reason for hiding this comment

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

We still need login, logout, publish, unpublish, whoami, list.

For the publish endpoint, when the endpoints returns GONE code, we'll need to show the deprecation warning

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mohebifar done

@amirabbas-gh amirabbas-gh force-pushed the expired_cli branch 3 times, most recently from 8b10dc0 to a6e1c29 Compare June 28, 2025 00:29
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy