47d086111d
Add DnsRecord and ApplicationDeploymentRequest ( #124 )
...
Pull Request Labeler / triage (push) Successful in 3s
Lint / Run flake8 on python integration tests (push) Failing after 27s
Tests / cleanup-runs (push) Has been skipped
Lint / Run golangci-lint (push) Successful in 3m44s
Tests / test-importer (push) Failing after 1m28s
Tests / sdk_tests (push) Failing after 3m12s
Run Gosec / Gosec (push) Failing after 8m26s
Tests / test-rpc (push) Failing after 5m22s
Tests / test-unit-cover (push) Failing after 8m46s
CodeQL / Analyze (go) (push) Failing after 1m57s
> Note: This has a breaking protobuf change, but that is known and OK, as the previous release has not been deployed externally.
```
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\""];
}
```
Also rename WebAppDeploymentRecord to ApplicationDeploymentRecord.
Reviewed-on: cerc-io/laconicd#124
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-07 22:19:10 +00:00
880367d5df
122: Fix attribute index key collision ( #123 )
...
CodeQL / Analyze (go) (push) Failing after 2m13s
Lint / Run flake8 on python integration tests (push) Failing after 16s
Run Gosec / Gosec (push) Failing after 6m55s
Tests / cleanup-runs (push) Has been skipped
Lint / Run golangci-lint (push) Successful in 13m47s
Tests / test-unit-cover (push) Failing after 7m10s
Tests / test-rpc (push) Failing after 4m27s
Tests / sdk_tests (push) Failing after 2m29s
Tests / test-importer (push) Failing after 12m41s
Pull Request Labeler / triage (push) Successful in 3s
Fix #122 , where the structure of the index key allowed unintended collisions (see below).
This also adds a test cases which _fails_ under the old scheme, but passes now:
**Before:**
```
--- FAIL: TestKeeperTestSuite (0.31s)
--- FAIL: TestKeeperTestSuite/TestGrpcGetRecordLists (0.09s)
grpc_query_test.go:143:
Error Trace: /home/telackey/cerc/laconicd/x/registry/keeper/grpc_query_test.go:143
/home/telackey/cerc/laconicd/x/registry/keeper/suite.go:91
Error: Not equal:
expected: 0
actual : 1
Test: TestKeeperTestSuite/TestGrpcGetRecordLists
--- FAIL: TestKeeperTestSuite/TestGrpcGetRecordLists/Case_Filter_with_typ_(cerc-io/laconicd#122 )_ (0.00s)
testing.go:1490: test executed panic(nil) or runtime.Goexit: subtest may have called FailNow on a parent test
FAIL
FAIL github.com/cerc-io/laconicd/x/registry/keeper 0.765s
FAIL
make: *** [Makefile:333: run-tests] Error 1
❯ laconic cns record list --all --typ eWebsiteRegistrationRecord
[
{
"id": "bafyreies5he2mxyrjso2quewwlmh6cisekkjnf7yijpd2742wrzxgzuazi",
"names": null,
"owners": [
"FC9B9FB065D70DBB10C8F511348421C16669B37D"
],
"bondId": "a9c7161fc154cf44ee61efc699a59c8a27c804bb23ce4c8a7ffa0a39fcc540b1",
"createTime": "2023-11-28T19:09:03Z",
"expiryTime": "2024-11-27T19:09:03Z",
"attributes": {
"url": "https://hello-urbit.laconic.com ",
"repo_registration_record_cid": "QmTZQ8ZJS6mALjEM2wY71msFno6zzxFftVCiZELj9xREPx",
"build_artifact_cid": "~lostex-rabdur-labtul-moltev/hello-urbit",
"tls_cert_cid": "QmR1acEmQt7Tjmhp9cFtymie2eFcrHURQKt9kGto1TQTW1",
"type": "WebsiteRegistrationRecord",
"version": "0.2.4"
}
}
...
❯ laconic cns record list --all --type WebsiteRegistrationRecord
[
{
"id": "bafyreies5he2mxyrjso2quewwlmh6cisekkjnf7yijpd2742wrzxgzuazi",
"names": null,
"owners": [
"FC9B9FB065D70DBB10C8F511348421C16669B37D"
],
"bondId": "a9c7161fc154cf44ee61efc699a59c8a27c804bb23ce4c8a7ffa0a39fcc540b1",
"createTime": "2023-11-28T19:09:03Z",
"expiryTime": "2024-11-27T19:09:03Z",
"attributes": {
"url": "https://hello-urbit.laconic.com ",
"repo_registration_record_cid": "QmTZQ8ZJS6mALjEM2wY71msFno6zzxFftVCiZELj9xREPx",
"build_artifact_cid": "~lostex-rabdur-labtul-moltev/hello-urbit",
"tls_cert_cid": "QmR1acEmQt7Tjmhp9cFtymie2eFcrHURQKt9kGto1TQTW1",
"type": "WebsiteRegistrationRecord",
"version": "0.2.4"
}
}
...
```
**After:**
```
ok github.com/cerc-io/laconicd/x/registry/keeper 1.573s
❯ laconic cns record list --all --typ eWebsiteRegistrationRecord
[]
❯ laconic cns record list --all --type WebsiteRegistrationRecord
[
{
"id": "bafyreies5he2mxyrjso2quewwlmh6cisekkjnf7yijpd2742wrzxgzuazi",
"names": null,
"owners": [
"FC9B9FB065D70DBB10C8F511348421C16669B37D"
],
"bondId": "a9c7161fc154cf44ee61efc699a59c8a27c804bb23ce4c8a7ffa0a39fcc540b1",
"createTime": "2023-11-28T19:09:03Z",
"expiryTime": "2024-11-27T19:09:03Z",
"attributes": {
"url": "https://hello-urbit.laconic.com ",
"repo_registration_record_cid": "QmTZQ8ZJS6mALjEM2wY71msFno6zzxFftVCiZELj9xREPx",
"build_artifact_cid": "~lostex-rabdur-labtul-moltev/hello-urbit",
"tls_cert_cid": "QmR1acEmQt7Tjmhp9cFtymie2eFcrHURQKt9kGto1TQTW1",
"type": "WebsiteRegistrationRecord",
"version": "0.2.4"
}
}
...
```
Reviewed-on: cerc-io/laconicd#123
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-29 00:05:56 +00:00
0adc932400
118: queryRecords should return [] when no matching records exist, not an error ( #121 )
...
Pull Request Labeler / triage (push) Successful in 7s
Lint / Run flake8 on python integration tests (push) Failing after 31s
Tests / cleanup-runs (push) Has been skipped
CodeQL / Analyze (go) (push) Failing after 2m29s
Lint / Run golangci-lint (push) Successful in 5m43s
Run Gosec / Gosec (push) Failing after 7m38s
Tests / test-unit-cover (push) Failing after 7m49s
Tests / test-rpc (push) Failing after 3m53s
Tests / sdk_tests (push) Failing after 3m14s
Tests / test-importer (push) Failing after 13m15s
Whenever a key is used which doesn't exist in the DB at all, an error is returned like this:
```
[
{
message: `rpc error: code = Unknown desc = store doesn't have key: "\\atypeApplicationRecord"`,
path: [ 'queryRecords' ]
}
]
```
That doesn't make any sense, as it is not an error to find out that the thing you asked for does not exist. This changes it to return an empty list.
Reviewed-on: cerc-io/laconicd#121
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-28 20:41:28 +00:00