Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Cloud Runtime Configuration API shuts down March 2026, making functions.config() unusable. Migrated to firebase-functions/params with .env files.

Implementation

functions/src/jobs/slackFileArchiveCronJob.ts

  • Replaced functions.config() with defineString() parameters
  • Defined SLACK_TOKEN, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
// Before
import {runWith, config as getConfig, logger} from 'firebase-functions/v1';
const config = getConfig();
const slack = new WebClient(config.slack.token);

// After
import {runWith, logger} from 'firebase-functions/v1';
import {defineString} from 'firebase-functions/params';

const slackToken = defineString('SLACK_TOKEN');
const slack = new WebClient(slackToken.value());

functions/src/jobs/slackFileArchiveCronJeb.test.ts

  • Replaced test.mockConfig() with process.env assignments

Migration Guide

  • Created functions/.env.example with required variables
  • Added functions/README.md documenting setup and migration rationale
  • Deprecated .runtimeconfig.example.json with pointer to new format
  • Updated .gitignore to exclude .env files
Original prompt

This section details on the original issue you should resolve

<issue_title>functions で functions.config() API を使用している箇所をマイグレートする</issue_title>
<issue_description>Firebase Functions で活用している functions.config() は既にdeprecatedで、2026年3月に停止するとのこと

! DEPRECATION NOTICE: Action required to deploy after March 2026

  functions.config() API is deprecated.
  Cloud Runtime Configuration API, the Google Cloud service used to store function configuration data, will be shut down in March 2026. As a result, you must migrate away from using functions.config() to continue deploying your functions after March 2026.

  What this means for you:

  - The Firebase CLI commands for managing this configuration (functions:config:set, get, unset, clone, and export) are deprecated. These commands will no longer work after March 2026.
  - firebase deploy command will fail for functions that use the legacy functions.config() API after March 2026.     

  Existing deployments will continue to work with their current configuration.

  See your migration options at: https://firebase.google.com/docs/functions/config-env#migrate-to-dotenv
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@hakatashi hakatashi marked this pull request as ready for review November 6, 2025 23:36
Copilot AI review requested due to automatic review settings November 6, 2025 23:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Co-authored-by: hakatashi <3126484+hakatashi@users.noreply.github.com>
Copilot AI requested a review from hakatashi as a code owner November 6, 2025 23:37
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

Please retry analysis of this Pull-Request directly on SonarQube Cloud

@tsg-ut-gemini-assistant
Copy link

📋 概要

はにゃ?このプルリクエストは、Firebase Functionsのfunctions.config()っていうのを新しいのに変えるやつだって書いてあるにゃ!
でも、package-lock.jsonしか変わってないみたいだにゃ?まだ途中ってことかにゃ?にゃししっ!

🔍 全体的なフィードバック

うーん、まだコードの変更がないから、うなには何て言ったらいいかよくわかんないにゃ!
これから魔法みたいなすごいコードが追加されるのを楽しみにしてるにゃ!

🎯 具体的なフィードバック

今のところ、レビューできるコードがないから、特に問題は見つからなかったにゃ!

✅ ハイライト

  • プルリクエストを作ってくれたのはえらいにゃ!最初の一歩は大事だにゃ!

Co-authored-by: hakatashi <3126484+hakatashi@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

Please retry analysis of this Pull-Request directly on SonarQube Cloud

Co-authored-by: hakatashi <3126484+hakatashi@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

Please retry analysis of this Pull-Request directly on SonarQube Cloud

Copilot AI changed the title [WIP] Migrate functions.config() API to Cloud Runtime Configuration API Migrate Firebase Functions from deprecated functions.config() to environment variables Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

functions で functions.config() API を使用している箇所をマイグレートする

2 participants