src-cli
src-cli copied to clipboard
src ext delete should take extension ID, not GraphQL ID (which is confusing)
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"
]
}
]
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.
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?
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?
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.
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
I can take it on.
Just met this too.
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.