Changed ci/cd to support second pub/sub topic#796
Conversation
WalkthroughThe GitHub Actions CI/CD workflow was updated to replace the single queue image environment variable with two separate variables for "fedify" and "ghost" queues. Both staging and production deployment jobs were modified to deploy these two queues as separate Cloud Run services, each named with appropriate suffixes and using the same Docker image tag. These deployments include skipping default labels and adding a commit SHA label. The original single "ActivityPub Queue" deployment remains unchanged. No changes were made to exported or public code entities. Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (2)
.github/workflows/cicd.yml (2)
453-458: Duplicate staging queue deployment step.Same pattern as the Fedify queue deployment. Apply the matrix refactor suggested above to this Ghost queue step.
527-532: Duplicate production queue deployment step.Same pattern as the Fedify queue in production. Please apply the matrix refactor above here as well to reduce duplication.
🧹 Nitpick comments (2)
.github/workflows/cicd.yml (2)
443-452: Consider abstracting duplicate staging queue deployments with a matrix.The new Fedify queue deployment step mirrors the Ghost queue step. You can DRY this by using a matrix for queue names, reducing maintenance overhead. For example:
jobs: deploy-staging: - strategy: - matrix: - region: [europe-west4, europe-west3] - steps: - - name: "Deploy ActivityPub Fedify Queue to Cloud Run" - uses: google-github-actions/deploy-cloudrun@v2 - with: - image: europe-docker.pkg.dev/ghost-activitypub/activitypub/activitypub:${{ needs.build-test-push.outputs.activitypub_docker_version }} - region: ${{ matrix.region }} - service: stg-${{ matrix.region_name }}-activitypub-fedify-queue - skip_default_labels: true - labels: |- - commit-sha=${{ github.sha }} + strategy: + matrix: + region: [europe-west4, europe-west3] + queue: [fedify, ghost] + steps: + - name: "Deploy ActivityPub Queue (${{ matrix.queue }}) to Cloud Run" + uses: google-github-actions/deploy-cloudrun@v2 + with: + image: europe-docker.pkg.dev/ghost-activitypub/activitypub/activitypub:${{ needs.build-test-push.outputs.activitypub_docker_version }} + region: ${{ matrix.region }} + service: stg-${{ matrix.region_name }}-activitypub-${{ matrix.queue }}-queue + skip_default_labels: true + labels: |- + commit-sha=${{ github.sha }}
517-526: Consider abstracting duplicate production queue deployments with a matrix.The production Fedify queue deployment mirrors the Ghost queue step. Apply a similar matrix strategy as suggested for staging to reduce duplication:
jobs: deploy-production: - strategy: - matrix: - region: [europe-west4, europe-west3] - steps: - - name: "Deploy ActivityPub Fedify Queue to Cloud Run" - uses: google-github-actions/deploy-cloudrun@v2 - with: - image: europe-docker.pkg.dev/ghost-activitypub/activitypub/activitypub:${{ needs.build-test-push.outputs.activitypub_docker_version }} - region: ${{ matrix.region }} - service: prd-${{ matrix.region_name }}-activitypub-fedify-queue - skip_default_labels: true - labels: |- - commit-sha=${{ github.sha }} + strategy: + matrix: + region: [europe-west4, europe-west3] + queue: [fedify, ghost] + steps: + - name: "Deploy ActivityPub Queue (${{ matrix.queue }}) to Cloud Run" + uses: google-github-actions/deploy-cloudrun@v2 + with: + image: europe-docker.pkg.dev/ghost-activitypub/activitypub/activitypub:${{ needs.build-test-push.outputs.activitypub_docker_version }} + region: ${{ matrix.region }} + service: prd-${{ matrix.region_name }}-activitypub-${{ matrix.queue }}-queue + skip_default_labels: true + labels: |- + commit-sha=${{ github.sha }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/cicd.yml(3 hunks)
🔇 Additional comments (1)
.github/workflows/cicd.yml (1)
309-311:Details
❓ Verification inconclusive
Verify Terraform variable declarations for new queue images.
Ensure that
fedify_queue_imageandghost_queue_imageare declared in your Terraform modules so that theTF_VAR_*environment variables take effect. Otherwise, Terraform will ignore these values.Run the following to confirm the variables exist:
🏁 Script executed:
#!/bin/bash # Verify Terraform variable declarations rg -n 'variable "fedify_queue_image"' -n rg -n 'variable "ghost_queue_image"' -nLength of output: 84
🏁 Script executed:
#!/bin/bash set -euo pipefail # Verify Terraform variable declarations for queue images in all .tf files rg --glob '*.tf' -n 'variable "fedify_queue_image"' rg --glob '*.tf' -n 'variable "ghost_queue_image"' # Also check for any occurrences to catch usage without explicit declaration rg --glob '*.tf' -n 'fedify_queue_image' rg --glob '*.tf' -n 'ghost_queue_image'Length of output: 222
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "🔍 Listing all .tf files in the repository:" find . -type f -name '*.tf' -print echo "🔍 Searching for any Terraform variable declarations in those files:" rg -n 'variable ' --glob '*.tf' || echo "No variable declarations found." echo "🔍 Searching specifically for our queue image variables:" rg -n 'fedify_queue_image' --glob '*.tf' || echo "No occurrences of 'fedify_queue_image' found." rg -n 'ghost_queue_image' --glob '*.tf' || echo "No occurrences of 'ghost_queue_image' found."Length of output: 1270
Manual verification needed: Confirm Terraform variable declarations for queue images
It appears no
.tffiles are present in this repository, so Terraform may be applying against remote modules or code checked out elsewhere. Please ensure that the following variables are declared in your Terraform configurations (local or remote) so that theTF_VAR_*environment variables set in.github/workflows/cicd.ymltake effect:
fedify_queue_imageghost_queue_imageYou can verify by running, for example:
grep -R 'variable "fedify_queue_image"' path/to/terraform grep -R 'variable "ghost_queue_image"' path/to/terraformWithout these declarations, Terraform will ignore the queue image overrides.
ref https://linear.app/ghost/issue/PROD-1953 - Changed ci/cd to support the second pub/sub topic. Includes deployments to two new services: ghost-queue and fedify-queue.
ref https://linear.app/ghost/issue/PROD-1953