src-cli icon indicating copy to clipboard operation
src-cli copied to clipboard

src ext delete should take extension ID, not GraphQL ID (which is confusing)

Open ryan-blunden opened this issue 5 years ago • 7 comments

For a correctly configured extension, src ext publish succeeds, but src ext delete does not.

The error returned is:

GraphQL errors:
[
  {
    "message": "invalid graphql.ID",
    "path": [
      "extensionRegistry",
      "deleteExtension"
    ]
  }
]

ryan-blunden avatar Oct 19 '18 19:10 ryan-blunden

It does actually work, I assume you are passing the extension ID into src ext delete and that is causing the issue. You should be passing in the GraphQL ID into src ext delete. Consult src ext delete -h for examples.

I agree this is confusing from a user POV though, and I remember raising this with @sqs during code review, but I don't remember the outcome of that conversation.

slimsag avatar Oct 19 '18 19:10 slimsag

I naively expected src ext delete to work the same way as src ext publish (without arguments). I understand why it doesn't work that way now as deleting an extension is not dependent on having the extension code available.

@sqs: What do you think of the suggestion to attempt to lookup the GraphQL ID using the extension name from the package.json in the current directory (presuming its being run in the extension code directory) if no GraphQL id is supplied?

ryan-blunden avatar Oct 19 '18 19:10 ryan-blunden

I think just src ext delete my-extension-id is what users would expect. I find using the ID from package.json dangerous -- what if I run the command in the wrong directory by accident?

slimsag avatar Oct 19 '18 20:10 slimsag

Letting you specify the extension ID (not GraphQL ID) makes sense. I just didn’t have time to add that yet. I think there are some other subcommands that do let you specify it.

sqs avatar Oct 19 '18 20:10 sqs

Great, updated title to make that the action item here. This should be a trivial / straightforward change to make if anyone unexperienced with this codebase wants a good starter issue

slimsag avatar Oct 19 '18 20:10 slimsag

I can take it on.

ryan-blunden avatar Oct 19 '18 21:10 ryan-blunden

Just met this too.

felixfbecker avatar Jan 10 '19 20:01 felixfbecker

Extensions have been deprected, so I am going to close this ticket as part of some backlog grooming. Please reopen if you think we should still care about it.

eseliger avatar Nov 16 '22 14:11 eseliger