Browse Source

feat(hybridcloud) Trigger separate silo DB tests with labels (#51252)

We're at the point now where foreign keys have been broken and the
migration history with foreign keys has been squashed. We can now
generate new environments using siloed database connections to futher
validate that application logic isn't crossing silos without RPC calls.

I thought that using a label to trigger using split databases would be
an unobtrusive way for the hybrid cloud team to work incrementally on
increasing silo stability. Once we have all tests passing running tests
against split databases will likely become the new normal, as any logic
that works under split databases will also work under a shared database.

I've not created the proposed label yet, as I wanted to get feedback on
this approach before adding a label.

Refs HC-769
Mark Story 1 year ago
parent
commit
dfa2da4fcd
1 changed files with 31 additions and 0 deletions
  1. 31 0
      .github/workflows/backend.yml

+ 31 - 0
.github/workflows/backend.yml

@@ -89,6 +89,12 @@ jobs:
           # https://github.com/codecov/codecov-bash/blob/7100762afbc822b91806a6574658129fe0d23a7d/codecov#L891
           fetch-depth: '2'
 
+      - name: Update environment for silo databases
+        if: |
+          contains( github.event.pull_request.labels.*.name, 'Trigger: Silo db' )
+        run: |
+          echo "SENTRY_USE_SPLIT_DBS=1" >> "$GITHUB_ENV"
+
       - name: Setup sentry env
         uses: ./.github/actions/setup-sentry
         id: setup
@@ -129,6 +135,13 @@ jobs:
           # https://github.com/codecov/codecov-bash/blob/7100762afbc822b91806a6574658129fe0d23a7d/codecov#L891
           fetch-depth: '2'
 
+      - name: Update environment for silo databases
+        id: silo_env
+        if: |
+          contains( github.event.pull_request.labels.*.name, 'Trigger: Silo db' )
+        run: |
+          echo "SENTRY_USE_SPLIT_DBS=1" >> "$GITHUB_ENV"
+
       - name: Setup sentry env
         uses: ./.github/actions/setup-sentry
         id: setup
@@ -160,6 +173,12 @@ jobs:
     steps:
       - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
 
+      - name: Update environment for silo databases
+        if: |
+          contains( github.event.pull_request.labels.*.name, 'Trigger: Silo db' )
+        run: |
+          echo "SENTRY_USE_SPLIT_DBS=1" >> "$GITHUB_ENV"
+
       - name: Setup sentry env
         uses: ./.github/actions/setup-sentry
         id: setup
@@ -313,6 +332,12 @@ jobs:
     steps:
       - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
 
+      - name: Update environment for silo databases
+        if: |
+          contains( github.event.pull_request.labels.*.name, 'Trigger: Silo db' )
+        run: |
+          echo "SENTRY_USE_SPLIT_DBS=1" >> "$GITHUB_ENV"
+
       - name: Setup sentry env
         uses: ./.github/actions/setup-sentry
         id: setup
@@ -385,6 +410,12 @@ jobs:
           # https://github.com/codecov/codecov-bash/blob/7100762afbc822b91806a6574658129fe0d23a7d/codecov#L891
           fetch-depth: '2'
 
+      - name: Update environment for silo databases
+        if: |
+          contains( github.event.pull_request.labels.*.name, 'Trigger: Silo db' )
+        run: |
+          echo "SENTRY_USE_SPLIT_DBS=1" >> "$GITHUB_ENV"
+
       - name: Setup sentry env
         uses: ./.github/actions/setup-sentry
         id: setup