Skip to content

Conversation

@chaporgin
Copy link
Contributor

@chaporgin chaporgin commented Feb 14, 2025

BACKWARD COMPATIBILITY BREAKING.

According to the docs:

Any command-line argument given that is not demanded or does not have a corresponding description will be reported as an error.
Unrecognized commands will also be reported as errors.

This solves the use cases when a user passes a non-existent parameter and neonctl, continuing to work,

Example:

node dist project update --project-id super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections 1
ERROR: Unknown arguments: project-id, projectId
node dist project update --project-id super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections 1
ERROR: Unknown arguments: project-id, projectId
neonctl project update --project-id super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections 1

Expected:

Error: parameter project-id does not exist

Actual:

ERROR: The request could not be authorized due to an internal error

This fixes that with the following examples:

node dist project update super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections yes
ERROR: Unknown command: yes
node dist project update super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections true
┌─────────────────────┬────────────────────────────────┬──────────────────┬──────────────────────┐
│ Id                  │ Name                           │ Region Id        │ Created At           │
├─────────────────────┼────────────────────────────────┼──────────────────┼──────────────────────┤
│ super-base-59043008 │ Chaporgin-Chaporgin-Chaporgin1 │ aws-eu-central-1 │ 2025-01-22T15:30:36Z │
└─────────────────────┴────────────────────────────────┴──────────────────┴──────────────────────┘

As you can see, it is still not perfect; see the first line: ERROR: Unknown arguments: project-id, projectId

They provide you with a hint, project-id is indeed missing, but for complex misconfigured commands, it will be hard to fix them by looking at the error message ERROR: Unknown arguments: project-id, projectId.

This, being a backward incompatible change, might break workflows for the people.

I have no idea how to release this, because it breaks backward compatibility.

According to the docs:

> Any command-line argument given that is not demanded, or does not have a corresponding description, will be reported as an error.
>  Unrecognized commands will also be reported as errors.

This solves the use-cases when a user passes an non-existent parameter and neonctl, continuing to work,

Example:
```
node dist project update --project-id super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections 1
ERROR: Unknown arguments: project-id, projectId
node dist project update --project-id super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections 1
ERROR: Unknown arguments: project-id, projectId
neonctl project update --project-id super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections 1
```
Expected:
```
Error: parameter project-id does not exist
```

Actual:
```
ERROR: The request could not be authorized due to an internal error
```

This fixes that with the following examples:
```
node dist project update super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections yes
ERROR: Unknown command: yes
node dist project update super-base-59043008 --name "Chaporgin-Chaporgin-Chaporgin1" --block-public-connections true
┌─────────────────────┬────────────────────────────────┬──────────────────┬──────────────────────┐
│ Id                  │ Name                           │ Region Id        │ Created At           │
├─────────────────────┼────────────────────────────────┼──────────────────┼──────────────────────┤
│ super-base-59043008 │ Chaporgin-Chaporgin-Chaporgin1 │ aws-eu-central-1 │ 2025-01-22T15:30:36Z │
└─────────────────────┴────────────────────────────────┴──────────────────┴──────────────────────┘
```
As you can see, still not perfect, see the first line:
ERROR: Unknown arguments: project-id, projectId

they do provide you with a hint, `project-id` is indeed missing, but for a complex misconfigured commands it will be hard to fix them by looking at the error message `ERROR: Unknown arguments: project-id, projectId`.

This, being a backward incompatible change might break workflows for the people.

I have no good idea how to solve it.
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