Skip to content

Commit

Permalink
feat!: remove validate_labels
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmccormick committed Jun 17, 2023
1 parent 56a51f7 commit f087ea8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 32 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ Change Log
This project adheres to Semantic Versioning (https://semver.org/).


2023-05-30
~~~~~~~~~~
2.0 (2023-06-20)
~~~~~~~~~~~~~~~~

* Delete ``validate_labels``, since ``labels.yaml`` is not longer used by
openedx-webhooks.


1.1 (2023-05-30)
~~~~~~~~~~~~~~~~

* Make it valid for ORGS, LABELS, and PEOPLE to be empty. This was prompted
because we actually want LABELS to be empty as an intermediate step towards
Expand Down
4 changes: 2 additions & 2 deletions repo_tools_data_schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Schema for repo-tools-data.
"""

__version__ = '1.1'
__version__ = '2.0'

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
28 changes: 0 additions & 28 deletions repo_tools_data_schema/repo_tools_data_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,26 +199,6 @@ 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,14 +223,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):
"""
Expand Down

0 comments on commit f087ea8

Please sign in to comment.