How takashicc/slack-approval works
Main Components
• GitHub Workflows & Runner: Represent the GitHub Actions environment where the custom action is invoked. This includes workflow definitions (under .github/workflows) and the Taskfile.yml for local task management.
• Custom Action Container: The Rust application compiled from the contents of src (with main.rs as the entry point). This container may be built using the Dockerfile.
• Service Modules: Within the Rust application, there are clearly separated modules:
• GitHub Service (in src/services/github) – responsible for handling GitHub-specific inputs and related logic.
• Slack Service (e.g., src/services/slack.rs) – manages communications with Slack (sending messages, processing button clicks).
• External APIs:
• Slack API – where the message is sent using the provided tokens and channel IDs.
• (Optionally) any GitHub API calls if part of the workflow feedback loop.
Relationships and Interactions
• One connects to the Slack Service, which sends an interactive message to Slack.
Architectural Patterns and Design Principles
• Modular Design: Emphasize that the source code is divided into modular services – GitHub integration and Slack messaging – for clear separation of concerns.
• Containerization: Note that a Dockerfile is present; thus, the application is containerized for consistent deployment.
• CI/CD Integration: The existence of multiple workflows (.github/workflows/ci.yml, test.yml, etc.) indicates automated testing and deployment pipelines.
Relevant Technologies and Frameworks
• Rust: The primary programming language (see Cargo.toml and Cargo.lock).
• Docker: For containerizing the action.
• GitHub Actions: For orchestrating workflows that include the custom action.
• Slack API: For sending interactive approval messages.
• GitHub API (if applicable): For processing the results from Slack actions.