mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1792224: Make the tracking field validation simpler r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D158049
This commit is contained in:
parent
8f09cde190
commit
012f41dcbf
@ -181,7 +181,6 @@ updatebot:
|
||||
"vendoring": {
|
||||
"url": "https://example.com",
|
||||
"source-hosting": "gitlab",
|
||||
"tracking": "commit",
|
||||
},
|
||||
"updatebot": {
|
||||
"maintainer-phab": "tjr",
|
||||
@ -232,7 +231,6 @@ updatebot:
|
||||
"vendoring": {
|
||||
"url": "https://example.com",
|
||||
"source-hosting": "gitlab",
|
||||
"tracking": "commit",
|
||||
},
|
||||
"updatebot": {
|
||||
"maintainer-phab": "tjr",
|
||||
@ -285,7 +283,6 @@ updatebot:
|
||||
"vendoring": {
|
||||
"url": "https://example.com",
|
||||
"source-hosting": "gitlab",
|
||||
"tracking": "commit",
|
||||
},
|
||||
"updatebot": {
|
||||
"maintainer-phab": "tjr",
|
||||
@ -405,7 +402,7 @@ updatebot:
|
||||
"vendoring": {
|
||||
"url": "https://example.com",
|
||||
"source-hosting": "gitlab",
|
||||
"tracking": "commit",
|
||||
"tracking": "tag",
|
||||
"flavor": "rust",
|
||||
},
|
||||
"updatebot": {
|
||||
@ -438,7 +435,7 @@ origin:
|
||||
revision: AA001122334455
|
||||
vendoring:
|
||||
url: https://example.com
|
||||
tracking: commit
|
||||
tracking: tag
|
||||
source-hosting: gitlab
|
||||
flavor: rust
|
||||
bugzilla:
|
||||
@ -473,7 +470,6 @@ updatebot:
|
||||
"bugzilla": {"component": "Graphics", "product": "Core"},
|
||||
"vendoring": {
|
||||
"url": "https://example.com",
|
||||
"tracking": "commit",
|
||||
"source-hosting": "gitlab",
|
||||
},
|
||||
"updatebot": {
|
||||
@ -552,7 +548,6 @@ updatebot:
|
||||
"bugzilla": {"component": "Graphics", "product": "Core"},
|
||||
"vendoring": {
|
||||
"url": "https://example.com",
|
||||
"tracking": "commit",
|
||||
"source-hosting": "gitlab",
|
||||
},
|
||||
"updatebot": {
|
||||
@ -631,7 +626,6 @@ updatebot:
|
||||
"bugzilla": {"component": "Graphics", "product": "Core"},
|
||||
"vendoring": {
|
||||
"url": "https://example.com",
|
||||
"tracking": "commit",
|
||||
"source-hosting": "gitlab",
|
||||
},
|
||||
"updatebot": {
|
||||
@ -757,7 +751,6 @@ updatebot:
|
||||
"bugzilla": {"component": "Graphics", "product": "Core"},
|
||||
"vendoring": {
|
||||
"url": "https://example.com",
|
||||
"tracking": "commit",
|
||||
"source-hosting": "gitlab",
|
||||
"flavor": "individual-files",
|
||||
"individual-files": [
|
||||
|
16
python/mozbuild/mozbuild/vendor/moz_yaml.py
vendored
16
python/mozbuild/mozbuild/vendor/moz_yaml.py
vendored
@ -124,6 +124,7 @@ vendoring:
|
||||
flavor: rust
|
||||
|
||||
# Type of git reference (commit, tag) to track updates from.
|
||||
# You cannot use tag tracking with the individual-files flavor
|
||||
# If omitted, will default to tracking commits.
|
||||
tracking: commit
|
||||
|
||||
@ -424,7 +425,7 @@ def _schema_1():
|
||||
Length(min=1),
|
||||
In(VALID_SOURCE_HOSTS, msg="Unsupported Source Hosting"),
|
||||
),
|
||||
"tracking": All(str, Length(min=1)),
|
||||
"tracking": Match(r"^(commit|tag)$"),
|
||||
"flavor": Match(r"^(regular|rust|individual-files)$"),
|
||||
"skip-vendoring-steps": Unique([str]),
|
||||
"vendor-directory": All(str, Length(min=1)),
|
||||
@ -517,19 +518,6 @@ def _schema_1_additional(filename, manifest, require_license_file=True):
|
||||
'If "vendoring" is present, "revision" must be present in "origin"'
|
||||
)
|
||||
|
||||
# Only commit and tag are allowed for tracking
|
||||
if "vendoring" in manifest:
|
||||
if "tracking" not in manifest["vendoring"]:
|
||||
manifest["vendoring"]["tracking"] = "commit"
|
||||
if (
|
||||
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["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"]:
|
||||
|
@ -91,7 +91,7 @@ class VendorManifest(MozbuildObject):
|
||||
# ==========================================================
|
||||
self.source_host = self.get_source_host()
|
||||
|
||||
ref_type = self.manifest["vendoring"]["tracking"]
|
||||
ref_type = self.manifest["vendoring"].get("tracking", "commit")
|
||||
flavor = self.manifest["vendoring"].get("flavor", "regular")
|
||||
|
||||
if revision == "tip":
|
||||
|
Loading…
Reference in New Issue
Block a user