Skip to content

Skill to migrate functions.config to functions params#20

Merged
inlined merged 2 commits intofunctions-migrationsfrom
inlined.cf3-params-refactor
Mar 10, 2026
Merged

Skill to migrate functions.config to functions params#20
inlined merged 2 commits intofunctions-migrationsfrom
inlined.cf3-params-refactor

Conversation

@inlined
Copy link
Member

@inlined inlined commented Feb 28, 2026

This code is NOT COMPLETE and will merge into a feature launch branch.

This is the first of two skills that will be used to help customers migrate from functions.config to functions params. Since N projects may share the same source code, the skill is broken into a code refactoring and a data migration skill. The latter has not been written yet and we should not launch the feature until it is. Additionally, this skill adds descriptions to secrets to help with data migration which is an approved but not launched feature.

Here is a smoke test exmaple of how this skill performed at upgrading the functions-skills repo

@inlined inlined requested a review from jhuleatt February 28, 2026 20:01
- The `description` attribute SHOULD include tips to help a developer understand how to get the value of the parameter, what it is used for
and/or tips for usage. Examples may be that the stripe API key can be found in the Stripe dashboard for the environment, that the
stripe webhook secret should be a test webhook secret in dev environments so that the webhook emulator can be used, etc.
- The `description` attribute MUST include the name of the `functions.config()` path used prevoiusly, including "functions.config()" so that

Choose a reason for hiding this comment

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

Suggested change
- The `description` attribute MUST include the name of the `functions.config()` path used prevoiusly, including "functions.config()" so that
- The `description` attribute MUST include the name of the `functions.config()` path used previously, including "functions.config()" so that

```typescript
const foo = defineString('FOO', { /* descriptions */ });
let myFoo: Foo;
onInit(() => {

Choose a reason for hiding this comment

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

All the examples at the bottom use namespaced functions.onInit, but the onInit examples here and elsewhere use the modular import. Want to stick to one, maybe functions.onInit since this guide is for 1st gen?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. Do you think I should use functions.params or just the params import since they can be imported at "firebase-functions/v1".params or "firebase-functions/params"

(Will address in next PR in the series)


## Context
The user wants to migrate legacy Cloud Functions code from `functions.config()` (Runtime Config) to the modern `firebase-functions/params` API.
This is important because Runtime Config is deprecated and will be removed in the future. Runtime Config is also not available in the v2 functions

Choose a reason for hiding this comment

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

nit: this skill uses "v1"/"v2" terminology, but our docs use "1st gen"/"2nd gen". Given the import path is functions/v1 I'm not sure which is better.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, the way I speak specfically/technically is that "v1" and "v2" are SDKs and "1st gen" and "2nd gen" are services.

It currently strictly maps "v1" to "1st gen" and "v2" to "2nd gen" but that does not need to be the case. For example, we've considered making "v1" support "2nd gen" to avoid code rewrites and we've considered making "v2" support "run functions".

Given all that, I think that v1/v2 is appropriate in this document.

@jhuleatt
Copy link

fyi @egilmorez

inlined added a commit to firebase/firebase-functions that referenced this pull request Mar 10, 2026
@inlined inlined merged commit 406dfb7 into functions-migrations Mar 10, 2026
1 check passed
@inlined inlined deleted the inlined.cf3-params-refactor branch March 10, 2026 19:54
github-merge-queue bot pushed a commit to firebase/firebase-functions that referenced this pull request Mar 11, 2026
* Adds missing Params support in v1 configurability

Requires adding support for new features such as string interpolation (API propsoal oustanding) and value-only transforms (API proposal not outstanding beause the API is not publicly released)

* Add fixes for firestore

* Remove unnecessary toString method

* Format

* Add approved spec for secret params metadata. Used in firebase/agent-skills#20.

* Changelog
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.

2 participants