Skip to content

infra: staging を撤去し main→prod 直デプロイに切り替え - #58

Merged
nkoji21 merged 1 commit into
mainfrom
infra/teardown-staging
Aug 1, 2026
Merged

infra: staging を撤去し main→prod 直デプロイに切り替え#58
nkoji21 merged 1 commit into
mainfrom
infra/teardown-staging

Conversation

@nkoji21

@nkoji21 nkoji21 commented Aug 1, 2026

Copy link
Copy Markdown
Member

Phase 10 (最終)。19:00 の本番配信 (OIDC + 新ビルド) を確認済み。

  • enable_staging = false → stg サービス + stg invoker を破棄
  • deploy.yaml: main マージ → prod 直デプロイ (案A)。promote.yaml 削除
  • GOOGLE_CLOUD_PROJECT env 追加 (ログのトレース連携用)
  • scaling の恒常 plan ノイズを ignore_changes で解消

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ce7a88f7-5bb3-4d22-aa1a-3767675797c9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the infra label Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

Plan Result (infra)

CI link

⚠️ Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 0 to add, 1 to change, 2 to destroy.
  • Update
    • google_cloud_run_v2_service.yukan["prod"]
  • Delete
    • google_cloud_run_v2_service.yukan["stg"]
    • google_cloud_run_v2_service_iam_binding.invoker["stg"]
Change Result (Click me)
  # google_cloud_run_v2_service.yukan["prod"] will be updated in-place
  ~ resource "google_cloud_run_v2_service" "yukan" {
        id                      = "projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan"
        name                    = "discord-yukan"
        # (33 unchanged attributes hidden)

      ~ template {
            # (10 unchanged attributes hidden)

          ~ containers {
                name           = null
                # (7 unchanged attributes hidden)

              + env {
                  + name  = "GOOGLE_CLOUD_PROJECT"
                  + value = "yukan-discord-bot"
                }

                # (7 unchanged blocks hidden)
            }

            # (1 unchanged block hidden)
        }

        # (2 unchanged blocks hidden)
    }

  # google_cloud_run_v2_service.yukan["stg"] will be destroyed
  # (because key ["stg"] is not in for_each map)
  - resource "google_cloud_run_v2_service" "yukan" {
      - annotations             = {} -> null
      - client                  = "gcloud" -> null
      - client_version          = "568.0.0" -> null
      - conditions              = [
          - {
              - last_transition_time = "2026-08-01T03:05:11.279737Z"
              - state                = "CONDITION_SUCCEEDED"
              - type                 = "RoutesReady"
                # (5 unchanged attributes hidden)
            },
          - {
              - last_transition_time = "2026-08-01T03:05:06.606387Z"
              - state                = "CONDITION_SUCCEEDED"
              - type                 = "ConfigurationsReady"
                # (5 unchanged attributes hidden)
            },
        ] -> null
      - create_time             = "2026-07-31T10:36:50.804667Z" -> null
      - creator                 = "yukan-tfaction-apply@yukan-discord-bot.iam.gserviceaccount.com" -> null
      - custom_audiences        = [] -> null
      - deletion_protection     = false -> null
      - effective_annotations   = {} -> null
      - effective_labels        = {
          - "goog-terraform-provisioned" = "true"
        } -> null
      - etag                    = "\"CN_EtdMGEPjfk7UD/cHJvamVjdHMveXVrYW4tZGlzY29yZC1ib3QvbG9jYXRpb25zL2FzaWEtbm9ydGhlYXN0MS9zZXJ2aWNlcy9kaXNjb3JkLXl1a2FuLXN0Zw\"" -> null
      - generation              = "22" -> null
      - id                      = "projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan-stg" -> null
      - ingress                 = "INGRESS_TRAFFIC_ALL" -> null
      - invoker_iam_disabled    = false -> null
      - labels                  = {} -> null
      - last_modifier           = "yukan-deployer@yukan-discord-bot.iam.gserviceaccount.com" -> null
      - latest_created_revision = "projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan-stg/revisions/discord-yukan-stg-00022-ttm" -> null
      - latest_ready_revision   = "projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan-stg/revisions/discord-yukan-stg-00022-ttm" -> null
      - launch_stage            = "GA" -> null
      - location                = "asia-northeast1" -> null
      - name                    = "discord-yukan-stg" -> null
      - observed_generation     = "22" -> null
      - project                 = "yukan-discord-bot" -> null
      - reconciling             = false -> null
      - terminal_condition      = [
          - {
              - last_transition_time = "2026-08-01T03:05:11.328783Z"
              - state                = "CONDITION_SUCCEEDED"
              - type                 = "Ready"
                # (5 unchanged attributes hidden)
            },
        ] -> null
      - terraform_labels        = {
          - "goog-terraform-provisioned" = "true"
        } -> null
      - traffic_statuses        = [
          - {
              - percent  = 100
              - type     = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"
                # (3 unchanged attributes hidden)
            },
        ] -> null
      - uid                     = "86f5d48b-3a1c-497a-9aa2-711f7cf0929e" -> null
      - update_time             = "2026-08-01T03:05:03.916779Z" -> null
      - uri                     = "https://discord-yukan-stg-dnx7kn36oq-an.a.run.app" -> null
      - urls                    = [
          - "https://discord-yukan-stg-547280806905.asia-northeast1.run.app",
          - "https://discord-yukan-stg-dnx7kn36oq-an.a.run.app",
        ] -> null
        # (3 unchanged attributes hidden)

      - scaling {
          - manual_instance_count = 0 -> null
          - min_instance_count    = 0 -> null
            # (1 unchanged attribute hidden)
        }

      - template {
          - annotations                      = {} -> null
          - gpu_zonal_redundancy_disabled    = false -> null
          - labels                           = {} -> null
          - max_instance_request_concurrency = 80 -> null
          - service_account                  = "yukan-run@yukan-discord-bot.iam.gserviceaccount.com" -> null
          - session_affinity                 = false -> null
          - timeout                          = "900s" -> null
            # (3 unchanged attributes hidden)

          - containers {
              - args           = [] -> null
              - build_info     = [] -> null
              - command        = [] -> null
              - depends_on     = [] -> null
              - image          = "asia-northeast1-docker.pkg.dev/yukan-discord-bot/yukan-bot/discord-yukan:c29301d7d9e00e3882701f01edb0840db7413564" -> null
                name           = null
                # (2 unchanged attributes hidden)

              - env {
                  - name  = "DISCORD_BOT_TOKEN" -> null
                    # (1 unchanged attribute hidden)

                  - value_source {
                      - secret_key_ref {
                          - secret  = "discord-bot-token" -> null
                          - version = "latest" -> null
                        }
                    }
                }
              - env {
                  - name  = "GEMINI_API_KEY" -> null
                    # (1 unchanged attribute hidden)

                  - value_source {
                      - secret_key_ref {
                          - secret  = "gemini-api-key" -> null
                          - version = "latest" -> null
                        }
                    }
                }
              - env {
                  - name  = "YUKAN_DEFAULT_TARGET" -> null
                  - value = "dev" -> null
                }
              - env {
                  - name  = "YUKAN_SUMMARY_TARGETS" -> null
                  - value = jsonencode(
                        {
                          - dev  = {
                              - channel_id      = "1417771223433351170"
                              - guild_id        = "1239827951667908668"
                              - log_channel_id  = "1417771223433351170"
                              - source_guild_id = "1239827951667908668"
                            }
                          - prod = {
                              - channel_id      = "1418904371579719710"
                              - guild_id        = "1239827951667908668"
                              - log_channel_id  = "1430142792314650764"
                              - source_guild_id = "1239827951667908668"
                            }
                        }
                    ) -> null
                }

              - ports {
                  - container_port = 8080 -> null
                  - name           = "http1" -> null
                }

              - resources {
                  - cpu_idle          = true -> null
                  - limits            = {
                      - "cpu"    = "1000m"
                      - "memory" = "512Mi"
                    } -> null
                  - startup_cpu_boost = true -> null
                }

              - startup_probe {
                  - failure_threshold     = 1 -> null
                  - initial_delay_seconds = 0 -> null
                  - period_seconds        = 240 -> null
                  - timeout_seconds       = 240 -> null

                  - tcp_socket {
                      - port = 8080 -> null
                    }
                }
            }

          - scaling {
              - max_instance_count = 1 -> null
              - min_instance_count = 0 -> null
            }
        }

      - traffic {
          - percent  = 100 -> null
          - type     = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST" -> null
            # (2 unchanged attributes hidden)
        }
    }

  # google_cloud_run_v2_service_iam_binding.invoker["stg"] will be destroyed
  # (because key ["stg"] is not in for_each map)
  - resource "google_cloud_run_v2_service_iam_binding" "invoker" {
      - etag     = "BwZX5cTzuco=" -> null
      - id       = "projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan-stg/roles/run.invoker" -> null
      - location = "asia-northeast1" -> null
      - members  = [
          - "serviceAccount:yukan-scheduler@yukan-discord-bot.iam.gserviceaccount.com",
          - "user:nka21dev@gmail.com",
        ] -> null
      - name     = "projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan-stg" -> null
      - project  = "yukan-discord-bot" -> null
      - role     = "roles/run.invoker" -> null
    }

Plan: 0 to add, 1 to change, 2 to destroy.

@nkoji21
nkoji21 merged commit 744d1ab into main Aug 1, 2026
6 of 7 checks passed
@nkoji21
nkoji21 deleted the infra/teardown-staging branch August 1, 2026 17:31
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

✅ Apply Succeeded (infra)

CI link

Apply complete! Resources: 0 added, 1 changed, 2 destroyed.
Details (Click me)
google_cloud_run_v2_service_iam_binding.invoker["stg"]: Destroying... [id=projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan-stg/roles/run.invoker]
google_cloud_run_v2_service_iam_binding.invoker["stg"]: Destruction complete after 8s
google_cloud_run_v2_service.yukan["stg"]: Destroying... [id=projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan-stg]
google_cloud_run_v2_service.yukan["prod"]: Modifying... [id=projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan]
google_cloud_run_v2_service.yukan["stg"]: Destruction complete after 1s
google_cloud_run_v2_service.yukan["prod"]: Still modifying... [id=projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan, 00m10s elapsed]
google_cloud_run_v2_service.yukan["prod"]: Modifications complete after 13s [id=projects/yukan-discord-bot/locations/asia-northeast1/services/discord-yukan]

Apply complete! Resources: 0 added, 1 changed, 2 destroyed.

Outputs:

deployer_sa = "yukan-deployer@yukan-discord-bot.iam.gserviceaccount.com"
tfaction_apply_sa = "yukan-tfaction-apply@yukan-discord-bot.iam.gserviceaccount.com"
tfaction_plan_sa = "yukan-tfaction-plan@yukan-discord-bot.iam.gserviceaccount.com"
wif_provider = "projects/547280806905/locations/global/workloadIdentityPools/github/providers/github-oidc"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant