Bug 1792224: Do not allow tag tracking with individual-files r=jewilde

Differential Revision: https://phabricator.services.mozilla.com/D158050
This commit is contained in:
Tom Ritter 2022-10-18 16:56:07 +00:00
parent 012f41dcbf
commit 29b7dc88dc
2 changed files with 40 additions and 0 deletions

View File

@ -788,6 +788,34 @@ bugzilla:
b"""
---
schema: 1
origin:
name: cairo
description: 2D Graphics Library
url: https://www.cairographics.org/
release: version 1.6.4
license:
- MPL-1.1
- LGPL-2.1
revision: AA001122334455
vendoring:
url: https://example.com
source-hosting: gitlab
tracking: tag
flavor: individual-files
individual-files:
- upstream-src: foo
dst: bar
bugzilla:
product: Core
component: Graphics
""".strip(),
),
# -------------------------------------------------
(
"exception",
b"""
---
schema: 1
origin:
name: cairo
description: 2D Graphics Library

View File

@ -526,6 +526,18 @@ def _schema_1_additional(filename, manifest, require_license_file=True):
"If Updatebot tasks are specified, a vendoring url must be included."
)
# Because the only way we can determine the latest tag is by doing a local clone,
# we don't want to do that for individual-files flavors because those flavors are
# usually on gigantic repos we don't want to clone for such a simple thing.
if (
"vendoring" in manifest
and manifest["vendoring"].get("flavor", "regular") == "individual-files"
and manifest["vendoring"].get("tracking", "commit") == "tag"
):
raise ValueError(
"You cannot use tag tracking with the individual-files flavor. (Sorry.)"
)
# The Rust and Individual Flavor type precludes a lot of options
# individual-files could, in theory, use several of these, but until we have a use case let's
# disallow them so we're not worrying about whether they work. When we need them we can make