Skip to content

Commit

Permalink
Don't block emulator Rules deploy on warnings (firebase#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottcrossen authored and samtstern committed Jan 27, 2020
1 parent dee2971 commit 265cfde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
7 changes: 1 addition & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/emulator/firestoreEmulator.ts
@@ -1,4 +1,3 @@
import * as _ from "lodash";
import * as chokidar from "chokidar";
import * as fs from "fs";
import * as request from "request";
Expand All @@ -8,7 +7,7 @@ import * as pf from "portfinder";

import * as utils from "../utils";
import * as javaEmulators from "../serve/javaEmulators";
import { EmulatorInfo, EmulatorInstance, Emulators } from "../emulator/types";
import { EmulatorInfo, EmulatorInstance, Emulators, Severity } from "../emulator/types";
import { EmulatorRegistry } from "./registry";
import { Constants } from "./constants";
import { Issue } from "./types";
Expand Down Expand Up @@ -45,10 +44,12 @@ export class FirestoreEmulator implements EmulatorInstance {

utils.logLabeledBullet("firestore", "Change detected, updating rules...");
const issues = await this.updateRules(newContent);
if (issues && issues.length > 0) {
if (issues) {
for (const issue of issues) {
utils.logWarning(this.prettyPrintRulesIssue(rulesPath, issue));
}
}
if (issues.some((issue) => issue.severity === Severity.ERROR)) {
utils.logWarning("Failed to update rules");
} else {
utils.logLabeledSuccess("firestore", "Rules updated.");
Expand Down

0 comments on commit 265cfde

Please sign in to comment.