Bug 1743688: Moving tracking from updatebot to vendoring r=jewilde

It occurs to me that because tracking is a general vendoring need
(not just for updatebot) that it should live under vendoring.

Depends on D129437

Differential Revision: https://phabricator.services.mozilla.com/D129533
This commit is contained in:
Tom Ritter 2022-01-04 20:53:28 +00:00
parent b9b257ce6d
commit afeb3634ae
3 changed files with 22 additions and 19 deletions

View File

@ -143,11 +143,11 @@ updatebot:
"vendoring": { "vendoring": {
"url": "https://example.com", "url": "https://example.com",
"source-hosting": "gitlab", "source-hosting": "gitlab",
"tracking": "commit",
}, },
"updatebot": { "updatebot": {
"maintainer-phab": "tjr", "maintainer-phab": "tjr",
"maintainer-bz": "a@example.com", "maintainer-bz": "a@example.com",
"tracking": "commit",
"tasks": [{"type": "commit-alert"}], "tasks": [{"type": "commit-alert"}],
}, },
}, },
@ -192,11 +192,11 @@ updatebot:
"vendoring": { "vendoring": {
"url": "https://example.com", "url": "https://example.com",
"source-hosting": "gitlab", "source-hosting": "gitlab",
"tracking": "commit",
}, },
"updatebot": { "updatebot": {
"maintainer-phab": "tjr", "maintainer-phab": "tjr",
"maintainer-bz": "a@example.com", "maintainer-bz": "a@example.com",
"tracking": "commit",
"tasks": [ "tasks": [
{"type": "commit-alert", "frequency": "release"}, {"type": "commit-alert", "frequency": "release"},
{ {
@ -225,6 +225,7 @@ origin:
revision: AA001122334455 revision: AA001122334455
vendoring: vendoring:
url: https://example.com url: https://example.com
tracking: commit
source-hosting: gitlab source-hosting: gitlab
bugzilla: bugzilla:
product: Core product: Core
@ -232,7 +233,6 @@ bugzilla:
updatebot: updatebot:
maintainer-phab: tjr maintainer-phab: tjr
maintainer-bz: a@example.com maintainer-bz: a@example.com
tracking: commit
tasks: tasks:
- type: commit-alert - type: commit-alert
frequency: release frequency: release
@ -260,12 +260,12 @@ updatebot:
"bugzilla": {"component": "Graphics", "product": "Core"}, "bugzilla": {"component": "Graphics", "product": "Core"},
"vendoring": { "vendoring": {
"url": "https://example.com", "url": "https://example.com",
"tracking": "commit",
"source-hosting": "gitlab", "source-hosting": "gitlab",
}, },
"updatebot": { "updatebot": {
"maintainer-phab": "tjr", "maintainer-phab": "tjr",
"maintainer-bz": "a@example.com", "maintainer-bz": "a@example.com",
"tracking": "commit",
"tasks": [ "tasks": [
{ {
"type": "vendoring", "type": "vendoring",

View File

@ -115,10 +115,6 @@ updatebot:
# Bugzilla email address for a maintainer of the library, used for needinfos # Bugzilla email address for a maintainer of the library, used for needinfos
maintainer-bz: tom@mozilla.com maintainer-bz: tom@mozilla.com
# Type of git reference (commit, tag) to track updates from.
# If omitted, will default to tracking commits.
tracking: commit
# The tasks that Updatebot can run. Only one of each task is currently permitted # The tasks that Updatebot can run. Only one of each task is currently permitted
# optional # optional
tasks: tasks:
@ -149,6 +145,10 @@ vendoring:
# Valid values are 'gitlab', 'github', googlesource # Valid values are 'gitlab', 'github', googlesource
source-hosting: gitlab source-hosting: gitlab
# Type of git reference (commit, tag) to track updates from.
# If omitted, will default to tracking commits.
tracking: commit
# Base directory of the location where the source files will live in-tree. # Base directory of the location where the source files will live in-tree.
# If omitted, will default to the location the moz.yaml file is in. # If omitted, will default to the location the moz.yaml file is in.
vendor-directory: third_party/directory vendor-directory: third_party/directory
@ -372,7 +372,6 @@ def _schema_1():
"updatebot": { "updatebot": {
Required("maintainer-phab"): All(str, Length(min=1)), Required("maintainer-phab"): All(str, Length(min=1)),
Required("maintainer-bz"): All(str, Length(min=1)), Required("maintainer-bz"): All(str, Length(min=1)),
"tracking": All(str, Length(min=1)),
"tasks": All( "tasks": All(
UpdatebotTasks(), UpdatebotTasks(),
[ [
@ -403,6 +402,7 @@ def _schema_1():
Length(min=1), Length(min=1),
In(VALID_SOURCE_HOSTS, msg="Unsupported Source Hosting"), In(VALID_SOURCE_HOSTS, msg="Unsupported Source Hosting"),
), ),
"tracking": All(str, Length(min=1)),
"skip-vendoring-steps": Unique([str]), "skip-vendoring-steps": Unique([str]),
"vendor-directory": All(str, Length(min=1)), "vendor-directory": All(str, Length(min=1)),
"patches": Unique([str]), "patches": Unique([str]),
@ -468,19 +468,22 @@ def _schema_1_additional(filename, manifest, require_license_file=True):
if "vendoring" in manifest and "origin" not in manifest: if "vendoring" in manifest and "origin" not in manifest:
raise ValueError('"vendoring" requires an "origin"') raise ValueError('"vendoring" requires an "origin"')
# If there are Updatebot tasks, then certain fields must be present and # Only commit and tag are allowed for tracking
# defaults need to be set. if "vendoring" in manifest:
if "updatebot" in manifest and "tasks" in manifest["updatebot"]: if "tracking" not in manifest["vendoring"]:
if "tracking" not in manifest["updatebot"]: manifest["vendoring"]["tracking"] = "commit"
manifest["updatebot"]["tracking"] = "commit"
if ( if (
manifest["updatebot"]["tracking"] != "commit" manifest["vendoring"]["tracking"] != "commit"
and manifest["updatebot"]["tracking"] != "tag" and manifest["vendoring"]["tracking"] != "tag"
): ):
raise ValueError( raise ValueError(
"Only commit or tag is supported for git references to track, %s was given." "Only commit or tag is supported for git references to track, %s was given."
% manifest["updatebot"]["tracking"] % manifest["vendoring"]["tracking"]
) )
# If there are Updatebot tasks, then certain fields must be present and
# defaults need to be set.
if "updatebot" in manifest and "tasks" in manifest["updatebot"]:
if "vendoring" not in manifest or "url" not in manifest["vendoring"]: if "vendoring" not in manifest or "url" not in manifest["vendoring"]:
raise ValueError( raise ValueError(
"If Updatebot tasks are specified, a vendoring url must be included." "If Updatebot tasks are specified, a vendoring url must be included."

View File

@ -36,8 +36,8 @@ class VendorManifest(MozbuildObject):
# Check that updatebot key is available for libraries with existing # Check that updatebot key is available for libraries with existing
# moz.yaml files but missing updatebot information # moz.yaml files but missing updatebot information
if "updatebot" in self.manifest: if "vendoring" in self.manifest:
ref_type = self.manifest["updatebot"]["tracking"] ref_type = self.manifest["vendoring"]["tracking"]
if ref_type == "tag": if ref_type == "tag":
ref, timestamp = self.source_host.upstream_tag(revision) ref, timestamp = self.source_host.upstream_tag(revision)
else: else: