feature: add action to trigger gcp workflows - #2
Merged
Conversation
- Implemented static workflow example in YAML configuration for alert reactions. - Added dynamic workflow execution based on alert annotations. - Introduced Go module for GCP Workflows with necessary dependencies. - Developed main application logic to handle alert data and execute workflows. - Created comprehensive test script to validate configuration and functionality. - Ensured environment variable fallbacks for alert data and workflow names. - Added sanitization for workflow names to comply with GCP naming requirements.
… variable mappings and workflow name sanitization
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces the initial release of the GCP Workflows action, providing a robust solution for executing Google Cloud Workflows in response to Prometheus alerts. The action supports both static and dynamic workflow name resolution, comprehensive authentication methods, and secure containerization.
Key features include:
- Static and dynamic workflow name support with automatic sanitization
- GCP authentication via service account keys or Workload Identity
- Comprehensive alert data passing and flexible configuration options
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| actions/gcp-workflows/src/main.go | Core Go application implementing workflow execution logic and alert data processing |
| actions/gcp-workflows/src/go.mod | Go module definition with GCP Workflows and authentication dependencies |
| actions/gcp-workflows/test.sh | Comprehensive test script covering configuration validation and workflow name resolution |
| actions/gcp-workflows/Dockerfile | Multi-stage Docker build with Alpine runtime and non-root execution |
| actions/gcp-workflows/README.md | Complete documentation with usage examples and authentication setup |
| actions/gcp-workflows/CHANGELOG.md | Initial release changelog documenting all features |
| actions/gcp-workflows/examples/*.yaml | Example AlertReaction configurations for different authentication methods |
| actions/gcp-workflows/examples/setup-gcp.sh | GCP setup script for automated resource provisioning |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…ks for leading numbers
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.
fix #1
This pull request introduces the initial release of the GCP Workflows action, providing a robust solution for executing Google Cloud Workflows in response to Prometheus alerts. The changes include a production-ready Dockerfile, comprehensive documentation, example configurations for both static and dynamic workflow execution, a full test suite, and all necessary dependencies. Key features support both service account and Workload Identity authentication, flexible workflow name resolution, secure containerization, and extensive configuration options.
Core Features and Implementation:
actions/gcp-workflows/CHANGELOG.md)Containerization and Security:
actions/gcp-workflows/Dockerfile)Documentation and Examples:
AlertReactionmanifests for static workflow execution with service account authentication, dynamic workflow execution with Workload Identity, and workflow name extraction from alert annotations. (actions/gcp-workflows/examples/static-workflow-alertreaction.yaml,actions/gcp-workflows/examples/dynamic-workflow-workload-identity.yaml,actions/gcp-workflows/examples/workflow-from-annotation.yaml) [1] [2] [3]Testing and Validation:
actions/gcp-workflows/test.sh)Dependencies:
actions/gcp-workflows/src/go.mod)