Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: '20'
node-version: '22'
- name: Validate VSCode extension for duplicate commands
run: python tools/validate_vscode_package.py --package-json xrcg_vscode/package.json
- name: Build VSCode extension
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-vscode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: '20'
node-version: '22'

- name: Set up Python
uses: actions/setup-python@v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: '20'
node-version: '22'
- name: Set up Python
uses: actions/setup-python@v7
with:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies = [
"jsonschema>=4.22.0",
"pydot>=2.0.0",
"anytree>=2.12.1",
"avrotize>=3.9.1",
"avrotize>=3.9.5",
"avro>=1.11.5",
"toml>=0.10.2",
"platformdirs>=4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ jsonschema>=4.17.3
pydot>=1.4.2
anytree>=2.8.0
flit>=4.2.0
avrotize>=3.9.1
avrotize>=3.9.5
toml>=0.10.2
37 changes: 37 additions & 0 deletions test/codegen/test_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,43 @@ def _tfm_of(path):
shutil.rmtree(output_dir, ignore_errors=True)


@pytest.mark.parametrize("language,style", [
("ts", "kafkaproducer"), ("ts", "egproducer"), ("ts", "producerhttp"),
("ts", "dashboard"), ("ts", "mqttclient"),
("go", "ehproducer"), ("go", "kafkaproducer"),
])
def test_generated_projects_use_central_dependency_floors(tmp_path, monkeypatch, language, style):
definitions = os.path.join(project_root, "test", "xreg", "lightbulb.xreg.json")
monkeypatch.setattr(sys, "argv", [
"xrcg", "generate", "--definitions", definitions,
"--output", str(tmp_path), "--projectname", "DependencyFloors",
"--language", language, "--style", style,
])
assert xrcg.cli() == 0
if language == "ts":
with open(os.path.join(project_root, "xrcg", "dependencies", "typescript",
"node22", "package.json"), encoding="utf-8") as handle:
central = json.load(handle)
manifests = list(tmp_path.rglob("package.json"))
assert manifests
overrides_found = False
for manifest in manifests:
package = json.loads(manifest.read_text(encoding="utf-8"))
if "overrides" in package:
overrides_found = True
assert package["overrides"] == central["overrides"]
for section in ("dependencies", "devDependencies"):
for name, version in package.get(section, {}).items():
if name in central.get(section, {}) and "overrides" in package:
assert version == central[section][name]
assert overrides_found
else:
manifest = tmp_path / "DependencyFloors" / "go.mod"
content = manifest.read_text(encoding="utf-8")
floor = TemplateRenderer.dependency("go", "go121", "golang.org/x/net").strip()
assert floor in content


def test_extract_schema_info_keeps_names_for_top_level_schemagroup_refs():
"""Top-level schemagroup refs must retain class and namespace metadata.

Expand Down
2 changes: 1 addition & 1 deletion xrcg/dependencies/cs/net100/dependencies.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="MQTTnet" Version="5.1.0.1559" />
<PackageReference Include="System.Memory.Data" Version="10.0.11" />
<PackageReference Include="System.Memory.Data" Version="10.0.13" />
<PackageReference Include="System.Text.Json" Version="10.0.8" />
<PackageReference Include="Testcontainers" Version="4.16.0" />
<PackageReference Include="Testcontainers.ActiveMq" Version="4.16.0" />
Expand Down
6 changes: 5 additions & 1 deletion xrcg/dependencies/go/go121/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module xrcg_dependencies

go 1.21
go 1.26.0

require (
golang.org/x/net v0.62.0
)
2 changes: 1 addition & 1 deletion xrcg/dependencies/python/py312/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ azure-servicebus>=7.15.0
azure-storage-blob>=12.31.1
cloudevents>=2.2.0
confluent-kafka>=2.16.1
paho-mqtt>=2.2.0
paho-mqtt>=2.1.0
python-qpid-proton>=0.41.1

# Development dependencies
Expand Down
29 changes: 23 additions & 6 deletions xrcg/dependencies/typescript/node22/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,40 @@
"kafkajs": "^2.2.4",
"mqtt": "^5.0.0",
"rhea": "^3.0.0",
"uuid": "^14.0.0"
"uuid": "^11.1.1"
},
"devDependencies": {
"aedes": "^0.51.3",
"@jest/globals": "^30.2.0",
"@stylistic/eslint-plugin": "^5.6.1",
"@testcontainers/kafka": "^12.0.1",
"@types/jest": "^30.0.0",
"@types/node": "^26.1.1",
"@types/node": "^22.19.0",
"@types/uuid": "^11.0.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",
"@typescript-eslint/eslint-plugin": "^8.72.1",
"@typescript-eslint/parser": "^8.72.1",
"eslint": "^10.1.0",
"jest": "^30.2.0",
"nock": "^14.0.10",
"testcontainers": "^12.0.1",
"ts-jest": "^29.2.5",
"ts-jest": "^29.4.15",
"ts-node": "^10.9.0",
"typescript": "^7.0.2"
"typedoc": "^0.28.17",
"typescript": "~5.9.3"
},
"overrides": {
"deepmerge": "npm:@stackline/deepmerge@1.1.0",
"cloudevents": {
"uuid": "^11.1.1"
},
"uuid@>=7 <11.1.1": "^11.1.1",
"ajv-cli": {
"fast-json-patch": "^3.1.1"
},
"@typescript-eslint/typescript-estree": {
"minimatch": "^11.0.1"
},
"minimatch@>=9": "^11.0.1",
"glob@>=9": "^14.0.3"
}
}
7 changes: 4 additions & 3 deletions xrcg/templates/go/amqpconsumer/go.mod.jinja
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{%- import "util.jinja.include" as util -%}
module {{ project_name | snake }}

go 1.21
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/Azure/go-amqp v1.7.0
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/google/uuid v1.6.0
github.com/username/{{ data_project_name | go_package }} v0.0.0
github.com/stretchr/testify v1.8.4
github.com/testcontainers/testcontainers-go v0.27.0
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.38.0
)

replace github.com/username/{{ data_project_name | go_package }} => ../{{ data_project_name }}
7 changes: 4 additions & 3 deletions xrcg/templates/go/amqpproducer/go.mod.jinja
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{%- import "util.jinja.include" as util -%}
module {{ project_name | snake }}

go 1.21
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/Azure/go-amqp v1.7.0
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/google/uuid v1.6.0
github.com/username/{{ data_project_name | go_package }} v0.0.0
github.com/stretchr/testify v1.8.4
github.com/testcontainers/testcontainers-go v0.27.0
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.38.0
)

replace github.com/username/{{ data_project_name | go_package }} => ../{{ data_project_name }}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
{%- if avro_messages %}
"github.com/hamba/avro/v2"
"github.com/iskorotkov/avro/v2"
{%- endif %}
testcontainers "github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
Expand Down
3 changes: 2 additions & 1 deletion xrcg/templates/go/ehconsumer/go.mod.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{%- import "util.jinja.include" as util -%}
module {{ project_name | snake }}

go 1.23.0
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs v1.4.0
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/google/uuid v1.6.0
Expand Down
3 changes: 2 additions & 1 deletion xrcg/templates/go/ehproducer/go.mod.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{%- import "util.jinja.include" as util -%}
module {{ project_name | snake }}

go 1.23.0
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs v1.4.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0
github.com/cloudevents/sdk-go/v2 v2.15.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
{%- if avro_messages %}
"github.com/hamba/avro/v2"
"github.com/iskorotkov/avro/v2"
{%- endif %}
{%- if live_is_ce %}
"github.com/testcontainers/testcontainers-go"
Expand Down
9 changes: 5 additions & 4 deletions xrcg/templates/go/kafkaconsumer/go.mod.jinja
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{%- import "util.jinja.include" as util -%}
module {{ project_name | snake }}

go 1.21
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/segmentio/kafka-go v0.4.47
github.com/google/uuid v1.6.0
github.com/username/{{ data_project_name | go_package }} v0.0.0
github.com/testcontainers/testcontainers-go v0.27.0
github.com/testcontainers/testcontainers-go/modules/kafka v0.27.0
github.com/stretchr/testify v1.8.4
github.com/testcontainers/testcontainers-go v0.38.0
github.com/testcontainers/testcontainers-go/modules/kafka v0.38.0
github.com/stretchr/testify v1.10.0
)

replace github.com/username/{{ data_project_name | go_package }} => ../{{ data_project_name }}
9 changes: 5 additions & 4 deletions xrcg/templates/go/kafkaproducer/go.mod.jinja
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{%- import "util.jinja.include" as util -%}
module {{ project_name | snake }}

go 1.21
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/segmentio/kafka-go v0.4.47
github.com/google/uuid v1.6.0
github.com/username/{{ data_project_name | go_package }} v0.0.0
github.com/testcontainers/testcontainers-go v0.27.0
github.com/testcontainers/testcontainers-go/modules/kafka v0.27.0
github.com/stretchr/testify v1.8.4
github.com/testcontainers/testcontainers-go v0.38.0
github.com/testcontainers/testcontainers-go/modules/kafka v0.38.0
github.com/stretchr/testify v1.10.0
)

replace github.com/username/{{ data_project_name | go_package }} => ../{{ data_project_name }}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
{%- if avro_messages %}
"github.com/hamba/avro/v2"
"github.com/iskorotkov/avro/v2"
{%- endif %}
testcontainers "github.com/testcontainers/testcontainers-go"
tckafka "github.com/testcontainers/testcontainers-go/modules/kafka"
Expand Down
7 changes: 4 additions & 3 deletions xrcg/templates/go/mqttclient/go.mod.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
{%- endfor -%}
module {{ project_name | snake }}

go 1.21
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/eclipse/paho.golang v0.23.0
github.com/google/uuid v1.6.0
{%- if uses_data_package %}
github.com/username/{{ data_project_name | go_package }} v0.0.0
{%- endif %}
github.com/stretchr/testify v1.8.4
github.com/testcontainers/testcontainers-go v0.27.0
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.38.0
)

{%- if uses_data_package %}
Expand Down
2 changes: 1 addition & 1 deletion xrcg/templates/go/mqttclient/{testdir}client_test.go.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
{%- if avro_messages %}
"github.com/hamba/avro/v2"
"github.com/iskorotkov/avro/v2"
{%- endif %}
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
Expand Down
5 changes: 3 additions & 2 deletions xrcg/templates/go/producer/go.mod.jinja
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{%- import "util.jinja.include" as util -%}
module {{ project_name | snake }}

go 1.21
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/google/uuid v1.6.0
github.com/username/{{ data_project_name | go_package }} v0.0.0
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.10.0
)

replace github.com/username/{{ data_project_name | go_package }} => ../{{ data_project_name }}
2 changes: 1 addition & 1 deletion xrcg/templates/go/producer/{testdir}producer_test.go.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
{%- if avro_messages %}
"github.com/hamba/avro/v2"
"github.com/iskorotkov/avro/v2"
{%- endif %}
{%- if _t_uses_data %}

Expand Down
3 changes: 2 additions & 1 deletion xrcg/templates/go/sbconsumer/go.mod.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{%- import "util.jinja.include" as util -%}
module {{ project_name | snake }}

go 1.23.0
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus v1.9.0
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/stretchr/testify v1.10.0
Expand Down
3 changes: 2 additions & 1 deletion xrcg/templates/go/sbproducer/go.mod.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{%- import "util.jinja.include" as util -%}
module {{ project_name | snake }}

go 1.23.0
go 1.26.0

require (
{{ dependency("go", "go121", "golang.org/x/net") }}
github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus v1.9.0
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/google/uuid v1.6.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
{%- if avro_messages %}
"github.com/hamba/avro/v2"
"github.com/iskorotkov/avro/v2"
{%- endif %}
{%- if live_is_ce %}
"github.com/testcontainers/testcontainers-go"
Expand Down
Loading
Loading