Skip to content

Commit bb3490c

Browse files
remove dependencies on the Rosetta Bundle
1 parent c1a7616 commit bb3490c

File tree

2 files changed

+45
-126
lines changed

2 files changed

+45
-126
lines changed

CDM-Build-Integration.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,64 @@
1-
## Feature Request - CDM Python Generator Integration
1+
# Feature Request - CDM Python Generator Integration
2+
3+
## Description of Problem
24

3-
### Description of Problem:
45
With the Python generator now a standalone component, its integration with the CDM build needs to be updated. This presents two main challenges:
56

6-
1. **Consistency with CDM's Rosetta Bundle Version:**
7-
To keep CDM in sync with all elements of the Rune DSL infrastructure (rosetta-common, rosetta-testing, rosetta-code-generators, rosetta-ingest), the CDM build specifies which version to use. Previously, the Python generator was kept in sync as part of the rosetta-code-generators repository, with updates whenever there was an update to the version in that repository. While the generated Python code does not directly depend on the Rune bundle, coordinating updates across all elements of the Rune infrastructure helps prevent inconsistencies in enterprise production enviroments — especially if a bundle update addresses a defect or changes behavior in a way that impacts the generators.
7+
1. **Consistency with CDM's Rosetta Bundle Version:**
8+
To keep CDM in sync with all elements of the Rune DSL infrastructure (rosetta-common, rosetta-testing, rosetta-code-generators, rosetta-ingest), the CDM build specifies which version to use. Previously, the Python generator was kept in sync as part of the rosetta-code-generators repository, with updates whenever there was an update to the version in that repository. While the generated Python code does not directly depend on it, coordinating updates across all elements of the Rune infrastructure helps prevent inconsistencies in enterprise production enviroments — especially if a dsl update addresses a defect or changes behavior in a way that impacts the generators.
89

910
2. **Invocation of the standalone Python generator**:
1011
The CDM build now needs to explicitly invoke the unbundled Python generator.
1112

1213
---
13-
### Potential Solutions:
14+
15+
## Potential Solutions
1416

1517
Below are both a target state and interim steps to enable integration before the target state is fully realized.
1618

17-
### Target state:
19+
### Target state
20+
21+
#### Assumptions
1822

19-
#### Assumptions:
2023
- The generator includes an executable Main class that accepts a Rune source and a target folder for the generated Python.
2124
- The Rune Python Runtime is available via PyPI.
2225

23-
#### Process:
24-
1. An update to the Rosetta Bundle Version triggers a rebuild of the generator. If successful, a release tagged with the bundle version is generated.
25-
- Question: What is a viable source for the trigger? Rosetta-Common?
26-
- Question: Is the generator uploaded to a central Maven repository or is it solely an artifact of the generator repository.
27-
2. The CDM build sources a generator version that matches its Rosetta Bundle Version. The sequence is:
26+
#### Process
27+
28+
1. An update to the Rosetta DSL Version triggers a rebuild of the generator. If successful, a release tagged with the DSL version is generated.
29+
30+
2. The CDM build sources a generator version that matches its Rosetta DSL Version. The sequence is:
2831

2932
1. Source the generator
3033
2. If found:
3134
1. Generate Python by invoking the new Main class using the source CDM Rune files.
3235
2. Package the resultung Python.
3336
3. Upload the package to PyPI.
34-
35-
Question: Should the package also be made available as a Maven artifact?
3637
3. If not found: fail gracefully generating notice of the error.
3738

38-
### Interim state:
39+
### Interim state
40+
41+
#### Assumptions
3942

40-
#### Assumptions:
4143
- The generator is invoked using the current mechanism.
4244
- Python artifacts are distributed via the CDM Maven Repository.
4345

4446
1. A scheduled action rebuilds the generator if the Rosetta Bundle Version used in CDM does not match any of tagged versions. If successful, a release tagged with the bundle version is generated and stored as a repo artifact.
4547

4648
_Note: The downside of this approach is that there will be CDM builds that will not find a matching generator._
47-
4849
2. The CDM build sources a generator that matches its Rosetta Bundle Version by querying the generator repo. The sequence is:
4950
1. Source the generator
5051
2. If found:
51-
1. Generate Python by executing:
52+
1. Generate Python by executing
53+
5254
```sh
5355
mvn clean install -DskipTests -P python
54-
```
56+
```
57+
5558
2. Package the Python.
5659
3. Upload the package to the Maven repository.
57-
3. If not found: fail gracefully generating notice of the error.
60+
3. If not found: fail gracefully generating notice of the error
61+
62+
## Questions
63+
64+
- Should the package also be made available as a Maven artifact?

pom.xml

Lines changed: 18 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -66,85 +66,6 @@
6666
</developer>
6767
</developers>
6868

69-
<profiles>
70-
<profile>
71-
<id>regnosys</id>
72-
<properties>
73-
<rosetta.bundle.version>0.0.0.main-SNAPSHOT</rosetta.bundle.version>
74-
</properties>
75-
</profile>
76-
<profile>
77-
<id>gpg</id>
78-
<build>
79-
<plugins>
80-
<plugin>
81-
<groupId>org.apache.maven.plugins</groupId>
82-
<artifactId>maven-deploy-plugin</artifactId>
83-
<version>${maven-deploy-plugin.version}</version>
84-
</plugin>
85-
<plugin>
86-
<groupId>org.apache.maven.plugins</groupId>
87-
<artifactId>maven-jar-plugin</artifactId>
88-
<version>${maven-jar-plugin.version}</version>
89-
<configuration>
90-
<archive>
91-
<manifest>
92-
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
93-
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
94-
</manifest>
95-
</archive>
96-
</configuration>
97-
</plugin>
98-
<plugin>
99-
<groupId>org.apache.maven.plugins</groupId>
100-
<artifactId>maven-gpg-plugin</artifactId>
101-
<version>${maven-gpg-plugin.version}</version>
102-
<executions>
103-
<execution>
104-
<id>sign-artifacts</id>
105-
<phase>verify</phase>
106-
<goals>
107-
<goal>sign</goal>
108-
</goals>
109-
<configuration>
110-
<keyname>${gpg.keyname}</keyname>
111-
<passphraseServerId>${gpg.keyname}</passphraseServerId>
112-
</configuration>
113-
</execution>
114-
</executions>
115-
</plugin>
116-
<plugin>
117-
<groupId>org.sonatype.plugins</groupId>
118-
<artifactId>nexus-staging-maven-plugin</artifactId>
119-
<extensions>true</extensions>
120-
<configuration>
121-
<nexusUrl>https://${repoServerHost}</nexusUrl>
122-
<serverId>ossrh</serverId>
123-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
124-
<stagingProgressTimeoutMinutes>${stagingTimeoutInMinutes}</stagingProgressTimeoutMinutes>
125-
</configuration>
126-
</plugin>
127-
<plugin>
128-
<groupId>org.apache.maven.plugins</groupId>
129-
<artifactId>maven-javadoc-plugin</artifactId>
130-
<version>${maven-javadoc-plugin.version}</version>
131-
<configuration>
132-
<failOnError>false</failOnError>
133-
</configuration>
134-
<executions>
135-
<execution>
136-
<id>attach-javadocs</id>
137-
<phase>package</phase>
138-
<goals>
139-
<goal>jar</goal>
140-
</goals>
141-
</execution>
142-
</executions>
143-
</plugin>
144-
</plugins>
145-
</build>
146-
</profile>
147-
</profiles>
14869

14970
<properties>
15071
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -161,7 +82,6 @@
16182
<repoServerHost>s01.oss.sonatype.org</repoServerHost>
16283
<stagingTimeoutInMinutes>20</stagingTimeoutInMinutes>
16384

164-
<rosetta.bundle.version>11.73.0</rosetta.bundle.version>
16585
<rosetta.dsl.version>9.61.0</rosetta.dsl.version>
16686

16787
<xtext.version>2.38.0</xtext.version>
@@ -194,9 +114,14 @@
194114
<cdm.python.output.path>target/python-cdm</cdm.python.output.path>
195115
<unittest.rosetta.source.path>test/python_unit_tests/rosetta</unittest.rosetta.source.path>
196116
<unittest.python.output.path>target/python-tests/unit_tests</unittest.python.output.path>
197-
<serialization.test.rune.roundtrip.source.path>test/serialization_tests/rune-common/serialization/src/test/resources/rune-serializer-round-trip-test</serialization.test.rune.roundtrip.source.path>
198-
<serialization.test.rune.shouldfail.source.path>test/serialization_tests/rune-common/serialization/src/test/resources/rune-serializer-error-handling-test</serialization.test.rune.shouldfail.source.path>
199-
<serialization.test.python.output.path>target/python-tests/serialization_unit_tests</serialization.test.python.output.path>
117+
<serialization.test.rune.roundtrip.source.path>
118+
test/serialization_tests/rune-common/serialization/src/test/resources/rune-serializer-round-trip-test
119+
</serialization.test.rune.roundtrip.source.path>
120+
<serialization.test.rune.shouldfail.source.path>
121+
test/serialization_tests/rune-common/serialization/src/test/resources/rune-serializer-error-handling-test
122+
</serialization.test.rune.shouldfail.source.path>
123+
<serialization.test.python.output.path>target/python-tests/serialization_unit_tests
124+
</serialization.test.python.output.path>
200125
</properties>
201126

202127
<dependencyManagement>
@@ -211,6 +136,11 @@
211136
<artifactId>commons-text</artifactId>
212137
<version>${apache.commons.text.version}</version>
213138
</dependency>
139+
<dependency>
140+
<groupId>commons-io</groupId>
141+
<artifactId>commons-io</artifactId>
142+
<version>${commons-io.version}</version>
143+
</dependency>
214144
<!-- xtext START -->
215145
<dependency>
216146
<groupId>com.google.inject</groupId>
@@ -261,11 +191,6 @@
261191
</exclusion>
262192
</exclusions>
263193
</dependency>
264-
<dependency>
265-
<groupId>org.eclipse.xtext</groupId>
266-
<artifactId>org.eclipse.xtext.ecore</artifactId>
267-
<version>${xtext.version}</version>
268-
</dependency>
269194
<!-- xtext END -->
270195

271196
<dependency>
@@ -305,11 +230,6 @@
305230
<artifactId>com.regnosys.rosetta.lib</artifactId>
306231
<version>${rosetta.dsl.version}</version>
307232
</dependency>
308-
<dependency>
309-
<groupId>com.regnosys</groupId>
310-
<artifactId>rosetta-common</artifactId>
311-
<version>${rosetta.bundle.version}</version>
312-
</dependency>
313233
<dependency>
314234
<groupId>com.google.guava</groupId>
315235
<artifactId>guava</artifactId>
@@ -333,11 +253,6 @@
333253
<artifactId>commons-io</artifactId>
334254
<version>${commons-io.version}</version>
335255
</dependency>
336-
<dependency>
337-
<groupId>commons-logging</groupId>
338-
<artifactId>commons-logging</artifactId>
339-
<version>1.3.4</version>
340-
</dependency>
341256
</dependencies>
342257
</dependencyManagement>
343258

@@ -370,14 +285,13 @@
370285
<artifactId>com.regnosys.rosetta</artifactId>
371286
</dependency>
372287
<dependency>
373-
<groupId>com.regnosys</groupId>
374-
<artifactId>rosetta-common</artifactId>
288+
<groupId>com.regnosys.rosetta</groupId>
289+
<artifactId>com.regnosys.rosetta.tests</artifactId>
290+
<scope>test</scope>
375291
</dependency>
376292
<dependency>
377-
<groupId>com.regnosys.rosetta.code-generators</groupId>
378-
<artifactId>test-helper</artifactId>
379-
<version>${rosetta.bundle.version}</version>
380-
<scope>test</scope>
293+
<groupId>commons-io</groupId>
294+
<artifactId>commons-io</artifactId>
381295
</dependency>
382296
<dependency>
383297
<groupId>org.junit.jupiter</groupId>
@@ -389,8 +303,6 @@
389303
<artifactId>jgrapht-core</artifactId>
390304
<version>1.5.2</version>
391305
</dependency>
392-
393-
394306
<!-- extra dependencies -->
395307
<dependency>
396308
<groupId>org.eclipse.emf</groupId>

0 commit comments

Comments
 (0)