Skip to content

Commit

Permalink
feat!: we no longer validate old-style labels.yaml files (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat authored Jul 26, 2023
1 parent 56a51f7 commit d54f4df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Change Log
This project adheres to Semantic Versioning (https://semver.org/).


2023-07-25
~~~~~~~~~~

* Removed validation of labels.yaml files. The OSPR bot no longer reads
labels.yaml, so that file will be deleted.

2023-05-30
~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion repo_tools_data_schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__version__ = '1.1'

from .repo_tools_data_schema import validate_labels, validate_orgs, validate_people, validate_salesforce_export
from .repo_tools_data_schema import validate_orgs, validate_people, validate_salesforce_export
33 changes: 0 additions & 33 deletions repo_tools_data_schema/repo_tools_data_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,30 +195,6 @@ def _check(d):
)


def color(s):
return re.match(r"^[a-fA-F0-9]{6}$", s)


LABELS_SCHEMA = Schema(
Or(
{
str: Or(
# A label we don't want:
{
"delete": True,
},
# A label we want:
{
"color": color,
Optional("description"): str,
},
),
},
{},
),
)


# Prevent duplicate keys in YAML.
# Adapted from https://gist.github.com/pypt/94d747fe5180851196eb
# from https://bitbucket.org/xi/pyyaml/issues/9/ignore-duplicate-keys-and-send-warning-or
Expand All @@ -243,15 +219,6 @@ def mapping_constructor(loader, node, deep=False):

# The public functions.

def validate_labels(filename):
"""
Validate that `filename` conforms to our labels.yaml schema.
"""
with open(filename) as f:
labels = yaml.safe_load(f)
LABELS_SCHEMA.validate(labels)


def validate_orgs(filename):
"""
Validate that `filename` conforms to our orgs.yaml schema.
Expand Down

0 comments on commit d54f4df

Please sign in to comment.