Skip to content

Commit cbacd6b

Browse files
authored
Add streaming support based on Mongo Change streams (#31)
* Add a POC mongo data stream * Create docker-compose.test.yaml for CI * Add stream conversion to table and ts types * Add timestamp support * Add Stream type * UI update * UI improvement * Use Base64URLEncoded query text and collection in streaming path * Update README * Fix lint * Fix lint * Add `Timestamps` to supported types * Update changelog * Update version to 0.3.0 * [skip ci] Add quick start guide
1 parent ff3daa1 commit cbacd6b

19 files changed

+801
-208
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches:
6-
- '*'
6+
- "*"
77
paths-ignore:
88
- README.md
99
pull_request:
@@ -38,7 +38,7 @@ jobs:
3838
- name: Set up Python ${{ matrix.python-version }}
3939
uses: actions/setup-python@v5
4040
with:
41-
python-version: '3.11'
41+
python-version: "3.11"
4242
- name: Update plugin.json
4343
run: python3 scripts/update_plugin_metadata.py
4444
env:
@@ -49,8 +49,8 @@ jobs:
4949
- name: Setup Node.js environment
5050
uses: actions/setup-node@v4
5151
with:
52-
node-version: '20'
53-
cache: 'npm'
52+
node-version: "20"
53+
cache: "npm"
5454

5555
- name: Install dependencies
5656
run: npm ci
@@ -76,7 +76,7 @@ jobs:
7676
if: steps.check-for-backend.outputs.has-backend == 'true'
7777
uses: actions/setup-go@v5
7878
with:
79-
go-version: '1.21'
79+
go-version: "1.21"
8080

8181
- name: Test backend
8282
if: steps.check-for-backend.outputs.has-backend == 'true'
@@ -172,21 +172,21 @@ jobs:
172172
- name: Setup Node.js environment
173173
uses: actions/setup-node@v4
174174
with:
175-
node-version: '20'
176-
cache: 'npm'
175+
node-version: "20"
176+
cache: "npm"
177177

178178
- name: Install dev dependencies
179179
run: npm ci
180180

181181
- name: Start Grafana
182182
run: |
183-
docker compose pull
184-
DEVELOPMENT=false GRAFANA_VERSION=${{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=${{ matrix.GRAFANA_IMAGE.NAME }} docker compose up -d
183+
docker compose -f docker-compose.test.yaml pull
184+
DEVELOPMENT=false GRAFANA_VERSION=${{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=${{ matrix.GRAFANA_IMAGE.NAME }} docker compose -f docker-compose.test.yaml up -d
185185
186186
- name: Wait for Grafana to start
187187
uses: nev7n/wait_for_response@v1
188188
with:
189-
url: 'http://localhost:3000/'
189+
url: "http://localhost:3000/"
190190
responseCode: 200
191191
timeout: 60000
192192
interval: 500
@@ -204,7 +204,7 @@ jobs:
204204
docker logs mongodb-datasource-grafana >& grafana-server.log
205205
206206
- name: Stop grafana docker
207-
run: docker compose down
207+
run: docker compose -f docker-compose.test.yaml down
208208

209209
- name: Upload server log
210210
uses: actions/upload-artifact@v4
@@ -222,4 +222,4 @@ jobs:
222222
# with:
223223
# name: playwright-report-${{ matrix.GRAFANA_IMAGE.NAME }}-v${{ matrix.GRAFANA_IMAGE.VERSION }}-${{github.run_id}}
224224
# path: playwright-report/
225-
# retention-days: 5
225+
# retention-days: 5

CHANGELOG.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,56 @@
11
# Changelog
22

3+
## 0.3.0 - 2025-01-11
4+
5+
### Added
6+
7+
- Added Live Streaming support based on [Mongo Change Streams](https://www.mongodb.com/docs/manual/changeStreams/)(https://github.com/haohanyang/mongodb-datasource/pull/31)
8+
9+
### Changed
10+
11+
- Removed "Query" button. Built-in Query/Refresh button is recommended instead(https://github.com/haohanyang/mongodb-datasource/pull/31)
12+
313
## 0.2.1 - 2024-12-14
14+
415
### Added
5-
* Optional Mongo aggregate options(https://github.com/haohanyang/mongodb-datasource/pull/33)
6-
* Query Button(https://github.com/haohanyang/mongodb-datasource/pull/35)
16+
17+
- Optional Mongo aggregate options(https://github.com/haohanyang/mongodb-datasource/pull/33)
18+
- Query Button(https://github.com/haohanyang/mongodb-datasource/pull/35)
19+
720
### Changed
8-
* Query won't be executed automatically after focus changes. User needs to manually click buttons(https://github.com/haohanyang/mongodb-datasource/pull/35)
9-
* UI improvement(https://github.com/haohanyang/mongodb-datasource/pull/33)
21+
22+
- Query won't be executed automatically after focus changes. User needs to manually click buttons(https://github.com/haohanyang/mongodb-datasource/pull/35)
23+
- UI improvement(https://github.com/haohanyang/mongodb-datasource/pull/33)
1024

1125
## 0.2.0 - 2024-12-06
26+
1227
### Added
13-
* Enabled Grafana Alerting([67358d5c](https://github.com/haohanyang/mongodb-datasource/commit/67358d5cb1ada5571697de21016f2acf5dbc1234))
28+
29+
- Enabled Grafana Alerting([67358d5c](https://github.com/haohanyang/mongodb-datasource/commit/67358d5cb1ada5571697de21016f2acf5dbc1234))
30+
1431
### Changed
15-
* Improved query variable([#28](https://github.com/haohanyang/mongodb-datasource/pull/28))
1632

33+
- Improved query variable([#28](https://github.com/haohanyang/mongodb-datasource/pull/28))
1734

1835
## 0.1.2 - 2024-11-10
36+
1937
### Changed
20-
* Increased code editor's font size([84c7de5d](https://github.com/haohanyang/mongodb-datasource/commit/84c7de5df5035bd4c3214908eb6a389b53732cde))
21-
* Make `_id` the first column in the table if exists([#26](https://github.com/haohanyang/mongodb-datasource/pull/26))
22-
* Fix BSON array conversion to JSON([#25](https://github.com/haohanyang/mongodb-datasource/pull/25))
38+
39+
- Increased code editor's font size([84c7de5d](https://github.com/haohanyang/mongodb-datasource/commit/84c7de5df5035bd4c3214908eb6a389b53732cde))
40+
- Make `_id` the first column in the table if exists([#26](https://github.com/haohanyang/mongodb-datasource/pull/26))
41+
- Fix BSON array conversion to JSON([#25](https://github.com/haohanyang/mongodb-datasource/pull/25))
2342

2443
## 0.1.1 - 2024-10-25
25-
### Added
44+
45+
### Added
46+
2647
- [Query Variable](https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#add-a-query-variable) support
2748
- A quick start script `quick_start.py` to quickly start Grafana and MongoDB containers
49+
2850
### Changed
29-
* Added "(Optinal)" to connection string configuration tooltip
51+
52+
- Added "(Optinal)" to connection string configuration tooltip
53+
3054
## 0.1.0 - 2024-10-13
3155

3256
Initial release.

0 commit comments

Comments
 (0)