-
Couldn't load subscription status.
- Fork 2
Execution API detection #145
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
Conversation
This reverts commit a6cef8b.
…port server version info on error
| const response = await client.get<CapabilitiesResponse>(`${apiLocation}/capabilities`); | ||
| return response.Capabilities.filter((c) => c === capabilityName).length === 1 | ||
| ? null | ||
| : `The Octopus instance does not support ${capabilityName}, you may need to upgrade it to get access to the feature you are trying to use.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extend this message to include a link/callout to support, and the same for the messages below
| } | ||
|
|
||
| async create(command: CreateReleaseCommandV1): Promise<CreateReleaseResponseV1> { | ||
| const capabilityError = await checkForCapability(this.client, "CreateReleaseCommandV1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can link between the command that we are creating and the capability string? Perhaps the capability id could go in the Command object itself.
Just a thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'd love is for TS to support some equivalent to typeof(CreateReleaseCommandV1).Name that we have in C#, but it doesn't have such support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that was the sort of thing I had in mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, just a couple of thoughts around magic strings and customer feedback messaging
This PR adds calls to the Capabilities API, so the users will get clearer error information if they're using something that relies on the Executions API but their Octopus instance is too old.
The
checkForCapabilitymethod does not throw on purpose, that's the caller's choice. In the current calls, they do happen to all be errors that will throw, but in a number of cases for future use this method can be used to feature sniff with fallback behaviour.