3035 Commits

Author SHA1 Message Date
Zhigang Fang
94014638a1 fix: prevent crash in cases when file not uploaded 2021-09-05 11:50:04 +08:00
Thomas Bouldin
37f5cc7852 Fix bug where CLI would crash when customers upload an empty functions project (#3705)
* Fix bug where CLI would crash when customers upload an empty functions project

* Changelog
2021-09-03 17:10:38 -07:00
Thomas Bouldin
98058cca37 Create new endpoint type definition (#3731)
* Create new endpoint type definition

* Fix build breaks

* Remove HttpsTrigger.allowInsecure

* Formatter

* Add type discrimiation functions and fix break
2021-09-03 12:35:19 -07:00
Thomas Bouldin
013c3c23b7 Remove HttpsTrigger.allowInsecure (#3733)
* Remove HttpsTrigger.allowInsecure

* Formatter
2021-09-03 12:08:41 -07:00
Google Open Source Bot
e95a517c76 [firebase-release] Removed change log and reset repo after 9.17.0 release 2021-09-01 20:04:11 +00:00
Google Open Source Bot
679a058339 9.17.0 2021-09-01 20:03:42 +00:00
David East
55f339ba2c Use compatibility library for hosting initialization (#3724)
* add compat files

* changelog

* Update CHANGELOG.md

Co-authored-by: Bryan Kendall <bkend@google.com>

Co-authored-by: Bryan Kendall <bkend@google.com>
Co-authored-by: joehan <joehanley@google.com>
2021-09-01 12:55:06 -07:00
Yuchen Shi
ad463c1293 Release Emulator UI v1.6.3. (#3725) 2021-09-01 11:48:11 -07:00
dependabot[bot]
33e213a77f Bump tar from 4.4.15 to 4.4.18 (#3721)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.15 to 4.4.18.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.15...v4.4.18)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bryan Kendall <bkend@google.com>
2021-09-01 10:25:51 -07:00
joehan
6a4a484b31 Add CHANGELOG.md to ext:dev:init (#3682)
* Add CHANGELOG.md to ext:dev:init

* finishing my sentences

* typo

* formats
2021-09-01 09:30:53 -07:00
Michael Bleigh
1af708fdb6 Fixes error when passing project number as flag. (#3718) 2021-08-31 22:43:58 -07:00
joehan
dd4dc1297c Display releaseNotes during ext:update, and streamline ext:update code (#3672)
* Display releaseNotes during ext:update, and streamline ext:update code in general

* Add typing to silence linter issues

* adding jsdoc comments

* bolding after UX feedback

* pr fixes

* Check for and display CHANGELOG.md during ext:dev:publish (#3693)

* save my place

* implement parseChangelog

* check for changelog on ext:dev:publish

* adding changelog
2021-08-31 16:30:28 -07:00
Michael Bleigh
c2feb0836f Preps functions for "nodejs16" support (#3621) 2021-08-26 13:36:42 -07:00
Google Open Source Bot
72988318b1 [firebase-release] Removed change log and reset repo after 9.16.6 release 2021-08-25 23:50:42 +00:00
Google Open Source Bot
900148d8f8 9.16.6 2021-08-25 23:50:12 +00:00
Daniel Lee
0f8dd7dfb3 Fix bug where dotenv file using quotes greedily consumes values. (#3703)
Our parser for dotenv file format allows values to be wrapped inside single or double quotes.

The regex we have for parsing these value is too greedy as implemented:

```
# .env
A="abc"
B="efg"
```

```
parse(readFileSync(".env"))
=> { A: 'abc\nB="efg"' }
```

The change in regex correctly parses the dotenv file:

```
parse(readFileSync(".env"))
=> { A: "abc", B: "efg"  }
```
2021-08-25 14:35:53 -07:00
Daniel Lee
54a3f85534 Fix bug where ESM module load fails on windows. (#3692)
Patch allows Windows users to deploy Firebase Functions packaged as ES module.

We apply the same fix we made for Windows ES module support in the Functions Emulator (https://github.com/firebase/firebase-tools/pull/3574) to the triggerParser script.

Fixes https://github.com/firebase/firebase-tools/issues/3689
2021-08-25 12:26:25 -07:00
Daniel Lee
91f38b8df4 Track usage of runtime config and dotenv on function deploys. (#3704)
Also includes a small refactor to make arguments for user env functions consistent.
2021-08-24 20:43:54 -07:00
joehan
936b9f9756 adds withForce to command, to standardize the --force flag (#3700) 2021-08-23 16:02:37 -07:00
Cole Rogers
8651329371 moving invoker into trigger block (#3696) 2021-08-23 16:14:10 -04:00
Lee Kellogg
eedf0c469a Make max backoff configurable in OperationPoller (#3687) 2021-08-18 11:44:34 -07:00
Cole Rogers
037b7ea349 HTTP Invoker for v2 functions (#3683)
* adding invoker to replace allUsers

* fixing build issues

* adding tests

* update function names, clean up comments

* add invoker option when parsing function from SDK

* fix service account format for IAM API

* fixing ts issues and added check for full service account

* cleaning up code for readability

* merged iam policy creation and set policy into setInvoker

* cleaning up old function and adding comments

* added unit tests

* fixing api version & removing import

* adding setInvoker to cloud run

* cleaning up

* lint fix

* fix reference

* added v2 invoker functions

* fixing pr comments
2021-08-16 15:08:40 -04:00
Google Open Source Bot
edd04ac17f [firebase-release] Removed change log and reset repo after 9.16.5 release 2021-08-13 23:33:55 +00:00
Google Open Source Bot
d1da89d4dd 9.16.5 2021-08-13 23:33:25 +00:00
joehan
3d5b8cdbb3 Fix an issue where emulator:exec would not work without a project ID (#3684)
* fix issue where the emulator:exec would not work without a project id

* add todo

* changelog!

* formats
2021-08-13 16:23:09 -07:00
Cole Rogers
397f0baea3 Set Access Control for HTTP Functions (v1) (#3619)
* adding invoker to replace allUsers

* fixing build issues

* adding tests

* update function names, clean up comments

* add invoker option when parsing function from SDK

* fix service account format for IAM API

* fixing ts issues and added check for full service account

* cleaning up code for readability

* merged iam policy creation and set policy into setInvoker

* cleaning up old function and adding comments

* added unit tests

* fixing api version & removing import

* fix test

* breaking out api calls to functions

* adding setInvoker for create and update, fixing pr issues

* changing 'private' skip and adding lodash compare to skip setting the same policy

* fix on update

* fixing small mistake in create vs update
2021-08-13 17:03:07 -04:00
Yuchen Shi
eb429dd1bc Fix signInWithPassword not updating lastLoginAt. (#3679) 2021-08-13 12:14:23 -07:00
Google Open Source Bot
f22ecc1457 [firebase-release] Removed change log and reset repo after 9.16.4 release 2021-08-13 17:39:56 +00:00
Google Open Source Bot
fcbec041b0 9.16.4 2021-08-13 17:39:26 +00:00
Yuchen Shi
a390f9ef72 Fix auth_time in Auth Emulator. (#3674)
* Fix auth_time in Auth Emulator.

* Update CHANGELOG.md
2021-08-13 10:29:18 -07:00
Google Open Source Bot
b29b3e257d [firebase-release] Removed change log and reset repo after 9.16.3 release 2021-08-12 19:25:45 +00:00
Google Open Source Bot
d939363ce8 9.16.3 2021-08-12 19:25:13 +00:00
Daniel Lee
3acf49d215 Add changelog entry for function deploy fix. (#3669)
* Add changelog entry.

* Prettier please.

Co-authored-by: Bryan Kendall <bkend@google.com>
2021-08-12 11:47:04 -07:00
Daniel Lee
592a4ee6cb Fix Firebase Function deploy bugs. (#3668)
This is embarrassing. I must have removed the preview check while refactoring the code after PR feedback. Also improving the logging logic to not log anything if no local dotenv files are found.

Also addresses bug where wrong `FIREBASE_CONFIG` value was set https://github.com/firebase/firebase-tools/issues/3667
2021-08-12 11:23:12 -07:00
Google Open Source Bot
b22e912e42 [firebase-release] Removed change log and reset repo after 9.16.2 release 2021-08-12 01:05:45 +00:00
Google Open Source Bot
4bef3cec7a 9.16.2 2021-08-12 01:05:15 +00:00
Bryan Kendall
574660a2e5 fix track import in functions release (#3665)
* fix track import in functions release

* upgrade firebase-functions libraries

* Fix require issue with new firebase-functions version.

Co-authored-by: Michael Bleigh <bleigh@google.com>
2021-08-11 17:57:24 -07:00
Daniel Lee
d9aaaec1f3 Deploy environment variables in dotenv files for functions (#3645)
Add support for setting up environment variables for functions using dotenv files.

On deploy, Firebase CLI looks for naive dotenv file (`.env`) file or project-specific ones (`.env.<project id>` or `.env.<project alias>`) files, loads environment variables, and injects them on deployed functions. Environment variable set in project-specific dotenv file wins, and you cannot have both `.<project id>` and `<.project alias>` files.

Environment variables are also loaded up on Firebase Emulators. Emulator will look for `.env` and `.env.local` files and ignore project-specific dotenv files.

We are hiding the feature behind `dotenv` preview flag. We want to get a feeling for the development experience from our users before an official launch + documentations.

Also including a small e2e test for env var support. It's meant to run manually by the Firebase team via command `node scripts/test-functions-env.js`.
2021-08-11 13:31:18 -07:00
Google Open Source Bot
c1b3056247 [firebase-release] Removed change log and reset repo after 9.16.1 release 2021-08-11 19:14:53 +00:00
Google Open Source Bot
c4862cbd5a 9.16.1 2021-08-11 19:14:21 +00:00
Yuchen Shi
41aa0e5ab7 Release Firebase Emulator UI v1.6.2. (#3653)
* Release Firebase Emulator UI v1.6.1.

* Update CHANGELOG.md

* Release v1.6.2.

Co-authored-by: Bryan Kendall <bkend@google.com>
2021-08-11 12:02:29 -07:00
dependabot[bot]
95e128ac44 Bump path-parse from 1.0.6 to 1.0.7 in /scripts/firepit-builder (#3662)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bryan Kendall <bkend@google.com>
2021-08-11 11:48:39 -07:00
dependabot[bot]
325e4fecc3 Bump path-parse from 1.0.6 to 1.0.7 (#3660)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bryan Kendall <bkend@google.com>
2021-08-11 09:52:25 -07:00
Thomas Bouldin
0dc56ede54 Don't require trivial @returns per style guide (#3659)
Linter had a typo in the rule name. it's "returns" not "return" per https://github.com/gajus/eslint-plugin-jsdoc/blob/master/.README/rules/require-returns.md
2021-08-11 09:07:08 -07:00
Thomas Bouldin
bd67ccbcdd Replace fake server with nock (#3658)
* Replace fake server with nock

* remove unused imports
2021-08-10 16:05:59 -07:00
Thomas Bouldin
f2e9c1300b Revert "Remove import eslint module" (#3655)
This reverts commit 413fbc46d8641da2d9e96f8561ccb1cbe46976d9.
2021-08-10 10:00:29 -07:00
Thomas Bouldin
e38d25c1e4 Add retries for Docker APIs (#3643)
Blind attempt to fix #3639 before I get debug logs.

Normally I'd worry that we hit a rate limit, but according to [docs](https://cloud.google.com/container-registry/quotas) the rate limit is 50K requests per 10m. Even with an API this chatty it's unlikely to hit the limit...

Without knowing any more info, we can realize that an API as chatty as Docker is likely to fail just through statistics. Deleting 15 functions would probably require 60-75 API calls. If gcr.io is a 3-9s service, that's a 6% chance of failure.
2021-08-09 19:43:05 -07:00
Thomas Bouldin
31a29f59e7 Track functions deploys (#3646)
* Track functions deploys

* PR feedback
2021-08-09 19:23:44 -07:00
Cole Rogers
98ff7f72f9 Delete GCR Images (#3586)
* created inital functionality to purge from gcr, added unit tests

* fixing lint issues

* fill out the command with options

* add regions to unit test

* change wording and error type

* change from using a class to a single function

* fixing lint issues

* fix wording

* adding gcf search functionality, updating API per approved proposal

* fix confirmation message

* refactoring code, adding parallel work, and fixing issues

* fixing lint

* lint

* fix lambda newline issue

* refactoring and cleaning up code

* fix lambda

* removing tsdoc

* fix pr comments

* fix how we get the projectId

* fix lint
2021-08-09 12:47:16 -04:00
Thomas Bouldin
a8835e837c Bugbash fixes (#3644)
* Print function names on validation errors, not [Object object]

* Require all necessary APIs

* Remove import eslint module

The import module does not currenty handle package exports.
The author is apparently of the opinion that exports should not
use renaming features. Until this is fixed, all of the v2
API is broken.

See https://github.com/import-js/eslint-plugin-import/issues/1810
for more info.

* Linter fixes
2021-08-05 22:05:38 -07:00