Skip to content

Commit

Permalink
syncing up to 358c23350c52ebd5e4267c51aedb804b6c051d94
Browse files Browse the repository at this point in the history
Co-authored-by: Joey Greco <57115019+joeyagreco@users.noreply.github.com>
  • Loading branch information
superblocksadmin and joeyagreco committed Nov 19, 2024
1 parent 3798f86 commit 6940a38
Show file tree
Hide file tree
Showing 7 changed files with 340 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update `WaitGroup` runnable to block `Close` method on the `WaitGroup` completing (addresses `redis: client is closed` errors)
- Allow branch name to be given in workflow HTTP requests as a header: `X-Superblocks-Branch`
- Add `last_updated` field to the `Resource` proto, and set last updated time in update signature requests to server
- Fixed projection for findOne action in MongoDB integration

## v1.16.0

Expand Down
7 changes: 7 additions & 0 deletions compose.full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ services:
volumes:
- ./scripts/plugins/integration/kinesis/init-kinesis.sh:/etc/localstack/init/ready.d/init-kinesis.sh
- ./scripts/plugins/integration/s3/init-s3.sh:/etc/localstack/init/ready.d/init-s3.sh
mongodb:
image: mongo:latest
ports:
- "27017:27017"
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=example
intake:
image: ghcr.io/superblocksteam/intake:v0.88.0
ports:
Expand Down
309 changes: 307 additions & 2 deletions postman/collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "2b1c3ae9-cc25-4afb-981d-61463840093d",
"_postman_id": "deedd6e8-b655-4629-982b-73b4d747dd7c",
"name": "collection.json - [HTTP] Superblocks Orchestrator",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "25579613"
Expand Down Expand Up @@ -12190,6 +12190,310 @@
],
"description": "run docker deps\n\n`docker-compose -f compose.full.yaml up localstack`\n\ninit kinesis\n\n`./scripts/plugins/integration/kinesis/init-kinesis.sh`"
},
{
"name": "mongodb",
"item": [
{
"name": "execute",
"item": [
{
"name": "list collections",
"item": [
{
"name": "happy path",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const response = pm.response.json();",
"",
"pm.test(\"assert response body\", () => {",
" pm.expect(response.execution.length).to.gt(0);",
" pm.expect(response.output.result.length).to.be.eql(2);",
" pm.expect(Object.keys(response.output.result[0]).sort()).to.eql([\"idIndex\", \"info\", \"name\", \"options\", \"type\"]);",
" pm.expect(Object.keys(response.output.result[0]).sort()).to.eql([\"idIndex\", \"info\", \"name\", \"options\", \"type\"]);",
" pm.expect(response.status).to.be.eql(\"STATUS_COMPLETED\");",
"});",
"",
"pm.test(\"assert status\", () => {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"options\": {\n \"include_events\": false\n },\n \"definition\": {\n \"api\": {\n \"metadata\": {\n \"name\": \"mongo integration test\",\n \"organization\": \"00000000-0000-0000-0000-000000000001\"\n },\n \"blocks\": [\n {\n \"name\": \"put\",\n \"step\": {\n \"integration\": \"mongo-i\",\n \"mongodb\": {\n \"action\": \"listCollections\"\n }\n }\n }\n ]\n },\n \"integrations\": {\n \"mongo-i\": {\n \"endpoint\": {\n \"host\": \"mongodb://root:example@{{integration_mongodb_host}}:27017\"\n },\n \"authentication\": {\n \"custom\": {\n \"databaseName\": {\n \"value\": \"admin\"\n }\n }\n }\n }\n }\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{orchestrator_scheme}}://{{orchestrator_host}}:{{orchestrator_port}}/v2/execute",
"protocol": "{{orchestrator_scheme}}",
"host": [
"{{orchestrator_host}}"
],
"port": "{{orchestrator_port}}",
"path": [
"v2",
"execute"
]
}
},
"response": []
}
]
},
{
"name": "find",
"item": [
{
"name": "happy path",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const response = pm.response.json();",
"",
"pm.test(\"assert response body\", () => {",
" pm.expect(response.execution.length).to.gt(0);",
" pm.expect(response.output.result.length).to.be.eql(1);",
" pm.expect(response.output.result[0][\"db\"]).to.be.eql(\"admin\");",
" pm.expect(response.status).to.be.eql(\"STATUS_COMPLETED\");",
"});",
"",
"pm.test(\"assert status\", () => {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"options\": {\n \"include_events\": false\n },\n \"definition\": {\n \"api\": {\n \"metadata\": {\n \"name\": \"mongo integration test\",\n \"organization\": \"00000000-0000-0000-0000-000000000001\"\n },\n \"blocks\": [\n {\n \"name\": \"put\",\n \"step\": {\n \"integration\": \"mongo-i\",\n \"mongodb\": {\n \"action\": \"find\",\n \"resource\": \"system.users\",\n \"query\": \"{'_id': 'admin.root'}\",\n \"projection\": \"\"\n }\n }\n }\n ]\n },\n \"integrations\": {\n \"mongo-i\": {\n \"endpoint\": {\n \"host\": \"mongodb://root:example@{{integration_mongodb_host}}:27017\"\n },\n \"authentication\": {\n \"custom\": {\n \"databaseName\": {\n \"value\": \"admin\"\n }\n }\n }\n }\n }\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{orchestrator_scheme}}://{{orchestrator_host}}:{{orchestrator_port}}/v2/execute",
"protocol": "{{orchestrator_scheme}}",
"host": [
"{{orchestrator_host}}"
],
"port": "{{orchestrator_port}}",
"path": [
"v2",
"execute"
]
}
},
"response": []
},
{
"name": "with projection",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const response = pm.response.json();",
"",
"pm.test(\"assert response body\", () => {",
" pm.expect(response.execution.length).to.gt(0);",
" pm.expect(response.output.result).to.be.eql([",
" {",
" \"_id\": \"admin.root\",",
" \"roles\": [",
" {",
" \"db\": \"admin\",",
" \"role\": \"root\"",
" }",
" ]",
" }",
" ]);",
" pm.expect(response.status).to.be.eql(\"STATUS_COMPLETED\");",
"});",
"",
"pm.test(\"assert status\", () => {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"options\": {\n \"include_events\": false\n },\n \"definition\": {\n \"api\": {\n \"metadata\": {\n \"name\": \"mongo integration test\",\n \"organization\": \"00000000-0000-0000-0000-000000000001\"\n },\n \"blocks\": [\n {\n \"name\": \"put\",\n \"step\": {\n \"integration\": \"mongo-i\",\n \"mongodb\": {\n \"action\": \"find\",\n \"resource\": \"system.users\",\n \"query\": \"{'_id': 'admin.root'}\",\n \"projection\": \"{'roles': 1}\"\n }\n }\n }\n ]\n },\n \"integrations\": {\n \"mongo-i\": {\n \"endpoint\": {\n \"host\": \"mongodb://root:example@{{integration_mongodb_host}}:27017\"\n },\n \"authentication\": {\n \"custom\": {\n \"databaseName\": {\n \"value\": \"admin\"\n }\n }\n }\n }\n }\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{orchestrator_scheme}}://{{orchestrator_host}}:{{orchestrator_port}}/v2/execute",
"protocol": "{{orchestrator_scheme}}",
"host": [
"{{orchestrator_host}}"
],
"port": "{{orchestrator_port}}",
"path": [
"v2",
"execute"
]
}
},
"response": []
}
]
},
{
"name": "find one",
"item": [
{
"name": "happy path",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const response = pm.response.json();",
"",
"pm.test(\"assert response body\", () => {",
" pm.expect(response.execution.length).to.gt(0);",
" pm.expect(response.output.result[\"db\"]).to.be.eql(\"admin\");",
" pm.expect(response.status).to.be.eql(\"STATUS_COMPLETED\");",
"});",
"",
"pm.test(\"assert status\", () => {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"options\": {\n \"include_events\": false\n },\n \"definition\": {\n \"api\": {\n \"metadata\": {\n \"name\": \"mongo integration test\",\n \"organization\": \"00000000-0000-0000-0000-000000000001\"\n },\n \"blocks\": [\n {\n \"name\": \"put\",\n \"step\": {\n \"integration\": \"mongo-i\",\n \"mongodb\": {\n \"action\": \"findOne\",\n \"resource\": \"system.users\",\n \"query\": \"{'_id': 'admin.root'}\",\n \"projection\": \"\"\n }\n }\n }\n ]\n },\n \"integrations\": {\n \"mongo-i\": {\n \"endpoint\": {\n \"host\": \"mongodb://root:example@{{integration_mongodb_host}}:27017\"\n },\n \"authentication\": {\n \"custom\": {\n \"databaseName\": {\n \"value\": \"admin\"\n }\n }\n }\n }\n }\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{orchestrator_scheme}}://{{orchestrator_host}}:{{orchestrator_port}}/v2/execute",
"protocol": "{{orchestrator_scheme}}",
"host": [
"{{orchestrator_host}}"
],
"port": "{{orchestrator_port}}",
"path": [
"v2",
"execute"
]
}
},
"response": []
},
{
"name": "with projection",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const response = pm.response.json();",
"",
"pm.test(\"assert response body\", () => {",
" pm.expect(response.execution.length).to.gt(0);",
" pm.expect(response.output.result).to.be.eql(",
" {",
" \"_id\": \"admin.root\",",
" \"roles\": [",
" {",
" \"db\": \"admin\",",
" \"role\": \"root\"",
" }",
" ]",
" }",
" );",
" pm.expect(response.status).to.be.eql(\"STATUS_COMPLETED\");",
"});",
"",
"pm.test(\"assert status\", () => {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"options\": {\n \"include_events\": false\n },\n \"definition\": {\n \"api\": {\n \"metadata\": {\n \"name\": \"mongo integration test\",\n \"organization\": \"00000000-0000-0000-0000-000000000001\"\n },\n \"blocks\": [\n {\n \"name\": \"put\",\n \"step\": {\n \"integration\": \"mongo-i\",\n \"mongodb\": {\n \"action\": \"findOne\",\n \"resource\": \"system.users\",\n \"query\": \"{'_id': 'admin.root'}\",\n \"projection\": \"{'roles': 1}\"\n }\n }\n }\n ]\n },\n \"integrations\": {\n \"mongo-i\": {\n \"endpoint\": {\n \"host\": \"mongodb://root:example@{{integration_mongodb_host}}:27017\"\n },\n \"authentication\": {\n \"custom\": {\n \"databaseName\": {\n \"value\": \"admin\"\n }\n }\n }\n }\n }\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{orchestrator_scheme}}://{{orchestrator_host}}:{{orchestrator_port}}/v2/execute",
"protocol": "{{orchestrator_scheme}}",
"host": [
"{{orchestrator_host}}"
],
"port": "{{orchestrator_port}}",
"path": [
"v2",
"execute"
]
}
},
"response": []
}
]
}
]
}
],
"description": "run docker deps\n\n`docker-compose -f compose.full.yaml up localstack`\n\ninit kinesis\n\n`./scripts/plugins/integration/kinesis/init-kinesis.sh`"
},
{
"name": "restapi",
"item": [
Expand Down Expand Up @@ -13739,4 +14043,5 @@
"value": ""
}
]
}
}

10 changes: 8 additions & 2 deletions postman/environments/ci-opa.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "5927d27a-53e9-4c36-ac5f-540c10cd3488",
"id": "b57f083e-9acd-4dd0-b2c1-e47dab3f127f",
"name": "ci-opa",
"values": [
{
Expand Down Expand Up @@ -49,9 +49,15 @@
"value": "http://localstack",
"type": "default",
"enabled": true
},
{
"key": "integration_mongodb_host",
"value": "mongodb",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2024-10-22T14:24:40.747Z",
"_postman_exported_at": "2024-11-13T14:42:30.880Z",
"_postman_exported_using": "Postman/11.14.1"
}
10 changes: 8 additions & 2 deletions postman/environments/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "483ba6f1-d328-4b85-858c-57b12b90af70",
"id": "b8ef3215-f073-44a4-aa42-6859f5d84c3d",
"name": "ci",
"values": [
{
Expand Down Expand Up @@ -43,9 +43,15 @@
"value": "http://localstack",
"type": "default",
"enabled": true
},
{
"key": "integration_mongodb_host",
"value": "mongodb",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2024-10-22T14:24:50.557Z",
"_postman_exported_at": "2024-11-13T14:42:36.789Z",
"_postman_exported_using": "Postman/11.14.1"
}
Loading

0 comments on commit 6940a38

Please sign in to comment.