Skip to content

Androidビルドの環境変数参照とPR作成ルールを更新 - #6511

Merged
TinyKitten merged 2 commits into
devfrom
agent/android-build-env-secrets
Aug 3, 2026
Merged

TinyKitten merged 2 commits into
devfrom
agent/android-build-env-secrets

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

概要

Androidビルドで使用する環境変数を、環境別の .env.local 一括Secretから個別のGitHub Secrets参照へ移行します。あわせて、リポジトリの自動化ガイドへ通常PRを既定とする運用ルールを追加します。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • Androidビルドワークフローのトップレベル env に、アプリが利用する8個の環境変数を個別Secretとして定義
  • production/development用の .env.local 書き出しステップを削除
  • AGENTS.md に、明示指定がない場合はDraftではなく通常PRを作成するルールを追加
  • リスク: 個別Secretが未登録の場合、対応するビルド時環境変数が空になります
  • 緩和策: 必要な変数を .env.example と照合し、すべてワークフローへ列挙しています

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

YAML構文チェック、git diff --check、npm run lint、npm test -- --runInBand、npm run typecheck を実行しました。ローカルNode.jsは24.18.1で、指定の22.xとは異なります。

関連Issue

なし

スクリーンショット(任意)

UI変更なし

Summary by CodeRabbit

  • 改善
    • Androidビルドで、環境別のAPI URLと実験的テレメトリ設定を安全に適用できるようになりました。
    • ビルド時の環境設定手順を簡素化しました。
  • ドキュメント
    • プルリクエストは原則としてレビュー準備完了状態で作成する運用方針を追記しました。

@TinyKitten TinyKitten self-assigned this Aug 3, 2026
@github-actions github-actions Bot added the ci/cd label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Androidビルドの環境変数をGitHub Secretsから設定する方式に変更しました。環境別.env.local生成ステップを削除しました。PRは既定でready for reviewとして作成する手順を追加しました。

Changes

Androidビルド設定

Layer / File(s) Summary
Secretsによるビルド環境設定
.github/workflows/build_android.yml
ステージング、開発、本番のAPI URLと実験的テレメトリ設定をワークフロー環境変数に追加しました。環境別.env.local生成ステップを削除しました。

PR作成手順

Layer / File(s) Summary
PR状態の既定値
AGENTS.md
PRを既定でready for reviewとして作成する手順を追加しました。Draftは明示的に要求された場合だけ使用します。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • TrainLCD/MobileApp#6446: 同じAndroidビルドワークフローを変更し、環境変数とSecretsの受け渡し方法を更新しています。

Poem

うさぎがSecretsを運びます
API URLを箱に詰めます
.env.localは眠ります
PRはreadyで跳ねます
Draftは合図を待ちます ─ 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed タイトルはAndroidビルドの環境変数変更とPR作成ルールの更新を明確に示しています。
Description check ✅ Passed 説明はテンプレートの全セクションを含み、変更内容、リスク、テスト、関連Issueを具体的に記載しています。
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/android-build-env-secrets

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

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/build_android.yml (1)

3-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Secret 式を引用してフォーマット規則を統一してください。

変更した 8 個の値は未引用です。適用する引用規則を確認し、すべての Secret 式を同じ規則で引用してください。

As per coding guidelines: YAML の文字列にはシングルクォートを使用します。
Based on learnings: .github/workflows の文字列にはダブルクォートを使用します。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build_android.yml around lines 3 - 12, Update the eight
secret expressions in the workflow-level env block to use consistent double
quotes, following the established .github/workflows YAML convention; apply this
uniformly to STAGING_API_URL, DEV_ROUTE_RESOLVER_API_URL,
PRODUCTION_ROUTE_RESOLVER_API_URL, DEV_WORKER_API_URL,
PRODUCTION_WORKER_API_URL, ENABLE_EXPERIMENTAL_TELEMETRY,
EXPERIMENTAL_TELEMETRY_ENDPOINT_URL, and EXPERIMENTAL_TELEMETRY_TOKEN.

Sources: Coding guidelines, Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build_android.yml:
- Around line 3-12: Remove EXPERIMENTAL_TELEMETRY_TOKEN from the workflow-level
env block and define it only in the specific build step that requires telemetry.
Keep the other environment variables unchanged and ensure npm ci, external
actions, artifact uploads, and Google Play uploads do not inherit the token.
- Around line 3-12:
ワークフローのenv設定にPRODUCTION_API_URLを対応するSecret参照として追加し、Gradle実行前に各variantで必要なAPI
URLが空でないことを検証して、未設定ならビルドを失敗させるよう更新してください。既存のDEV_ROUTE_RESOLVER_API_URL、PRODUCTION_ROUTE_RESOLVER_API_URL、DEV_WORKER_API_URL、PRODUCTION_WORKER_API_URL、STAGING_API_URLおよび追加するPRODUCTION_API_URLを検証対象にし、prodReleaseを不完全な設定で生成しないでください。

---

Nitpick comments:
In @.github/workflows/build_android.yml:
- Around line 3-12: Update the eight secret expressions in the workflow-level
env block to use consistent double quotes, following the established
.github/workflows YAML convention; apply this uniformly to STAGING_API_URL,
DEV_ROUTE_RESOLVER_API_URL, PRODUCTION_ROUTE_RESOLVER_API_URL,
DEV_WORKER_API_URL, PRODUCTION_WORKER_API_URL, ENABLE_EXPERIMENTAL_TELEMETRY,
EXPERIMENTAL_TELEMETRY_ENDPOINT_URL, and EXPERIMENTAL_TELEMETRY_TOKEN.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aa7b6a56-b156-4390-8ba3-27f6ff79b8e8

📥 Commits

Reviewing files that changed from the base of the PR and between e63ba42 and 15ed392.

📒 Files selected for processing (2)
  • .github/workflows/build_android.yml
  • AGENTS.md

Comment thread .github/workflows/build_android.yml Resolved
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

The agent generated fixes only for .github/workflows/ files, which cannot be committed due to permission restrictions. Please apply these changes manually.


⚠️ 1 file(s) could not be committed — the agent does not have permission to push to .github/workflows/. Please apply these changes manually:

.github/workflows/build_android.yml — 2 changes:

Lines 8–14
   PRODUCTION_WORKER_API_URL: ${{ secrets.PRODUCTION_WORKER_API_URL }}
   ENABLE_EXPERIMENTAL_TELEMETRY: ${{ secrets.ENABLE_EXPERIMENTAL_TELEMETRY }}
   EXPERIMENTAL_TELEMETRY_ENDPOINT_URL: ${{ secrets.EXPERIMENTAL_TELEMETRY_ENDPOINT_URL }}
-  EXPERIMENTAL_TELEMETRY_TOKEN: ${{ secrets.EXPERIMENTAL_TELEMETRY_TOKEN }}
 
 on:
   push:
Lines 167–172
 
       - name: Build ${{ steps.build_vars.outputs.variant }}
         working-directory: android
+        env:
+          EXPERIMENTAL_TELEMETRY_TOKEN: ${{ secrets.EXPERIMENTAL_TELEMETRY_TOKEN }}
         run: ./gradlew ${{ steps.build_vars.outputs.gradle_task }} --no-daemon
 
       - name: Upload AAB artifact

@TinyKitten
TinyKitten merged commit 94e0e6e into dev Aug 3, 2026
3 checks passed
@TinyKitten
TinyKitten deleted the agent/android-build-env-secrets branch August 3, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant