feat: check requests to install an app - #650
Closed
AmyScript wants to merge 1 commit into
Closed
Conversation
Add the app request command to report the status of requests to have an app approved for install, along with who resolved or cancelled each one. Requests are searched on the team of the authenticated account, and an account of a workspace in an organization searches that organization too. Other workspaces of an organization are searched with the --workspace-ids flag. Apps are chosen from a project with a prompt or named by ID with the --app flag so that apps outside a project can be checked. Also fix the help template so hidden subcommands stay out of the subcommand listing of a parent command. Co-authored-by: Cursor <cursoragent@cursor.com>
2 tasks
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #650 +/- ##
==========================================
+ Coverage 72.38% 72.56% +0.17%
==========================================
Files 238 239 +1
Lines 20072 20229 +157
==========================================
+ Hits 14529 14679 +150
- Misses 4275 4276 +1
- Partials 1268 1274 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
slack app requestcommand that checks the status of your most recent request to have an app approved for install.Summary
Installing an app on a team with admin approval required creates an approval request, but there was no way to check what happened to it from the CLI. This adds a
slack app requestcommand (aliased asrequests) that reports the most recent request for the selected app on each team in the token's scope.Requests are searched on the team of the authenticated account. An account of a workspace belonging to an organization also searches that organization, while an account of an organization searches the organization alone. Other workspaces of an organization can be searched with
--workspace-ids, which the API accepts up to 50 of.Apps saved to a project are chosen with the usual prompt. Since that prompt only offers apps recorded in the project, an app can also be named by ID with
--app, which skips both the project requirement and the project app list and gathers a token from the authenticated accounts instead.Output includes the request ID, status, and timestamps, plus the actor that cancelled a request and a hint when the account can install the app without approval. Only team IDs are returned by the endpoint, so a team is titled by name when it happens to be the team of the authenticated account:
A denied request adds the moment it was reviewed:
A cancelled request names the kind of actor that cancelled it, which is an admin, the system, or you:
A pending request where the user can install without approval says so when the account turns out to be able to install the app without approval, because users who can install without approval are still able to create requests:
Design considerations
slack app requestwas chosen as the command because Slack's vocabulary splits by role rather than by feature: the person who wants the app requests it, and the admin approves it. This command runs as the requester, reading their own request status, so it sits on the request half.On the requester side, request also shows up in our CLI and UI:
Preview
No recording yet — the output above is taken from the unit tests rather than a live run.
Testing
--appapp ID path, including a failed team selection and a team without a token.Notes
feature_not_enabledandrestricted_actionerror codes returned by the endpoint, namedErrAPIFeatureNotEnabledandErrAPIRestrictedActionso it is clear they mirror API responses rather than errors raised by the CLI.main,slack collaborator --helplists the hiddenupdatesubcommand; with this change it does not. It is a one line change that can be reverted on its own if it ever needs to be.PromptTeamSlackAuthnow callsSetSelectedAuthwhen only one account is authenticated, which the two multi-account paths already did. This sends API calls to the host that account belongs to, and also applies toapp linkandsandbox, which use the same prompt.app_idis required by the endpoint, so requests are reported one app at a time rather than for every app the account owns.Requirements