Skip to content

Commit

Permalink
Update README.rst with new updateSchema.py instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmartradio committed Dec 5, 2023
1 parent 71b1914 commit 91d9215
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,26 @@ Steps to update the alert schema (for example, when the APDB schema is updated).
* ``setup -r .`` in this package's root.
* Checkout the ticket branch for your schema changes.
* Update the default ``schema_root`` kwarg in ``python/lsst/alert/packet/schemaRegistry.py:from_filesystem()`` to your new schema version number.
* Add a new schema in ``python/lsst/alert/packet/schema/``. Subsequent instructions assume you are in that directory.

* Recursively copy the latest schema directory to the next number (e.g. ``cp -rp 4/ 5/`` to add schema version 5 based on version 4, or ``cp -rp 4/0 4/1`` for a minor version bump). Subsequent directions assume you are in this new directory.
* New schemas are built from the apdb. Any changes to a field should be done in apdb.yaml, and any changes to what is included/excluded should be made in updateSchema.py.
* To update the schema, you must have the path to the apdb.yaml file and have chosen a version number. If the directory for your version
* does not already exist, ``updateSchema.py`` will create it.

* Rename all of the ``lsst.vX*`` files to the new version.
* Update the ``"namespace": "lsst.v5_0",`` line at the top of each ``*.avsc`` file to the new version.
* run ``python updateSchema.py /path/to/LSST/code/sdm_schemas/yml/apdb.yaml "6.0"`` All Generated files do not need to be altered.
* Navigate to the new schema. Copy in the previous ``lsst.vX_X.avsc`` file and ``lsst.vX_X.diaNondetectionLimit.avsc``.
* Within the two copied files, update ``"namespace": "lsst.vX_X",`` line at the top of each ``*.avsc`` file to the new version.
* Update the contents of those avro schema files to reflect the new schema.
* Update the sample alert packet in ``sample_data``:

* Update ``alert.json`` to reflect the new schema.
* Change the ``schema_root`` and ``get_by_version`` parameters in ``generate.py`` to your new verison number.
* Change the ``schema_root`` and ``get_by_version`` parameters in ``generate.py`` to your new version number.
* Run ``python generate.py`` to produce a new ``fakeAlert.avro`` file with data filled in from the updated json file above and using the new schema files you made earlier.

* Update the files ``*.avsc`` and ``*.json`` files in ``examples/`` to reflect the new schema.
* Update the contents of ``latest.txt`` to your new schema version number.

* Add all of your new and updated files to ``git``, commit them with a message that includes the new schema version number and why it was incremented, and push your new branch.
* Test your changes with ap_assocation and ap_verify (these steps may be more involved if your ticket branch impacts multiple packets):
* Test your changes with ap_association and ap_verify (these steps may be more involved if your ticket branch impacts multiple packets):

* Clone a local copy of `ap_association <https://github.com/lsst/ap_association/>`_ and cd into that directory.
* Setup ap_association with ``setup -kr .`` (``-k`` to "keep" your previously setup ``alert_packet``).
Expand Down

0 comments on commit 91d9215

Please sign in to comment.