Skip to content

feat: support multiple Slack/GitHub project integrations with TUI#38

Merged
markhallen merged 3 commits intomainfrom
feat/multi-project-tui
Mar 29, 2026
Merged

feat: support multiple Slack/GitHub project integrations with TUI#38
markhallen merged 3 commits intomainfrom
feat/multi-project-tui

Conversation

@markhallen
Copy link
Copy Markdown
Owner

Summary

  • Add multi-project support: multiple Slack workspaces can be paired with different GitHub repositories, each with its own credentials
  • Interactive TUI (bin/slack-gh-config / rake config) for adding, editing, removing, and listing project integrations
  • Encrypted config file (AES-256-GCM + PBKDF2) at .config/projects.enc — no database required
  • Incoming Slack requests routed by team_id with automatic env var fallback for full backward compatibility

New files

  • lib/config/encryption.rb — AES-256-GCM encryption with PBKDF2 key derivation (Ruby stdlib only)
  • lib/config/project_config.rb — Multi-project config model with CRUD, encrypted file I/O, team_id lookup
  • lib/cli/tui.rb — Interactive TUI using tty-prompt/tty-table
  • bin/slack-gh-config — CLI entry point
  • Tests: 31 new tests across encryption, config, TUI, and multi-project integration

Modified files

  • app.rb — Config loading on startup, team_id extraction, token resolution with fallback
  • Gemfile — Added tty-prompt, tty-table
  • Rakefile — Added rake config task
  • README.md — Multi-Project Setup section, updated features/env vars/structure/security
  • CLAUDE.md — Updated architecture and commands

Closes #34

Test plan

  • bundle exec rake ci passes (70 tests, 136 assertions, RuboCop clean)
  • Existing tests pass unchanged (backward compatibility)
  • Run bundle exec rake config to verify TUI flow (add/list/edit/remove projects)
  • Verify encrypted config file is created at .config/projects.enc and is not readable without passphrase
  • Test multi-project routing: set CONFIG_PASSPHRASE, start server, send request with matching team_id
  • Test fallback: remove config file, verify app works with env vars only

🤖 Generated with Claude Code

markhallen and others added 2 commits March 28, 2026 21:16
…figuration

Add multi-project support allowing multiple Slack workspaces to be paired
with different GitHub repositories. Projects are managed via an interactive
TUI (tty-prompt) and stored in an AES-256-GCM encrypted config file.
Incoming requests are routed by Slack team_id with env var fallback for
full backward compatibility.

Closes #34

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for configuring and routing multiple Slack workspace ↔ GitHub integrations, backed by an encrypted on-disk config and managed via an interactive terminal UI, while preserving env-var fallback for backward compatibility.

Changes:

  • Introduces encrypted multi-project configuration storage and lookup by Slack team_id.
  • Adds an interactive TUI + CLI entrypoint (and rake config) to manage project integrations.
  • Updates Sinatra request handling to resolve tokens per-project with env-var fallback; adds tests covering multi-project routing and config/encryption.

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
app.rb Loads encrypted project config on startup; resolves credentials by team_id with fallback
lib/config/encryption.rb AES-256-GCM + PBKDF2 encryption/decryption utilities
lib/config/project_config.rb Multi-project model with CRUD, encrypted file I/O, team lookup
lib/cli/tui.rb TUI for adding/editing/removing/listing projects
bin/slack-gh-config CLI entry point for the TUI
Rakefile Adds rake config task
Gemfile / Gemfile.lock Adds TTY dependencies for TUI
README.md Documents multi-project setup, config encryption, and usage
CLAUDE.md Updates architecture/commands documentation
test/test_app.rb Updates expectation for new missing-credentials error message
test/test_multi_project.rb Adds integration tests for routing by team_id and fallback
test/config/test_encryption.rb Adds encryption unit tests
test/config/test_project_config.rb Adds project config unit tests
test/cli/test_tui.rb Adds TUI flow tests with a mock prompt
Comments suppressed due to low confidence (1)

lib/config/project_config.rb:62

  • update_project applies updates without re-validating invariants (non-empty name/slack_team_id, uniqueness of name and slack_team_id). This allows edits that can break routing (e.g., blank/duplicate team IDs) or create duplicate names. Add the same validations used in add_project (plus duplicate checks that exclude the current record) before persisting changes.
    def update_project(name, attrs)
      project = find_by_name(name)
      raise ArgumentError, "Project '#{name}' not found" unless project

      attrs.each do |key, value|
        sym_key = key.to_sym
        project[sym_key] = value if project.key?(sym_key)
      end
      project

Comment thread app.rb Outdated
Comment thread lib/config/encryption.rb Outdated
Comment thread lib/config/encryption.rb
Comment thread lib/config/project_config.rb
Comment thread lib/cli/tui.rb Outdated
Comment thread lib/cli/tui.rb Outdated
Comment thread lib/cli/tui.rb Outdated
- Log warning when config file exists but CONFIG_PASSPHRASE is unset
- Rescue ArgumentError in decrypt for corrupted/non-Base64 data
- Add blob length validation before attempting decryption
- Enforce unique slack_team_id in add_project and validate on update
- Require non-empty passphrases in TUI prompts
- Replace send() with explicit lambda dispatch table in menu loop
- Add required: true to team_id field in edit flow
- Show restart reminder when exiting TUI with configured projects

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@markhallen markhallen merged commit ef89f98 into main Mar 29, 2026
9 checks passed
@markhallen markhallen deleted the feat/multi-project-tui branch March 29, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multiple Slack <> GitHub project integrations with TUI configuration

2 participants