Skip to content

feat: functions.yaml has comment#147

Merged
kevmoo merged 2 commits intofirebase:mainfrom
brianquinlan:comment
Apr 18, 2026
Merged

feat: functions.yaml has comment#147
kevmoo merged 2 commits intofirebase:mainfrom
brianquinlan:comment

Conversation

@brianquinlan
Copy link
Copy Markdown
Contributor

@brianquinlan brianquinlan commented Apr 18, 2026

Fixes #146

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a generated-file warning header to the YAML manifest output in lib/src/builder/manifest.dart and includes a corresponding test case in test/snapshots/manifest_snapshot_test.dart. Feedback was provided to strengthen the test assertion by verifying the exact header string instead of just checking for a leading comment character, ensuring better protection against regressions.

final dartYaml = File(
'test/fixtures/dart_reference/functions.yaml',
).readAsStringSync();
expect(dartYaml, startsWith('#'));
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.

medium

The assertion startsWith('#') is too broad and doesn't fully validate the implementation. Since this is a snapshot test, it should verify the exact header string to ensure the generated manifest contains the correct 'Do not edit' warning and package attribution, preventing regressions in the header format.

      expect(dartYaml, startsWith('# This file is generated by package:firebase_functions. Do not edit.'));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That seems like a change-detector test.

@brianquinlan brianquinlan requested a review from kevmoo April 18, 2026 00:48
@kevmoo kevmoo merged commit 4a22f51 into firebase:main Apr 18, 2026
9 checks passed
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.yaml should contain a comment indication that it is generated

2 participants