Skip to content

Latest commit

 

History

History
49 lines (25 loc) · 4.57 KB

File metadata and controls

49 lines (25 loc) · 4.57 KB

BUILD.md

Instructions for building and validating a new BC Building code JSON file

Process overview - how the BCBC JSON file gets created in the first place

The BCBC.json file BuildingCode.json gets built through transforming the NBC XML file in json-generation-pipeline/source/nbc-2020-xml , applying amendments in word documents and xml documents in json-generation-pipeline/source/bc-amendments and applying revisions from ministerial orders in json-generation-pipeline/source/bc-revisions

The architecture is shown below BCBC pipeline architecture

The process involves multiple XSLT transformations using the Oxygen XML tool which can be automated through calling the Oxygen API through Java command-line calls. This process is well documented in json-generation-pipeline/docs/README.md

Note that the development process creates a new BCBC JSON in location BC-Building-Code/json-generation-pipeline/output/bc-building-code.json , as well as a schema change (if applicable) to file BC-Building-Code/json-generation-pipeline/output/bc-building-code-schema.json. It is necessary to copy these files manually to BuildingCode.json and schema.json resp. The best way to do this is to check out the BuildingCode.json and schema.json files on a branch off the develop branch (probably the same branch you used to generate the new JSON file) and replace the content with that of the generated file BC-Building-Code/json-generation-pipeline/output/bc-building-code.json and BC-Building-Code/json-generation-pipeline/output/bc-building-code-schema.json resp. ,then raise a PR to merge the files to the develop branch.

BCBC JSON file validation

Once a new JSON file has been generated, it needs to be validated. This process is described in docs/VALIDATION_PIPELINE.md.

The validation process is run when a merge attempt at a pull request is performed onto the dev branch. Hence the need to do development work on the JSON file on a branch OFF the develop branch, then open a PR to merge back onto the dev branch.

Using the new BCBC JSON file

Most likely the next integration point will be using the newly generated and validated JSON files (schema and content) in the BCBC Viewer. There are 2 possibilities - the first being an UPGRADE of the existing BCBC JSON schema and content files (for example , correcting an error , or adding a new amendment ), the second being the addition of a completely new version of the BCBC JSON to co-exist with the existing version (selectable in the UI). For the former, the easiest way to achieve this is to replace the existing BCBC JSON and schema files in the repo https://github.com/bcgov/HOUS-Interactive-BCBC , at the time of writing , these versions were called bcbc-2024.json and bc-building-code-schema.json resp. - but they may have been replaced with later versions - so check out the current version in file versions.json Check out these files on the develop branch, replace the content with the new files and commit them.

Instructions for achieving the second goal are contained here https://github.com/bcgov/HOUS-Interactive-BCBC/blob/develop/docs/HOW-TO-ADD-NEW-VERSION.md

Image files

The BCBC JSON file references a number of static mages in the following folders :

bc-graphics

graphics

. If these change or are updated manually, they need to be checked into the corresponding folders on the viewer repo

https://github.com/bcgov/HOUS-Interactive-BCBC/tree/develop/apps/web/public/bc-graphics

https://github.com/bcgov/HOUS-Interactive-BCBC/tree/develop/apps/web/public/graphics

Note

There is a trigger which gets triggered on the successful creation of the new artifacts on the building code repo, which calls an action on the viewer repository which creates a branch, copies the BCBC JSON and schema files into bcbc-2024.json and bc-building-code-schema.json resp. and unzips the image files into the image folders bc-images and images.

In other words, all that should be necessary is the merging of the PR onto the develop branch on the https://github.com/bcgov/HOUS-Interactive-BCBC repo, and the automatic deployment of the new files should occur.