Skip to content

feat: check requests to install an app - #650

Closed
AmyScript wants to merge 1 commit into
mainfrom
amy-app-request-command
Closed

feat: check requests to install an app#650
AmyScript wants to merge 1 commit into
mainfrom
amy-app-request-command

Conversation

@AmyScript

Copy link
Copy Markdown
Contributor

Changelog

  • Added a slack app request command that checks the status of your most recent request to have an app approved for install.
  • Fixed the help template so hidden subcommands are no longer listed under their parent command.

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 request command (aliased as requests) 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:

🔒 App Install Approval Requests
   App ID:       A01AX7UTK19
   teamname (T0123456789):
     Request ID:   Ar0123456789
     Status:       pending
     Requested:    2026-08-21 15:04:05 -04:00

A denied request adds the moment it was reviewed:

🔒 App Install Approval Requests
   App ID:       A01AX7UTK19
   teamname (T0123456789):
     Request ID:   Ar0123456789
     Status:       denied
     Requested:    2026-08-21 15:04:05 -04:00
     Resolved:     2026-08-22 09:30:00 -04:00

A cancelled request names the kind of actor that cancelled it, which is an admin, the system, or you:

🔒 App Install Approval Requests
   App ID:       A01AX7UTK19
   teamname (T0123456789):
     Request ID:   Ar0123456789
     Status:       cancelled
     Requested:    2026-08-21 15:04:05 -04:00
     Resolved:     2026-08-22 09:30:00 -04:00
     Cancelled by: an admin

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:

🔒 App Install Approval Requests
   App ID:       A01AX7UTK19
   teamname (T0123456789):
     Request ID:   Ar0123456789
     Status:       pending
     Requested:    2026-08-21 15:04:05 -04:00
     You can install this app without approval. Please cancel the request.

Design considerations

slack app request was 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:

  • The CLI install flow: "Your request to install the app is pending", "Please submit a request to install or update your app" (internal/pkg/apps/install.go), and "Cancel the current request to install this app?" (internal/api/app.go).
  • On the app settings page under Install App, when approval is on, the button is Request to Install, and Slackbot follows up with "Your request to install [APP] on [WORKSPACE] has been sent for review."
  • The member-facing help article has a "Request app approval" section: https://slack.com/help/articles/202035138-Add-apps-to-your-Slack-workspace

Preview

No recording yet — the output above is taken from the unit tests rather than a live run.

Testing

  • Unit tests cover the API client against a mocked server and the output formatting for every status and cancellation actor.
  • Both app selection paths are covered: the project prompt and the --app app ID path, including a failed team selection and a team without a token.
  • Verified that a project is still required unless an app ID is given, and that the API error for more than 50 workspaces surfaces to the developer.
  • Output is sorted by team and leaves the requests of the caller in the order they arrived.
  • The error codes returned by the endpoint are asserted through their rendered message and remediation rather than the bare code.

Notes

  • Adds the feature_not_enabled and restricted_action error codes returned by the endpoint, named ErrAPIFeatureNotEnabled and ErrAPIRestrictedAction so it is clear they mirror API responses rather than errors raised by the CLI.
  • Fixes a pre-existing bug in the help template where hidden subcommands were still listed under a parent command. On main, slack collaborator --help lists the hidden update subcommand; 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.
  • PromptTeamSlackAuth now calls SetSelectedAuth when 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 to app link and sandbox, which use the same prompt.
  • app_id is required by the endpoint, so requests are reported one app at a time rather than for every app the account owns.

Requirements

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>
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.45223% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.56%. Comparing base (bd2741b) to head (978851a).

Files with missing lines Patch % Lines
cmd/app/request.go 98.48% 1 Missing and 1 partial ⚠️
internal/api/app.go 91.30% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AmyScript
AmyScript requested a review from mwbrooks August 27, 2026 16:29
@AmyScript AmyScript added the semver:minor Use on pull requests to describe the release version increment label Aug 27, 2026
@AmyScript AmyScript closed this Aug 27, 2026
@srtaalej srtaalej added enhancement M-T: A feature request for new functionality experiment Experimental feature accessed behind the --experiment flag or toggle labels Aug 27, 2026
@srtaalej srtaalej added this to the Next Release milestone Aug 27, 2026
@zimeg
zimeg deleted the amy-app-request-command branch August 28, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality experiment Experimental feature accessed behind the --experiment flag or toggle semver:minor Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants