Skip to content

Commit

Permalink
[6.0.0-dev.x] JSON schema support (finos#2690)
Browse files Browse the repository at this point in the history
* WIP

* Update DSL and Bundle version and add DeployJsonSchema codefresh step

* Merge cherry-pick

* Merge release note

* Fix exclusion

* Update PR link

---------

Co-authored-by: Minesh Patel <[email protected]>
  • Loading branch information
hugohills-regnosys and minesh-s-patel authored Feb 9, 2024
1 parent d9ba48f commit a72323a
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 10 deletions.
10 changes: 6 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# *Infrastructure - Dependency Update*
# _Infrastructure - Dependency Update_

_What is being released?_

This release updates the `rosetta-bundle` dependency.
This release updates the `rosetta-dsl` and `rosetta-bundle` dependencies.

Version updates include:
- `rosetta-bundle` 10.9.3: this release adds mapping support for XSD substitution groups, which fixes the issue related to the mapping of FpML oilPhysicalLeg xml elements.
- `rosetta-dsl` 9.5.0: Adds support for tabulating projection data. For further details see DSL release notes: https://github.com/REGnosys/rosetta-dsl/releases/tag/9.5.0.
- `rosetta-dsl` 9.6.0: DSL build and compile performance improvements. For further details see DSL release notes: https://github.com/REGnosys/rosetta-dsl/releases/tag/9.6.0.
- `rosetta-bundle` 10.12.0: Adds JSON schema code generator.

There are no changes to the model or test expectations.

_Review directions_

The changes can be reviewed in PR [#2673](https://github.com/finos/common-domain-model/pull/2673).
The changes can be reviewed in PR: [#2690](https://github.com/finos/common-domain-model/pull/2690)
19 changes: 17 additions & 2 deletions codefresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ steps:
releaseNameNotDefined: "${{TAG_REPO}} == true"
commands:
- cf_export RELEASE_NAME=${{TAG_NAME}}
- cf_export MAVEN_BUILD_PROFILES="daml,scala,typescript,golang,csharp8,csharp9,kotlin,python,full,gpg,excel"
- cf_export MAVEN_BUILD_PROFILES="daml,scala,typescript,golang,csharp8,csharp9,kotlin,python,full,gpg,excel,json-schema"
- cf_export MVN_DEPLOY_FILE_FLAGS="${{MVN_BUILD_FLAGS}} ${{MVN_DEPLOY_FLAGS}} -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2 -DrepositoryId=ossrh-distro -Dgpg.passphrase=${{GPG_PASSPHRASE}}"

SnapshotProperties:
Expand All @@ -49,7 +49,7 @@ steps:
releaseNameNotDefined: "${{TAG_REPO}} == false"
commands:
- cf_export RELEASE_NAME=${{GLOBAL_RELEASE_VERSION}}.${{CF_BRANCH_TAG_NORMALIZED}}-SNAPSHOT
- cf_export MAVEN_BUILD_PROFILES="daml,scala,typescript,golang,csharp8,csharp9,kotlin,python,gpg,excel"
- cf_export MAVEN_BUILD_PROFILES="daml,scala,typescript,golang,csharp8,csharp9,kotlin,python,gpg,excel,json-schema"
- cf_export MVN_DEPLOY_FILE_FLAGS="${{MVN_BUILD_FLAGS}} ${{MVN_DEPLOY_FLAGS}} -Durl=https://oss.sonatype.org/content/repositories/snapshots -DrepositoryId=ossrh -Dgpg.passphrase=${{GPG_PASSPHRASE}}"

Build:
Expand Down Expand Up @@ -252,6 +252,19 @@ steps:
- rm encoded.model.xlsx
- ${{GEN_DEPLOY_POM_SCRIPT}} cdm-excel ${{RELEASE_NAME}} xlsx
- mvn gpg:sign-and-deploy-file ${{MVN_DEPLOY_FILE_FLAGS}} -Dfile=cdm-excel-${{RELEASE_NAME}}.xlsx -DgroupId=org.finos.cdm -DartifactId=cdm-excel -Dversion=${{RELEASE_NAME}} -DpomFile=cdm-excel-${{RELEASE_NAME}}.pom
DeployJsonSchema:
stage: 'build'
title: JSON Schema deploy
fail_fast: false
image: maven:3.8.2-jdk-11
working_directory: ./rosetta-source/
shell: bash
commands:
- bash -c "${{GPG_IMPORT_COMMAND}}"
- cd src/generated
- tar -cvzf cdm-json-schema-${{RELEASE_NAME}}.zip jsonschema
- ${{GEN_DEPLOY_POM_SCRIPT}} cdm-json-schema ${{RELEASE_NAME}} zip
- mvn gpg:sign-and-deploy-file ${{MVN_DEPLOY_FILE_FLAGS}} -Dfile=cdm-json-schema-${{RELEASE_NAME}}.zip -DgroupId=org.finos.cdm -DartifactId=cdm-json-schema -Dversion=${{RELEASE_NAME}} -DpomFile=cdm-json-schema-${{RELEASE_NAME}}.pom

NotifySlackOnFail:
stage: 'finalise'
Expand All @@ -278,6 +291,7 @@ steps:
deployKotlinFailed: steps.DeployKotlin.result == 'error'
deployPythonFailed: steps.DeployPython.result == 'error'
deployExcelFailed: steps.DeployExcel.result == 'error'
deployJsonSchemaFailed: steps.DeployJsonSchema.result == 'error'
commands:
- export SAFE_COMMIT_AUTHOR='${{CF_COMMIT_AUTHOR}}'
- export COMMIT_AUTHOR=${SAFE_COMMIT_AUTHOR:-MissingAuthor}
Expand Down Expand Up @@ -311,6 +325,7 @@ steps:
kotlinDeployFailure: steps.DeployKotlin.result == 'failure'
pythonDeployFailure: steps.DeployPython.result == 'failure'
excelDeployFailure: steps.DeployExcel.result == 'failure'
jsonSchemaDeployFailure: steps.DeployJsonSchema.result == 'failure'
commands:
- exit 1

Expand Down
8 changes: 7 additions & 1 deletion docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ CDM as Go is files published
## CDM as TypeScript

CDM as TypeScript is published
[here](https://central.sonatype.com/artifact/org.finos.cdm/cdm-typescript/versions). Then click on the `Browse` button for latest version available as a `zip` file containing the `.ts` files .
[here](https://central.sonatype.com/artifact/org.finos.cdm/cdm-typescript/versions). Then click on the `Browse` button for latest version available as a `zip` file containing the `.ts` files.

## CDM as Kotlin

Expand All @@ -85,6 +85,12 @@ CDM as Kotlin is published
CDM as Excel is published
[here](https://central.sonatype.com/artifact/org.finos.cdm/cdm-excel/versions). Then click on the `Browse` button for latest version available as a `.xlsx` file containing CDM Types, Attributes and Enums.

## CDM as JSON Schema

CDM as JSON Schema is published
[here](https://central.sonatype.com/artifact/org.finos.cdm/cdm-json-schema/versions). Then click on the `Browse` button for latest version available as a `zip` file containing the `.json` schema files.


## CDM Event Specification Module as DAML

CDM Event Specification Module as DAML is available
Expand Down
12 changes: 9 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@

<repoServerHost>oss.sonatype.org</repoServerHost>

<rosetta.bundle.version>10.9.3</rosetta.bundle.version>
<rosetta.bundle.version>10.12.0</rosetta.bundle.version>
<rosetta.code-gen.version>${rosetta.bundle.version}</rosetta.code-gen.version>
<rosetta.dsl.version>9.4.0</rosetta.dsl.version>
<rosetta.dsl.version>9.6.0</rosetta.dsl.version>

<xtext.version>2.27.0</xtext.version>
<opengamma.strata.version>1.7.0</opengamma.strata.version>
Expand Down Expand Up @@ -217,7 +217,7 @@
<dependency>
<groupId>com.regnosys.rosetta.code-generators</groupId>
<artifactId>default-cdm-generators</artifactId>
<version>${rosetta.bundle.version}</version>
<version>${rosetta.code-gen.version}</version>
</dependency>
<dependency>
<groupId>com.regnosys.rosetta</groupId>
Expand Down Expand Up @@ -335,6 +335,12 @@
<groupId>com.regnosys.rosetta</groupId>
<artifactId>com.regnosys.rosetta</artifactId>
<version>${rosetta.dsl.version}</version>
<exclusions>
<exclusion>
<groupId>com.regnosys.rosetta</groupId>
<artifactId>com.regnosys.rosetta.xcore</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.regnosys.rosetta</groupId>
Expand Down
39 changes: 39 additions & 0 deletions rosetta-source/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,45 @@
</plugins>
</build>
</profile>
<profile>
<id>json-schema</id>
<build>
<plugins>
<plugin>
<groupId>com.regnosys.rosetta</groupId>
<artifactId>rosetta-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-json-schema-src</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourceRoots>
<sourceRoot>${project.build.directory}/classes/cdm/rosetta</sourceRoot>
</sourceRoots>
<classPathLookupFilter>.*com\.regnosys\.rosetta.*</classPathLookupFilter>
<languages>
<language>
<setup>org.isda.cdm.generators.CDMRosettaSetup</setup>
<outputConfigurations>
<!-- json-schema output folder -->
<outputConfiguration>
<name>SRC_GEN_JSONSCHEMA_OUTPUT</name>
<outputDirectory>src/generated/jsonschema</outputDirectory>
</outputConfiguration>
</outputConfigurations>
</language>
</languages>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

</profiles>

<build>
Expand Down

0 comments on commit a72323a

Please sign in to comment.