Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable and disable generic alerts in hosted #4097

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/prepare-for-prod-dt-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prepare for DT Production Environment Deployment

Check warning on line 1 in .github/workflows/prepare-for-prod-dt-deploy.yml

View workflow job for this annotation

GitHub Actions / Check for formatting & lint errors

File ignored by default.

on:
push:
Expand Down Expand Up @@ -150,6 +150,11 @@

gh pr create --fill

- name: Update Operator Alerts Configuration
uses: ./.github/workflows/update-operator-alerts.yml
with:
tag_name: ${{ needs.generate-tag-names.outputs.tag_name }}

- name: Update helm charts and raise pull request for enterprise customers on dedicated transformers
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/update-operator-alerts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Update Operator Alerts Configuration

Check warning on line 1 in .github/workflows/update-operator-alerts.yml

View workflow job for this annotation

GitHub Actions / Check for formatting & lint errors

File ignored by default.

on:
workflow_call:
inputs:
tag_name:
required: false
type: string
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for the release (defaults to current date if empty)'
required: false
type: string

jobs:
update-alerts:
runs-on: ubuntu-latest
steps:
- name: Checkout operator repo
uses: actions/checkout@v4.2.1
with:
repository: rudderlabs/rudderstack-operator
token: ${{ secrets.PAT }}
fetch-depth: 1

- name: Initialize Git Config
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "noreply@github.com"

- name: Set tag name
id: set_tag
run: |
if [ -z "${{ inputs.tag_name }}" ]; then
echo "tag=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
else
echo "tag=${{ inputs.tag_name }}" >> $GITHUB_OUTPUT
fi

- name: Create PR for enabled alerts
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
git checkout master
git pull origin master
git checkout -b transformer-hosted-alerts-enabled-${{ steps.set_tag.outputs.tag }}
yq eval -i '.enabled_on_hosted="true"' operator-helm/alerts/cross-customer-pipelines/integrations/generic-transformation-errors.yaml
git add operator-helm/alerts/cross-customer-pipelines/integrations/generic-transformation-errors.yaml
git commit -m "chore: enable transformer hosted alerts for release ${{ steps.set_tag.outputs.tag }}"
git push -u origin transformer-hosted-alerts-enabled-${{ steps.set_tag.outputs.tag }}
# Add error handling for PR creation
if gh pr create --title "chore: enable transformer hosted alerts for release ${{ steps.set_tag.outputs.tag }}" \
--body "chore: enable transformer hosted alerts for release ${{ steps.set_tag.outputs.tag }}" \
--base master; then
echo "PR created successfully"
else
echo "Failed to create PR, checking if changes exist"
exit 1
fi

- name: Create PR for disabled alerts
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
git checkout master
git pull origin master
git checkout -b transformer-hosted-alerts-disabled-${{ steps.set_tag.outputs.tag }}
yq eval -i '.enabled_on_hosted="false"' operator-helm/alerts/cross-customer-pipelines/integrations/generic-transformation-errors.yaml
git add operator-helm/alerts/cross-customer-pipelines/integrations/generic-transformation-errors.yaml
git commit -m "chore: disable transformer hosted alerts for release ${{ steps.set_tag.outputs.tag }}"
git push -u origin transformer-hosted-alerts-disabled-${{ steps.set_tag.outputs.tag }}
# Add error handling for PR creation
if gh pr create --title "chore: disable transformer hosted alerts for release ${{ steps.set_tag.outputs.tag }}" \
--body "chore: disable transformer hosted alerts for release ${{ steps.set_tag.outputs.tag }}" \
--base master; then
echo "PR created successfully"
else
echo "Failed to create PR, checking if changes exist"
exit 1
fi
Loading