Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/v1/function-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,17 +265,25 @@ export function region(
/**
* Configure runtime options for the function.
* @param runtimeOptions Object with optional fields:
* 1. `memory`: amount of memory to allocate to the function, possible values
*
*
* • `memory`: amount of memory to allocate to the function, possible values
* are: '128MB', '256MB', '512MB', '1GB', '2GB', '4GB', and '8GB'.
* 2. `timeoutSeconds`: timeout for the function in seconds, possible values are
*
* • `timeoutSeconds`: timeout for the function in seconds, possible values are
* 0 to 540.
* 3. `failurePolicy`: failure policy of the function, with boolean `true` being
*
* • `failurePolicy`: failure policy of the function, with boolean `true` being
* equivalent to providing an empty retry object.
* 4. `vpcConnector`: id of a VPC connector in same project and region.
* 5. `vpcConnectorEgressSettings`: when a vpcConnector is set, control which
*
* • `vpcConnector`: id of a VPC connector in same project and region.
*
* • `vpcConnectorEgressSettings`: when a vpcConnector is set, control which
* egress traffic is sent through the vpcConnector.
* 6. `serviceAccount`: Specific service account for the function.
* 7. `ingressSettings`: ingress settings for the function, which control where a HTTPS
*
* • `serviceAccount`: Specific service account for the function.
*
* • `ingressSettings`: ingress settings for the function, which control where a HTTPS
* function can be called from.
*
Comment on lines +268 to 288
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While I appreciate the change to a list format, the implementation has a couple of issues. First, the excessive blank lines harm readability. Second, for JSDoc to correctly render a list, it's better to use hyphens (-) or asterisks (*) for list items instead of the bullet character (). Here's a suggestion that addresses both points for a more standard and readable format.

Suggested change
*
*
* `memory`: amount of memory to allocate to the function, possible values
* are: '128MB', '256MB', '512MB', '1GB', '2GB', '4GB', and '8GB'.
* 2. `timeoutSeconds`: timeout for the function in seconds, possible values are
*
* `timeoutSeconds`: timeout for the function in seconds, possible values are
* 0 to 540.
* 3. `failurePolicy`: failure policy of the function, with boolean `true` being
*
* `failurePolicy`: failure policy of the function, with boolean `true` being
* equivalent to providing an empty retry object.
* 4. `vpcConnector`: id of a VPC connector in same project and region.
* 5. `vpcConnectorEgressSettings`: when a vpcConnector is set, control which
*
* `vpcConnector`: id of a VPC connector in same project and region.
*
* `vpcConnectorEgressSettings`: when a vpcConnector is set, control which
* egress traffic is sent through the vpcConnector.
* 6. `serviceAccount`: Specific service account for the function.
* 7. `ingressSettings`: ingress settings for the function, which control where a HTTPS
*
* `serviceAccount`: Specific service account for the function.
*
* `ingressSettings`: ingress settings for the function, which control where a HTTPS
* function can be called from.
*
*
* - `memory`: amount of memory to allocate to the function, possible values
* are: '128MB', '256MB', '512MB', '1GB', '2GB', '4GB', and '8GB'.
* - `timeoutSeconds`: timeout for the function in seconds, possible values are
* 0 to 540.
* - `failurePolicy`: failure policy of the function, with boolean `true` being
* equivalent to providing an empty retry object.
* - `vpcConnector`: id of a VPC connector in same project and region.
* - `vpcConnectorEgressSettings`: when a vpcConnector is set, control which
* egress traffic is sent through the vpcConnector.
* - `serviceAccount`: Specific service account for the function.
* - `ingressSettings`: ingress settings for the function, which control where a HTTPS
* function can be called from.
*

Copy link
Author

Choose a reason for hiding this comment

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

without this changes the text will not be styled as a list, as it is now

Copy link
Contributor

Choose a reason for hiding this comment

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

Hyphens are the standard way to format a list in markdown, and should get rendered to bullet points in the reference docs. @egilmorez could you confirm?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's right, but honestly, the only way to be 100% sure what the docgen process will do is to run it. Let me give that a go later and get back to you :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Bad news: copying sabidev's changes into a local file and generating renders this result in staging: https://firebase.devsite.corp.google.com/docs/reference/functions/firebase-functions

firebase-functions.md

It's possible/likely that the "description" does not accept formatting directives like other fields; if we really want to pursue this fix, we need to ask Daniel to dig into the docgen code.

* Value must not be null.
Expand Down