Skip to content

Commit 52dc200

Browse files
Merge pull request #33 from dschwartznyc/main
Prep for Integration with CDM
2 parents 8a75b5a + 647e2f6 commit 52dc200

File tree

7 files changed

+79
-55
lines changed

7 files changed

+79
-55
lines changed
Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: Build and Test JAR
1+
name: Build and Test JAR on Main Branch
102

113
on:
124
push:
@@ -16,26 +8,4 @@ on:
168

179
jobs:
1810
build_and_test:
19-
20-
runs-on: ubuntu-latest
21-
22-
steps:
23-
- uses: actions/checkout@v4
24-
- name: Set up JDK 21
25-
uses: actions/setup-java@v4
26-
with:
27-
java-version: '21'
28-
distribution: 'temurin'
29-
cache: maven
30-
- name: Set up Python 3.11
31-
uses: actions/setup-python@v4
32-
with:
33-
python-version: '3.11'
34-
- name: Build with Maven
35-
run: mvn -B package -Psign-artifacts --file pom.xml
36-
- name: Run Python Unit Tests
37-
run: |
38-
chmod +x build/setup_python_env.sh
39-
chmod +x test/python_unit_tests/setup_unit_test_env.sh
40-
chmod +x test/python_unit_tests/run_python_unit_tests.sh
41-
test/python_unit_tests/run_python_unit_tests.sh
11+
uses: ./.github/workflows/build-and-test.yml
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build and Test (Reusable)
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build_and_test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Set up JDK 21
12+
uses: actions/setup-java@v4
13+
with:
14+
java-version: '21'
15+
distribution: 'temurin'
16+
cache: maven
17+
- name: Set up Python 3.11
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.11'
21+
- name: Build with Maven
22+
run: mvn -B package -Psign-artifacts --file pom.xml
23+
- name: Run Python Unit Tests
24+
run: |
25+
chmod +x test/python_setup/setup_python_env.sh
26+
chmod +x test/python_setup/cleanup_python_env.sh
27+
chmod +x test/python_unit_tests/setup_unit_test_env.sh
28+
chmod +x test/python_unit_tests/run_python_unit_tests.sh
29+
test/python_unit_tests/run_python_unit_tests.sh

.github/workflows/renovate.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,25 @@ on:
1212
jobs:
1313
renovate:
1414
runs-on: ubuntu-latest
15-
# This section is crucial. It grants the GITHUB_TOKEN the necessary
16-
# permissions for Renovate to read repository content and create pull requests.
15+
# Grants the GITHUB_TOKEN the necessary permissions for Renovate to read repository content and create pull requests.
1716
permissions:
1817
contents: write
1918
pull-requests: write
2019
steps:
21-
# Checks out your repository under $GITHUB_WORKSPACE, so your job can access it
20+
# Checks out the repository under $GITHUB_WORKSPACE, so your job can access it
2221
- uses: actions/checkout@v4
23-
2422
# Runs the Renovate GitHub Action
2523
- name: Renovate
2624
# Using a slightly newer version of the action
2725
uses: renovatebot/[email protected]
2826
with:
2927
# The token is required to create pull requests.
30-
# GITHUB_TOKEN is automatically created by Actions and is given
31-
# the permissions defined in the `permissions` block above.
3228
token: ${{ secrets.GITHUB_TOKEN }}
3329
# Specifies the path to your Renovate configuration file.
3430
configurationFile: .github/renovate.json
3531
env:
36-
# Use 'debug' for verbose logging, which is helpful for troubleshooting.
37-
LOG_LEVEL: 'debug'
3832
RENOVATE_REPOSITORIES: ${{ github.repository }} # This tells Renovate to scan the current repo
39-
33+
# Add a build and test job that depends on renovate
34+
build_and_test:
35+
needs: renovate
36+
uses: ./.github/workflows/build-and-test.yml

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ __pycache__
5555
**/rune.runtime-*.*.*-py3-none-any.whl
5656
**/test_helper-0.0.0-py3-none-any.whl
5757
**/test/serialization_tests/rune-common
58-
**/build/common-domain-model
59-
**/build/resources/serialization
58+
**/test/cdm_tests/common-domain-model/
6059
src/generated/
6160
*.todo

README.md

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[![FINOS - Incubating](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-incubating.svg)](https://community.finos.org/docs/governance/Software-Projects/stages/incubating)[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10725/badge)](https://www.bestpractices.dev/projects/10725)[![Maven CI](https://github.com/finos/rune-python-generator/actions/workflows/cve-scanning.yml/badge.svg)](https://github.com/finos/rune-python-generator/actions/workflows/cve-scanning.yml)
22

3-
4-
<img align="right" width="15%" src="https://www.finos.org/hubfs/FINOS/finos-logo/FINOS_Icon_Wordmark_Name_RGB_horizontal.png">
3+
<img align="right" width="15%" alt="FINOS" src="https://www.finos.org/hubfs/FINOS/finos-logo/FINOS_Icon_Wordmark_Name_RGB_horizontal.png">
54

65
# Rune Python Generator
76

@@ -10,6 +9,7 @@
109
The generated Python relies upon the [RunePythonRuntime](https://github.com/finos/rune-python-runtime) library and requires Python version 3.11+.
1110

1211
## Release Notes
12+
1313
The features of the current version can be found in the [release notes](./RELEASE.md)
1414

1515
## Repository Organization
@@ -26,41 +26,59 @@ The features of the current version can be found in the [release notes](./RELEAS
2626
## Development setup
2727

2828
### Setup for developers
29+
2930
This guide is meant for everyone who wants to contribute to the Rune Python Generator and needs to get things up and running.
3031

3132
Detailed build and testing instructions can be found in [BUILDANDTEST.md](./BUILDANDTEST.md)
3233

3334
If this guide does not work for you, be sure to raise an issue. This way we can help you figure out what the problem is and update this guide to prevent the same problem for future users.
3435

3536
### 1. Building with Maven
37+
3638
Start by cloning the project: `git clone https://github.com/finos/rune-python-generator`
3739

3840
Our project runs with Java 21. Make sure that your Maven also uses this version of Java by running `mvn -v`.
3941

40-
To build the project, run `mvn clean install`.
42+
To build the project, run `mvn clean package`.
4143

4244
#### UNIT Testing
45+
4346
Building the project using Maven will run JUNIT-based unit tests. All tests should pass. To run the Python unit tests follow the instructions in [BUILDANDTEST.md](./BUILDANDTEST.md)
4447

4548
### 2. Setting things up in Eclipse
49+
4650
#### Install Eclipse IDE for Java and DSL Developers
51+
4752
Install version `2025-06` of the "Eclipse IDE for Java and DSL Developers" using the [Eclipse Installer](https://www.eclipse.org/downloads/packages/installer). You might have to enable "Advanced Mode" in the settings of the Eclipse Installer to install a specific version.
4853

4954
#### Configure Eclipse with the right version of Java
55+
5056
Xtend files cannot be built with any Java version later than 21. In Eclipse, go to Settings... > Java > Installed JREs and make sure the checked JRE points to a Java version of 21.
5157

5258
#### Install the Checkstyle plugin
59+
5360
We use [Checkstyle](https://checkstyle.sourceforge.io/) for enforcing good coding practices. The Eclipse plugin for Checkstyle can be found here: [https://checkstyle.org/eclipse-cs/#!/](https://checkstyle.org/eclipse-cs/#!/).
5461

5562
#### Open the project in Eclipse
63+
5664
Go to Import... > Existing Maven Project, select the right folder, click Finish.
5765

66+
### Standalone CLI
67+
68+
The generator includes a standalone CLI which can be invoked to generate Python from a single file or from directory. To invoke the CLI, first build the project and then:
69+
70+
```sh
71+
java -cp target/python-0.0.0.main-SNAPSHOT.jar com.regnosys.rosetta.generator.python.PythonCodeGeneratorCLI
72+
```
73+
5874
### To Generate CDM from Rune
5975

6076
Use this script to generated the Python version of CDM
77+
6178
```sh
62-
build/build_cdm.sh
79+
test/cdm_tests/cdm_setup/build_cdm.sh
6380
```
81+
6482
The script will use the CDM from the branch specified in the file (E.G. master) of the [FINOS Repo](https://github.com/finos/common-domain-model) and generate a wheel in the project directory `target/python-cdm`
6583

6684
To use a different version of CDM, update CDM_VERSION in the script.
@@ -69,21 +87,33 @@ To use a different version of CDM, update CDM_VERSION in the script.
6987

7088
The Roadmap will be aligned to the [Rune-DSL](https://github.com/finos/rune-dsl/) and [CDM](https://github.com/finos/common-domain-model/blob/master/ROADMAP.md) roadmaps.
7189

90+
### Rune-DSL Updates
91+
92+
Renovate will generate a PR when the version of the DSL has been updated at com.regnosys.rosetta:com.regnosys.rosetta. The PR will clarify whether the change succsessfully builds and passes JUNIT and Python unit testing.
93+
94+
Any maintainer can merge changes that successfully build and pass the tests. To make the revised generator available to CDM, post merge a new release tagged with the version # of the updated DSL will be required.
95+
96+
Build or testing failures should be escalated to [@plamen-neykov](https://github.com/plamen-neykov) or [@dschwartznyc](https://github.com/dschwartznyc) for remediation.
97+
7298
## Contributing
99+
73100
For any questions, bugs or feature requests please open an [issue](https://github.com/finos/rune-python-generator/issues)
74101
For anything else please send an email to {project mailing list}.
75102

76103
To submit a contribution:
104+
77105
1. Fork it (<https://github.com/finos/rune-python-generator/fork>)
78106
2. Create your feature branch (`git checkout -b feature/fooBar`)
79107
3. Read our [contribution guidelines](.github/CONTRIBUTING.md) and [Community Code of Conduct](https://www.finos.org/code-of-conduct)
80108
4. Commit your changes (`git commit -am 'Add some fooBar'`)
81109
5. Push to the branch (`git push origin feature/fooBar`)
82110
6. Create a new Pull Request
83111

84-
_NOTE:_ Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged and blocked by the FINOS Clabot tool (or EasyCLA). Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.
112+
*_NOTE:* Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR
113+
who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged
114+
and blocked by the FINOS Clabot tool (or EasyCLA). Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.
85115

86-
Unsure if you are covered under an existing CCLA? Email [email protected]*
116+
If you are unsure if you are covered under an existing CCLA send an email to <[email protected]>
87117

88118
## Get in touch with the Rune Python Generator Team
89119

@@ -93,7 +123,7 @@ Unsure if you are covered under an existing CCLA? Email [email protected]*
93123

94124
## Governance
95125

96-
This project implements https://community.finos.org/docs/governance/#open-source-software-projects
126+
This project implements <https://community.finos.org/docs/governance/#open-source-software-projects>
97127

98128
## License
99129

@@ -105,8 +135,8 @@ SPDX-License-Identifier: [Apache-2.0](https://spdx.org/licenses/Apache-2.0)
105135

106136
## Contributors
107137

108-
- [CLOUDRISK Limited](https://www.cloudrisk.uk), email: [email protected]
109-
- [FT Advisory LLC](https://www.ftadvisory.co), email: [email protected]
110-
- [TradeHeader SL](https://www.tradeheader.com), email: [email protected]
138+
- [CLOUDRISK Limited](https://www.cloudrisk.uk), email: <[email protected]>
139+
- [FT Advisory LLC](https://www.ftadvisory.co), email: <[email protected]>
140+
- [TradeHeader SL](https://www.tradeheader.com), email: <[email protected]>
111141

112142
SPDX-License-Identifier: [Apache-2.0](https://spdx.org/licenses/Apache-2.0)

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<repoServerHost>s01.oss.sonatype.org</repoServerHost>
8282
<stagingTimeoutInMinutes>20</stagingTimeoutInMinutes>
8383

84-
<rosetta.dsl.version>9.63.0</rosetta.dsl.version>
84+
<rosetta.dsl.version>9.64.0</rosetta.dsl.version>
8585

8686
<xtext.version>2.38.0</xtext.version>
8787
<guice.version>6.0.0</guice.version>

test/cdm_tests/common-domain-model

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)