|
|
@@ -24,6 +24,18 @@ def hasChangesIn(paths)
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
+# Determine if any new files were added to paths matching any of the
|
|
|
+# path patterns provided.
|
|
|
+def hasAdditionsIn(paths)
|
|
|
+ path_array = Array(paths)
|
|
|
+ path_array.each do |dir|
|
|
|
+ if !git.added_files.grep(/#{dir}/).empty?
|
|
|
+ return true
|
|
|
+ end
|
|
|
+ end
|
|
|
+ return false
|
|
|
+end
|
|
|
+
|
|
|
# Adds the provided labels to the current PR.
|
|
|
def addLabels(label_array)
|
|
|
issue_number = github.pr_json["number"]
|
|
|
@@ -70,6 +82,27 @@ has_changelog_changes = hasChangesIn(["CHANGELOG"])
|
|
|
# Whether or not the LICENSE file has been modified or deleted.
|
|
|
has_license_changes = didModify(["LICENSE"])
|
|
|
|
|
|
+# A list of published Firebase products.
|
|
|
+@product_list = [
|
|
|
+ "ABTesting",
|
|
|
+ "AppCheck",
|
|
|
+ "AppDistribution",
|
|
|
+ "Analytics",
|
|
|
+ "Authentication",
|
|
|
+ "Core",
|
|
|
+ "Crashlytics",
|
|
|
+ "Database",
|
|
|
+ "DynamicLinks",
|
|
|
+ "Firestore",
|
|
|
+ "Functions",
|
|
|
+ "InAppMessaging",
|
|
|
+ "Installations",
|
|
|
+ "Messaging",
|
|
|
+ "Performance",
|
|
|
+ "RemoteConfig",
|
|
|
+ "Storage"
|
|
|
+]
|
|
|
+
|
|
|
## Product directories
|
|
|
@has_analytics_changes = hasChangesIn([
|
|
|
"FirebaseAnalyticsOnDeviceConversionWrapper",
|
|
|
@@ -118,6 +151,10 @@ has_license_changes = didModify(["LICENSE"])
|
|
|
@has_storage_changes = hasChangesIn("FirebaseStorage")
|
|
|
|
|
|
@has_releasetooling_changes = hasChangesIn("ReleaseTooling/")
|
|
|
+@has_public_additions = hasAdditionsIn("Public/")
|
|
|
+
|
|
|
+@has_umbrella_changes =
|
|
|
+ @product_list.reduce(false) { |accum, product| accum || hasChangesIn("Firebase#{product}.h") }
|
|
|
|
|
|
# Convenient flag for all API changes.
|
|
|
@has_api_changes = @has_abtesting_api_changes ||
|
|
|
@@ -164,6 +201,14 @@ if has_sdk_changes
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+# Warn if a new public header file is added but no umbrella header changes
|
|
|
+# are detected. Prevents regression of #10301
|
|
|
+if @has_public_additions && !@has_umbrella_changes
|
|
|
+ error = "New public headers were added, "\
|
|
|
+ "did you remember to add them to the umbrella header?"
|
|
|
+ warn(error)
|
|
|
+end
|
|
|
+
|
|
|
# Error on license edits
|
|
|
fail("LICENSE changes are explicitly disallowed.") if has_license_changes
|
|
|
|