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

View File

@ -115,10 +115,6 @@ updatebot:
# Bugzilla email address for a maintainer of the library, used for needinfos
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
# optional
tasks:
@ -149,6 +145,10 @@ vendoring:
# Valid values are 'gitlab', 'github', googlesource
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.
# If omitted, will default to the location the moz.yaml file is in.
vendor-directory: third_party/directory
@ -372,7 +372,6 @@ def _schema_1():
"updatebot": {
Required("maintainer-phab"): All(str, Length(min=1)),
Required("maintainer-bz"): All(str, Length(min=1)),
"tracking": All(str, Length(min=1)),
"tasks": All(
UpdatebotTasks(),
[
@ -403,6 +402,7 @@ def _schema_1():
Length(min=1),
In(VALID_SOURCE_HOSTS, msg="Unsupported Source Hosting"),
),
"tracking": All(str, Length(min=1)),
"skip-vendoring-steps": Unique([str]),
"vendor-directory": All(str, Length(min=1)),
"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:
raise ValueError('"vendoring" requires an "origin"')
# 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 "tracking" not in manifest["updatebot"]:
manifest["updatebot"]["tracking"] = "commit"
# Only commit and tag are allowed for tracking
if "vendoring" in manifest:
if "tracking" not in manifest["vendoring"]:
manifest["vendoring"]["tracking"] = "commit"
if (
manifest["updatebot"]["tracking"] != "commit"
and manifest["updatebot"]["tracking"] != "tag"
manifest["vendoring"]["tracking"] != "commit"
and manifest["vendoring"]["tracking"] != "tag"
):
raise ValueError(
"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"]:
raise ValueError(
"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
# moz.yaml files but missing updatebot information
if "updatebot" in self.manifest:
ref_type = self.manifest["updatebot"]["tracking"]
if "vendoring" in self.manifest:
ref_type = self.manifest["vendoring"]["tracking"]
if ref_type == "tag":
ref, timestamp = self.source_host.upstream_tag(revision)
else: