Add DnsRecord and ApplicationDeploymentRequest
Some checks failed
Build / cleanup-runs (pull_request) Failing after 8s
CodeQL / Analyze (go) (pull_request) Failing after 39s
Build / build (pull_request) Failing after 1m21s
Deploy Contract / cleanup-runs (pull_request) Failing after 33s
Dependency Review / dependency-review (pull_request) Failing after 1m19s
Pull Request Labeler / triage (pull_request) Failing after 11s
Lint / Run golangci-lint (pull_request) Failing after 40s
Deploy Contract / deploy (pull_request) Failing after 48s
Protobuf / lint (pull_request) Successful in 15s
Lint / Run flake8 on python integration tests (pull_request) Failing after 47s
Run Gosec / Gosec (pull_request) Failing after 15s
Semgrep / Scan (pull_request) Failing after 13s
Tests / cleanup-runs (pull_request) Failing after 2s
Protobuf / break-check (pull_request) Failing after 34s
Tests / test-importer (pull_request) Failing after 50s
Tests / test-unit-cover (pull_request) Failing after 52s
Tests / test-rpc (pull_request) Failing after 1m1s
Tests / sdk_tests (pull_request) Failing after 1m59s

This commit is contained in:
Thomas E Lackey 2023-12-07 15:47:01 -06:00
parent 880367d5df
commit bfcb84eb3e
5 changed files with 1402 additions and 135 deletions

View File

@ -41,7 +41,7 @@ message ApplicationRecord {
string license = 6 [(gogoproto.moretags) = "json:\"license\" yaml:\"license\""];
string author = 7 [(gogoproto.moretags) = "json:\"author\" yaml:\"author\""];
string repository = 8 [(gogoproto.moretags) = "json:\"repository\" yaml:\"repository\""];
string repository_tag = 9 [(gogoproto.moretags) = "json:\"repositoryTag\" yaml:\"repositoryTag\""];
string repository_ref = 9 [(gogoproto.moretags) = "json:\"repositoryRef\" yaml:\"repositoryRef\""];
string app_version = 10 [(gogoproto.moretags) = "json:\"appVersion\" yaml:\"appVersion\""];
string app_type = 11 [(gogoproto.moretags) = "json:\"appType\" yaml:\"appType\""];
string engines = 12 [(gogoproto.moretags) = "json:\"engines\" yaml:\"engines\""];
@ -51,13 +51,37 @@ message ApplicationRecord {
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
message WebAppDeploymentRecord {
message DnsRecord {
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
string version = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
string resource_type = 4 [(gogoproto.moretags) = "json:\"resourceType\" yaml:\"resourceType\""];
string value = 5 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
message ApplicationDeploymentRequest {
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
string version = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
string application = 4 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
string dns = 5 [(gogoproto.moretags) = "json:\"dns\" yaml:\"dns\""];
string config = 6 [(gogoproto.moretags) = "json:\"config\" yaml:\"config\""];
repeated string crn = 7 [(gogoproto.moretags) = "json:\"crn\" yaml:\"crn\""];
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
message ApplicationDeploymentRecord {
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
string application = 5 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
string url = 6 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""];
string dns = 7 [(gogoproto.moretags) = "json:\"dns\" yaml:\"dns\""];
string request = 8 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
@ -72,3 +96,4 @@ message GeneralRecord {
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}

View File

@ -344,7 +344,8 @@ func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) erro
}
}
}
case "WebsiteRegistrationRecord", "ApplicationRecord", "WebAppDeploymentRecord", "GeneralRecord":
case "WebsiteRegistrationRecord", "ApplicationRecord", "ApplicationDeploymentRequest",
"ApplicationDeploymentRecord", "DnsRecord", "GeneralRecord":
{
// #nosec G705
for key := range record.Attributes {

File diff suppressed because it is too large Load Diff

View File

@ -58,9 +58,21 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
)
registry.RegisterInterface(
"vulcanize.registry.v1beta1.WebAppDeploymentRecord",
"vulcanize.registry.v1beta1.ApplicationDeploymentRequest",
(*Attributes)(nil),
&WebAppDeploymentRecord{},
&ApplicationDeploymentRequest{},
)
registry.RegisterInterface(
"vulcanize.registry.v1beta1.ApplicationDeploymentRecord",
(*Attributes)(nil),
&ApplicationDeploymentRecord{},
)
registry.RegisterInterface(
"vulcanize.registry.v1beta1.DnsRecord",
(*Attributes)(nil),
&DnsRecord{},
)
registry.RegisterInterface(

View File

@ -77,9 +77,27 @@ func payLoadAttributes(recordPayLoad map[string]interface{}) (*codectypes.Any, e
}
return codectypes.NewAnyWithValue(&attributes)
}
case "WebAppDeploymentRecord":
case "ApplicationDeploymentRequest":
{
var attributes WebAppDeploymentRecord
var attributes ApplicationDeploymentRequest
err := json.Unmarshal(bz, &attributes)
if err != nil {
return &codectypes.Any{}, err
}
return codectypes.NewAnyWithValue(&attributes)
}
case "ApplicationDeploymentRecord":
{
var attributes ApplicationDeploymentRecord
err := json.Unmarshal(bz, &attributes)
if err != nil {
return &codectypes.Any{}, err
}
return codectypes.NewAnyWithValue(&attributes)
}
case "DnsRecord":
{
var attributes DnsRecord
err := json.Unmarshal(bz, &attributes)
if err != nil {
return &codectypes.Any{}, err
@ -180,9 +198,35 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
panic("JSON marshal error")
}
}
case "WebAppDeploymentRecord":
case "ApplicationDeploymentRequest":
{
var attributes WebAppDeploymentRecord
var attributes ApplicationDeploymentRequest
err := proto.Unmarshal(any.Value, &attributes)
if err != nil {
panic("Proto unmarshal error")
}
bz, err = json.Marshal(attributes)
if err != nil {
panic("JSON marshal error")
}
}
case "ApplicationDeploymentRecord":
{
var attributes ApplicationDeploymentRecord
err := proto.Unmarshal(any.Value, &attributes)
if err != nil {
panic("Proto unmarshal error")
}
bz, err = json.Marshal(attributes)
if err != nil {
panic("JSON marshal error")
}
}
case "DnsRecord":
{
var attributes DnsRecord
err := proto.Unmarshal(any.Value, &attributes)
if err != nil {
panic("Proto unmarshal error")