Skip to content

Commit 89dba78

Browse files
committed
Merge branch 'release.24.10' into flex
2 parents f966b23 + fcd4729 commit 89dba78

File tree

298 files changed

+18409
-4074
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+18409
-4074
lines changed

.eslintrc.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,6 @@
237237
"for-direction": [
238238
"off"
239239
],
240-
"no-console": [
241-
"off"
242-
],
243240
"no-control-regex": [
244241
"off"
245242
],
@@ -343,4 +340,4 @@
343340
}
344341
}
345342
]
346-
}
343+
}

.github/workflows/main.yml

+39-12
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010

1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:
13+
inputs:
14+
custom_tag:
15+
description: 'Custom Docker tag (optional)'
16+
required: false
17+
default: ''
1318

1419
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1520
jobs:
@@ -64,7 +69,7 @@ jobs:
6469

6570
services:
6671
mongodb:
67-
image: mongo:6.0
72+
image: mongo:8.0
6873
options: >-
6974
--health-cmd mongosh
7075
--health-interval 10s
@@ -74,7 +79,7 @@ jobs:
7479
- 27017:27017
7580

7681
container:
77-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
82+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
7883
env:
7984
COUNTLY_CONFIG__MONGODB_HOST: mongodb
8085
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -121,7 +126,7 @@ jobs:
121126

122127
services:
123128
mongodb:
124-
image: mongo:6.0
129+
image: mongo:8.0
125130
options: >-
126131
--health-cmd mongosh
127132
--health-interval 10s
@@ -131,7 +136,7 @@ jobs:
131136
- 27017:27017
132137

133138
container:
134-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
139+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
135140
env:
136141
COUNTLY_CONFIG__MONGODB_HOST: mongodb
137142
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -155,6 +160,11 @@ jobs:
155160
shell: bash
156161
run: "sed -i 's/port: 3001,/port: 3001, workers: 1,/' /opt/countly/api/config.js"
157162

163+
- name: NPM install
164+
shell: bash
165+
working-directory: /opt/countly
166+
run: npm install
167+
158168
- name: Run tests
159169
shell: bash
160170
working-directory: /opt/countly
@@ -168,7 +178,7 @@ jobs:
168178

169179
services:
170180
mongodb:
171-
image: mongo:6.0
181+
image: mongo:8.0
172182
options: >-
173183
--health-cmd mongosh
174184
--health-interval 10s
@@ -178,7 +188,7 @@ jobs:
178188
- 27017:27017
179189

180190
container:
181-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
191+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
182192
env:
183193
COUNTLY_CONFIG__MONGODB_HOST: mongodb
184194
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -202,6 +212,11 @@ jobs:
202212
shell: bash
203213
run: "sed -i 's/port: 3001,/port: 3001, workers: 1,/' /opt/countly/api/config.js"
204214

215+
- name: NPM install
216+
shell: bash
217+
working-directory: /opt/countly
218+
run: npm install
219+
205220
- name: Install plugins
206221
shell: bash
207222
run: |
@@ -221,7 +236,7 @@ jobs:
221236

222237
services:
223238
mongodb:
224-
image: mongo:6.0
239+
image: mongo:8.0
225240
options: >-
226241
--health-cmd mongosh
227242
--health-interval 10s
@@ -231,7 +246,7 @@ jobs:
231246
- 27017:27017
232247

233248
container:
234-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
249+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
235250
env:
236251
COUNTLY_CONFIG__MONGODB_HOST: mongodb
237252
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -255,6 +270,11 @@ jobs:
255270
shell: bash
256271
run: "sed -i 's/mongosh --quiet/mongosh --host mongodb --quiet/' /opt/countly/bin/backup/import_events.sh && sed -i 's/mongoimport --db/mongoimport --host mongodb --db/' /opt/countly/bin/backup/import_events.sh"
257272

273+
- name: NPM install
274+
shell: bash
275+
working-directory: /opt/countly
276+
run: npm install
277+
258278
- name: Prepare environment
259279
shell: bash
260280
working-directory: /opt/countly
@@ -281,7 +301,8 @@ jobs:
281301
/sbin/my_init &
282302
cd ui-tests
283303
npm install
284-
npm run cy:run:dashboard
304+
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" \
305+
npm run cy:run:dashboard --headless --no-sandbox --disable-gpu --disable-dev-shm-usage
285306
286307
- name: Upload UI tests artifacts
287308
if: ${{ failure() }}
@@ -298,7 +319,7 @@ jobs:
298319

299320
services:
300321
mongodb:
301-
image: mongo:6.0
322+
image: mongo:8.0
302323
options: >-
303324
--health-cmd mongosh
304325
--health-interval 10s
@@ -308,7 +329,7 @@ jobs:
308329
- 27017:27017
309330

310331
container:
311-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
332+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
312333
env:
313334
COUNTLY_CONFIG__MONGODB_HOST: mongodb
314335
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -332,6 +353,11 @@ jobs:
332353
shell: bash
333354
run: "sed -i 's/mongosh --quiet/mongosh --host mongodb --quiet/' /opt/countly/bin/backup/import_events.sh && sed -i 's/mongoimport --db/mongoimport --host mongodb --db/' /opt/countly/bin/backup/import_events.sh"
334355

356+
- name: NPM install
357+
shell: bash
358+
working-directory: /opt/countly
359+
run: npm install
360+
335361
- name: Prepare environment
336362
shell: bash
337363
working-directory: /opt/countly
@@ -354,7 +380,8 @@ jobs:
354380
/sbin/my_init &
355381
cd ui-tests
356382
npm install
357-
npm run cy:run:onboarding
383+
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" \
384+
npm run cy:run:onboarding --headless --no-sandbox --disable-gpu --disable-dev-shm-usage
358385
359386
- name: Upload UI tests artifacts
360387
if: ${{ failure() }}

CHANGELOG.md

+56-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,57 @@
1+
## Version 24.10
2+
Fixes:
3+
- [core] Interpreting carrier value of "--" as an unknown value
4+
- [crash] Fixed issues with visualisation of Flutter stack traces
5+
- [dashoards] If a user is given access to a dashboard, they will now be able to see all widgets even if they don't have access to the underlying data
6+
- [density] UI fixed
7+
- [events] Fixed issue where slower loading data would replace newest event selection
8+
9+
Enterprise fixes:
10+
- [crashes-jira] Preventing crashing when jira authentification fails
11+
- [formulas] Removing HTML from tooltip localization
12+
13+
Features:
14+
- Making user guide icons stand out more before first use
15+
- [alerts] UI improvements
16+
- [alerts] small improvements in email notifications
17+
- [code] Unifying bottom menu for bulk operations
18+
- [core] Aggregated events data collections merged together
19+
- [nps] UI improvements
20+
- [surveys] UI improvements
21+
- upgraded mongoDB to version 7
22+
- upgraded nodejs to version 20
23+
24+
Enterprise Features:
25+
- [crash_symbolication] Added ability to set custom domain override for the symbolication server
26+
- [drill] Drill "by query" vizualization improved
27+
- [drill] Drill data collections merged together
28+
- [events] Added a quick transition to drill
29+
- [hooks] Added audit log entries for hook "create", "edit", "delete", "update" actions
30+
- [users] "Last Session" column in User Profiles is now sortable
31+
- [users] Crashes in the crashes tab can now be sorted
32+
- [users] UI improvements
33+
- [views] Added a quick transition to drill
34+
35+
## Version 24.05.15
36+
Enterprise fixes:
37+
- [nps] Fixed UI issues in the widget editor related to the "user consent" section
38+
- [ratings] Fixed rendering issue for escaped values
39+
40+
## Version 24.05.14
41+
Fixes:
42+
- [code] Added better handling for countly servers while deployed using subdirectory
43+
- [data-manager] Added missing "Create" button for event groups
44+
- [data-manager] Fixes for auto toggling data masking setting on redaction change
45+
- [populator] Fixed issues in case of wrongly structured data
46+
- [push] token shouldn't be revoked if it's already in db
47+
- [server-stats] Fixed a data point calculation bug
48+
49+
Enterprise fixes:
50+
- [push_approver] Fixed issue with the plugin not handling being "soft disabled"
51+
- [surveys] fixed a bug with the Survey widget where the "submit" button could become non interactable
52+
- [surveys] fixed issues with dashboard editor in relation to the "terms and conditions"
53+
- [surveys] fixed issues with previewing, creating and editing nps widgets
54+
155
## Version 24.05.13
256
Fixes:
357
- [alerts] Fixed bugs related to NPS alerts
@@ -14,7 +68,7 @@ Enterprise Features:
1468
## Version 24.05.12
1569
Fixes:
1670
- [dashboards] Fixes for dashboards grid
17-
- [dasboards] UI fix for dashboard widget action menu
71+
- [dashboards] UI fix for dashboard widget action menu
1872
- [push] Refactored fcm API related code
1973
- [reports] Use config for encryption key in reports
2074

@@ -32,7 +86,7 @@ Fixes:
3286
- [logs] Show collected problems on logger
3387

3488
Enterprise fixes:
35-
- [data-manager] Fixes n UI to allow events starting with "/"
89+
- [data-manager] Fixes in UI to allow events starting with "/"
3690
- [flows] Fixes for flows step generation
3791
- [surveys] Other is not allowed as a valid answer for required questions
3892

Gruntfile.js

+20-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ module.exports = function(grunt) {
241241
'frontend/express/public/javascripts/dom/drop/drop-theme-countly.min.css',
242242
'frontend/express/public/javascripts/utils/tooltipster/tooltipster.bundle.min.css',
243243
'frontend/express/public/stylesheets/bulma/bulma-custom.css',
244-
'frontend/express/public/stylesheets/styles/manifest.css',
244+
'frontend/express/public/stylesheets/styles/manifest2.css',
245245
'frontend/express/public/stylesheets/vue/element-tiptap.css',
246246
]
247247
}
@@ -324,7 +324,25 @@ module.exports = function(grunt) {
324324

325325
grunt.registerTask('default', ['mochaTest']);
326326

327-
grunt.registerTask('dist', ['sass', 'concat', 'uglify', 'cssmin']);
327+
grunt.registerTask('replace-paths', 'Replace image paths in prod CSS files', function() {
328+
var cssFiles = [
329+
{
330+
filepath: 'frontend/express/public/stylesheets/styles/manifest.css',
331+
lookup: '../../images',
332+
replacement: '../images',
333+
newPath: 'frontend/express/public/stylesheets/styles/manifest2.css'
334+
}
335+
];
336+
337+
cssFiles.forEach(function(file) {
338+
var content = grunt.file.read(file.filepath);
339+
var newContent = content.replace(/\.\.\/\.\.\/images/g, file.replacement);
340+
grunt.file.write(file.newPath, newContent);
341+
grunt.log.writeln('Processed file: ' + file.filepath);
342+
});
343+
});
344+
345+
grunt.registerTask('dist', ['sass', 'concat', 'uglify', 'replace-paths', 'cssmin']);
328346

329347
grunt.registerTask('plugins', 'Minify plugin JS / CSS files and copy images', function() {
330348
var js = [], css = [], img = [], fs = require('fs'), path = require('path');

api/api.js

100755100644
+2-2
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ plugins.connectToAllDatabases().then(function() {
156156
console.log("Successfully stored batch state");
157157
}
158158
catch (ex) {
159-
console.log("Could not store batch state");
159+
console.log("Could not store batch state", ex);
160160
}
161-
process.exit(code);
161+
process.exit(typeof code === "number" ? code : 1);
162162
}
163163

164164
/**

api/config.sample.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ var countlyConfig = {
107107
* Specifies where to store files. Value "fs" means file system or basically storing files on hard drive. Another currently supported option is "gridfs" storing files in MongoDB database using GridFS. By default fallback to "fs";
108108
* @type {string} [default=fs]
109109
*/
110-
fileStorage: "fs",
110+
fileStorage: "gridfs",
111111
/**
112112
* Specifies after how long time configurations are reloded from data base. Default value is 10000 (10 seconds)
113113
* @type {integer} [default=10000]
@@ -121,7 +121,7 @@ var countlyConfig = {
121121
/**
122122
* Share same database connection pool between databases
123123
*/
124-
shared_connection: false,
124+
shared_connection: true,
125125
/**
126126
* Simple SMTP mail sender configuration.
127127
* Can only be used when you don't have custom mailer extend ({@code countly/extend/mail.js}).

api/lib/countly.common.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1533,9 +1533,6 @@ countlyCommon.extractTwoLevelData = function(db, rangeArray, clearFunction, data
15331533
periodObj = countlyCommon.periodObj;
15341534
}
15351535

1536-
if (!rangeArray) {
1537-
return {"chartData": tableData};
1538-
}
15391536
var periodMin = 0,
15401537
periodMax = 0,
15411538
dataObj = {},
@@ -1544,6 +1541,10 @@ countlyCommon.extractTwoLevelData = function(db, rangeArray, clearFunction, data
15441541
propertyFunctions = underscore.pluck(dataProperties, "func"),
15451542
propertyValue = 0;
15461543

1544+
if (!rangeArray) {
1545+
return {"chartData": tableData};
1546+
}
1547+
15471548
if (!periodObj.isSpecialPeriod) {
15481549
periodMin = periodObj.periodMin;
15491550
periodMax = (periodObj.periodMax + 1);

api/parts/data/batcher.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class WriteBatcher {
232232
updateOne: {
233233
filter: {_id: this.data[db][collection][key].id},
234234
update: this.data[db][collection][key].value,
235-
upsert: true
235+
upsert: this.data[db][collection][key].upsert
236236
}
237237
});
238238
}
@@ -340,18 +340,25 @@ class WriteBatcher {
340340
* @param {string} id - id of the document
341341
* @param {object} operation - operation
342342
* @param {string} db - name of the database for which to write data
343+
* @param {object=} options - options for operation ((upsert: false) - if you don't want to upsert document)
343344
*/
344-
add(collection, id, operation, db = "countly") {
345+
add(collection, id, operation, db = "countly", options) {
345346
if (!this.shared || cluster.isMaster) {
346347
if (!this.data[db][collection]) {
347348
this.data[db][collection] = {};
348349
}
349350
if (!this.data[db][collection][id]) {
350-
this.data[db][collection][id] = {id: id, value: operation};
351+
this.data[db][collection][id] = {id: id, value: operation, upsert: true};
352+
if (options && options.upsert === false) {
353+
this.data[db][collection][id].upsert = false;
354+
}
351355
batcherStats.update_queued++;
352356
}
353357
else {
354358
this.data[db][collection][id].value = common.mergeQuery(this.data[db][collection][id].value, operation);
359+
if (options && options.upsert === false) {
360+
this.data[db][collection][id].upsert = this.data[db][collection][id].upsert || false;
361+
}
355362
}
356363
if (!this.process) {
357364
this.flush(db, collection);

0 commit comments

Comments
 (0)