Repository navigation
feat: add a slack setup page, slash command resync, and daily reports - #33
Merged
Merged
Conversation
Slack setup: - /slack/setup creates the Slack app from a manifest, with an app configuration token or by hand, runs the OAuth install, and saves the token and signing secret where the GitHub App installer saves its credentials (env file or SSM), then reloads the configuration - it never replaces an installed app's credentials or moves it to another workspace; while it is enabled, missing Slack credentials leave Slack off instead of failing to load Slash command: - /github-ops sync and /github-ops security-alerts run the action after answering Slack, post the report even if unchanged, and reply to who asked with a summary - requests are signature-checked; only APP_SLACK_COMMAND_ALLOWED_USERS may run actions, and replies leave out error details - the server runs jobs in the background; Lambda invokes itself asynchronously, and doesn't fail (so retry) a job that already replied Reports: - APP_REPORT_REPEAT=daily posts a report when the run changed team members or the report differs from the last one posted, and otherwise once a day at the first run after APP_REPORT_DAILY_TIME - alert ages and error text don't count as changes; empty reports never post but are remembered - what each report last posted is kept in SSM (APP_STATE_SSM_PREFIX, required in Lambda), a file, or memory Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README: the new endpoints, Slack and report variables, how reports decide to post, the slash command, and troubleshooting - slack setup: the setup page, creating the app by hand, adding the slash command to an existing app, and finding user IDs - lambda: job events and the role permissions each feature needs - the Slack manifest asset gains the slash command and commands scope - AGENTS.md: the slackapp and state packages and the command's rules Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 30, 2026
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.
This adds three things to the bot, each optional and off by default.
Slack setup page.
/slack/setupcreates and installs the Slack app the way cruxstack/argocd-slack-app does: it creates the app from this deployment's manifest (with an app configuration token, or by hand), runs Slack's OAuth install, and saves the token and signing secret where the GitHub App installer saves its credentials (STORAGE_MODEenv file or SSM), then reloads the configuration. It is enabled withAPP_SLACK_SETUP_ENABLED=true; while it is on, Slack credentials it hasn't saved yet leave Slack off instead of failing the configuration. Once installed, it refuses to replace the app's credentials or move it to another workspace. The GitHub App installer keeps/setup.Slash command resync.
/github-ops syncruns the Okta sync and/github-ops security-alertsposts the alerts report. The command answers Slack at once, runs the job afterwards (in the background on the server, in an async self-invocation on Lambda), posts the report even if unchanged, and replies privately to whoever asked with a summary. Requests are checked withAPP_SLACK_SIGNING_SECRET, only users inAPP_SLACK_COMMAND_ALLOWED_USERSmay run actions (anyone may runhelp), and replies leave out error details.Daily reports. With
APP_REPORT_REPEAT=dailythe checks can run hourly without posting hourly. A report posts when the run added or removed team members, when it differs from the last one posted (new or closed alerts, new orphaned users, a team that started or stopped failing), and otherwise once a day at the first run afterAPP_REPORT_DAILY_TIMEinAPP_REPORT_TIMEZONE. Alert ages and error text don't count as changes. What each report last posted is kept in SSM parameters underAPP_STATE_SSM_PREFIX(required in Lambda), a file, or memory. The default staysevery-run, so existing deployments behave as before.On Lambda, the slash command needs the role to invoke its own function, and daily reports need SSM read and write on the state prefix; cruxstack/terraform-aws-github-ops-app#10 adds matching inputs and permissions.
Testing:
make checkpasses (lint, unit and e2e tests, govulncheck,go mod tidy). New tests cover the report decisions across a simulated day (including DST), the slash command's signature, allowlist, and dispatch, the setup page's CSRF, OAuth state, and refusal cases, the SSM and env file stores, and a service test that installs through the setup page and checks that Slack turns on. Not yet tried against a real Slack workspace or AWS account.🤖 Generated with Claude Code