Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator Interface Update & Converter Changes #533

Merged
merged 53 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
41a8899
Schema Config Update
ankitk-me Sep 28, 2023
f26457c
converter implementation
ankitk-me Oct 6, 2023
fd69f8b
Merge branch 'aklivity:develop' into convertor
ankitk-me Oct 6, 2023
fdb9d98
test coverage update
ankitk-me Oct 6, 2023
dcecf18
schema update
ankitk-me Oct 6, 2023
b12c609
Interface update to support Streaming validation
ankitk-me Oct 12, 2023
3621172
refactoring
ankitk-me Oct 18, 2023
8435d0e
bug fix
ankitk-me Oct 19, 2023
71451a7
IT fix
ankitk-me Oct 25, 2023
2a882d4
Feature/m1 docker build support (#376)
vordimous Oct 7, 2023
c177894
0 for no mqtt session expiry should be mapped to max integer value fo…
akrambek Oct 7, 2023
add6eb3
Bump alpine in /cloud/docker-image/src/main/docker/release (#484)
dependabot[bot] Oct 7, 2023
366daff
Better handle request with same group id (#498)
akrambek Oct 11, 2023
e362fe9
Prepare release 0.9.55
jfallows Oct 11, 2023
66680f9
Update CHANGELOG.md
jfallows Oct 11, 2023
6829614
Fix flow control bug in mqtt-kakfa publish (#524)
bmaidics Oct 20, 2023
bb9fb56
Add extraEnv to Deployment in the helm chart (#511)
attilakreiner Oct 21, 2023
a1235ce
Sporadic github action build failure fix (#522)
akrambek Oct 23, 2023
6eb8a43
Merge branch 'feature/schema-registry' into convertor
ankitk-me Oct 25, 2023
f7bf292
pom fix
ankitk-me Oct 25, 2023
fd59bbb
updating Varint32FW initialisation
ankitk-me Oct 25, 2023
4c264d7
Fragment Validator Interface & Schema Update
ankitk-me Oct 27, 2023
1e1e73d
String & Test Fragment Validator implementation
ankitk-me Oct 30, 2023
65f12f0
Addressing review feedback
ankitk-me Nov 1, 2023
705f7d4
Addressing review comments
ankitk-me Nov 2, 2023
02b3b7a
avro validator.yaml update
ankitk-me Nov 6, 2023
6191c15
Schema patch issue fix
ankitk-me Nov 7, 2023
7d6418a
dynamic value length allocation issue
ankitk-me Nov 13, 2023
9c533a5
addressing review comments
ankitk-me Nov 15, 2023
364acb4
Use parametric types to avoid both cast and warning about raw types
jfallows Nov 16, 2023
31e70f4
Use converted file to handle variable size converted value during pro…
jfallows Nov 16, 2023
69dfe0b
Prefix is byte followed by big endian int32, requires literal byte se…
jfallows Nov 16, 2023
767d008
adding test coverage
ankitk-me Nov 17, 2023
0b1e590
optimising object allocation Avro validator
ankitk-me Nov 17, 2023
ce59fb0
checkstyle fix
ankitk-me Nov 17, 2023
2d6a9e3
IT & implementation to support fetch message without Schema ID prefix
ankitk-me Nov 21, 2023
664cece
addressing review feedback
ankitk-me Nov 27, 2023
b4b02c8
fetch message without Schema ID prefix implementation
ankitk-me Nov 28, 2023
f4e90e9
Avro & Json Read Validator fix
ankitk-me Nov 28, 2023
8075684
fix checkstyle
ankitk-me Nov 28, 2023
4dec79f
ITs for convertor & updating Test Validator
ankitk-me Nov 29, 2023
11d3747
dynamic message size after conversion implementation
ankitk-me Dec 12, 2023
7281c2f
Merge branch 'feature/schema-registry' into convertor
ankitk-me Dec 13, 2023
08cc929
updating latest changes with Value & Fragment Validator interface.
ankitk-me Dec 13, 2023
3cf0185
Converter bug fix
ankitk-me Dec 14, 2023
a8f9c08
Addressing review feedback
ankitk-me Dec 18, 2023
1d82d23
addressing review comments
ankitk-me Dec 19, 2023
8fb1016
using ExpandableDirectByteBuffer with valid index & length
ankitk-me Dec 19, 2023
9f3e434
review feedback & adding functional interface to CatalogHandler
ankitk-me Dec 20, 2023
c48b2d7
encoded bug fix: position reset to 0
ankitk-me Dec 21, 2023
9b77963
Addressing review comments
ankitk-me Dec 21, 2023
49f2963
Avro unit test fix
ankitk-me Dec 21, 2023
ee1e231
return -1 and ignore prefix.sizeof() in case of validation failure
ankitk-me Dec 22, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public InlineCatalogHandler(
registerSchema(config.subjects);
}

@Override
public String type()
{
return INLINE;
}

@Override
public int register(
String subject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ public SchemaRegistryCatalogHandler(
this.schemaIdCache = new Int2ObjectCache<>(1, 1024, i -> {});
}

@Override
public String type()
{
return SCHEMA_REGISTRY;
}

@Override
public int register(
String subject,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# Copyright 2021-2023 Aklivity Inc
#
# Licensed under the Aklivity Community License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# https://www.aklivity.io/aklivity-community-license/
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#

---
name: test
catalogs:
test0:
type: test
options:
schema: |
{
"fields": [
{
"name": "id",
"type": "string"
},
{
"name": "status",
"type": "string"
}
],
"name": "Event",
"namespace": "io.aklivity.example",
"type": "record"
}
bindings:
test:
kind: server
type: test
options:
value:
type: avro
format: json
catalog:
catalog0:
- subject: test0
version: latest
exit: test
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,134 @@
"op": "add",
"path": "/$defs/validator/types/enum/-",
"value": "avro"
},
{
"op": "add",
"path": "/$defs/validator/allOf/-",
"value":
{
"if":
{
"properties":
{
"type":
{
"const": "avro"
}
}
},
"then":
{
"properties":
{
"type":
{
"const": "avro"
},
"format":
{
"type": "string",
"enum":
[
"json"
]
},
"catalog":
{
"type": "object",
"patternProperties":
{
"^[a-zA-Z]+[a-zA-Z0-9\\._\\-]*$":
{
"type": "array",
"items":
{
"oneOf":
[
{
"type": "object",
"properties":
{
"id":
{
"type": "integer"
}
},
"required":
[
"id"
],
"additionalProperties": false
},
{
"type": "object",
"properties":
{
"schema":
{
"type": "string"
},
"version":
{
"type": "string",
"default": "latest"
}
},
"required":
[
"schema"
],
"additionalProperties": false
},
{
"type": "object",
"properties":
{
"strategy":
{
"type": "string"
},
"version":
{
"type": "string",
"default": "latest"
}
},
"required":
[
"strategy"
],
"additionalProperties": false
},
{
"type": "object",
"properties":
{
"subject":
{
"type": "string"
},
"version":
{
"type": "string",
"default": "latest"
}
},
"required":
[
"subject"
],
"additionalProperties": false
}
]
}
}
},
"maxProperties": 1
}
},
"additionalProperties": false
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2021-2023 Aklivity Inc
*
* Licensed under the Aklivity Community License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of the
* License at
*
* https://www.aklivity.io/aklivity-community-license/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package io.aklivity.zilla.specs.validator.avro.config;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;

import jakarta.json.JsonObject;

import org.junit.Rule;
import org.junit.Test;

import io.aklivity.zilla.specs.engine.config.ConfigSchemaRule;

public class SchemaTest
{
@Rule
public final ConfigSchemaRule schema = new ConfigSchemaRule()
.schemaPatch("io/aklivity/zilla/specs/engine/schema/binding/test.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/engine/schema/catalog/test.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/validator/avro/schema/avro.schema.patch.json")
.configurationRoot("io/aklivity/zilla/specs/validator/avro/config");

@Test
public void shouldValidateCatalog()
{
JsonObject config = schema.validate("validator.yaml");

assertThat(config, not(nullValue()));
}
}
2 changes: 1 addition & 1 deletion incubator/validator-avro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<jacoco.coverage.ratio>0.80</jacoco.coverage.ratio>
<jacoco.coverage.ratio>0.91</jacoco.coverage.ratio>
<jacoco.missed.count>0</jacoco.missed.count>
</properties>

Expand Down
Loading