Skip to content

Commit

Permalink
Prepare for next release after public/private split
Browse files Browse the repository at this point in the history
The concept of this project has changed significantly, with production
data now being maintained in a separate private repo and the API being
revised to return raw dicts for the loaded data.

Make a few changes to prepare for the first release with the project's
revised scope:

- rewrite docs to ensure accuracy, given the revised concept of the
  project. This mainly consisted of removing docs which no longer
  make sense, including the entire "maintenance guide" - we would
  expect docs like this now to be maintained internally.

- call out this change for the project in the Changelog

- for the data file, since various new fields were added
  backwards-compatibly, the minor version should be bumped
  (1.0.0 => 1.1.0).

- for the project itself, although technically the changes we've made
  are backwards-compatible at the python API level (e.g. rhui_alias
  still exists), it seems appropriate to bump the major version.
  Changing the data maintained in this project from real to dummy data
  and requiring real data to be loaded from elsewhere is conceptually
  backwards-incompatible, and worth drawing attention to with a major
  version bump.
  • Loading branch information
rohanpm committed Mar 1, 2021
1 parent 9a9b853 commit 1616f86
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 155 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- n/a
### Changed

- The concept of the project has changed significantly. The `cdn-definitions` project
now contains only placeholder data, a schema and a small convenience API for loading
data. When used in production, it is now necessary to combine `cdn-definitions` with a
separately maintained (e.g. private) data set.

### Added

- `load_data`, `load_schema` functions were added.

### Deprecated

- `rhui_aliases`, `origin_aliases` and `PathAlias` are now deprecated.

## [1.3.0] - 2020-06-30

Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ Data definitions for Red Hat's content delivery network.
- [Documentation](https://release-engineering.github.io/cdn-definitions/)
- [PyPI](https://pypi.org/project/cdn-definitions)

This project maintains a dataset defining and influencing certain behaviors
This project assists with the maintenance of a dataset influencing certain behaviors
of Red Hat's CDN, such as aliases between paths.

To get an idea of the type of data maintained within this project, you can
[browse the latest published dataset](https://release-engineering.github.io/cdn-definitions/data.yaml).

See the
[User Guide](https://release-engineering.github.io/cdn-definitions/userguide.html#) for more information
if you are interested in consuming this data, or the
[Maintenance Guide](https://release-engineering.github.io/cdn-definitions/maint.html#) if you need
to make changes.
if you are interested in consuming this data.

License
-------
Expand Down
2 changes: 1 addition & 1 deletion docs/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Data
CDN definitions
---------------

This dataset contains the latest version of CDN definitions.
This dataset contains placeholder/reference data.

It is also available in raw JSON or YAML format at URLs:

Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Data definitions for Red Hat's content delivery network.
:caption: Contents:

userguide
maint
data
116 changes: 0 additions & 116 deletions docs/maint.rst

This file was deleted.

37 changes: 11 additions & 26 deletions docs/userguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@ User Guide
==========


Usage as online dataset
-----------------------

The latest version of this dataset can be downloaded at any time from URLs:

- https://release-engineering.github.io/cdn-definitions/data.json
- https://release-engineering.github.io/cdn-definitions/data.yaml

Both files contain equivalent data.




Usage as packaged dataset
-------------------------

This dataset is available as an RPM from selected Red Hat internal repositories.

- Enable ``eng-rhel-6``, ``eng-rhel-7`` or equivalent yum repository on the target system.
- Install the ``cdn-definitions`` package. This package has no dependencies.
- Load data from ``/usr/share/cdn-definitions/data.json``
or ``/usr/share/cdn-definitions/data.yaml``.


Usage as Python library
-----------------------

Expand All @@ -50,13 +26,22 @@ the ``cdn_definitions`` module, as in example:
# my path falls under a /rhui/ alias,
# so now do something special
If a source is not specified, the library will use data from the first existing of the following sources:
If a source is not specified, the library will use data from the first existing of the following
sources:

- A JSON or YAML file pointed at by the ``CDN_DEFINITIONS_PATH`` environment variable.
- The file bundled with the library on PyPI.
- ``/usr/share/cdn-definitions/data.yaml``.

To ensure the most up-to-date definitions, upgrade the package from PyPI.
Note that loading from the release-engineering/cdn-definitions repo as seen above will yield
placeholder/reference data. This reference data aims to give a general idea of the data's
structure and purpose, and also enable automated testing within downstream projects consuming
cdn-definitions.

However, in production scenarios it will be necessary to deploy your code pointing at a genuine
data set. This will typically be accomplished either by calling ``load_data`` passing the URL of
an internal data set, or ensuring that ``CDN_DEFINITIONS_PATH`` is set appropriately where your
code is deployed.


Python reference
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_long_description():

setup(
name="cdn-definitions",
version="1.3.0",
version="2.0.0",
author="Rohan McGovern",
author_email="rmcgover@redhat.com",
packages=find_packages("src"),
Expand Down
2 changes: 1 addition & 1 deletion src/cdn_definitions/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,5 @@
"tps_variant_mappings": {
"example-arch": "Example-Variant"
},
"version": "1.0.0"
"version": "1.1.0"
}
2 changes: 1 addition & 1 deletion src/cdn_definitions/data.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# Version of this data structure's format.
# Version string is maintained in accordance with SemVer.
version: "1.0.0"
version: "1.1.0"

# Aliases between paths used for consuming content under RHUI entitlements.
#
Expand Down

0 comments on commit 1616f86

Please sign in to comment.