Skip to content

Commit 6e3aab4

Browse files
authored
Merge pull request #6898 from Countly/ar2rsawseen/newarchitecture
Merging next into new arch
2 parents 8c8f8d9 + b3960e7 commit 6e3aab4

File tree

51 files changed

+4335
-918
lines changed

Some content is hidden

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

51 files changed

+4335
-918
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
# Initializes the CodeQL tools for scanning.
4343
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@v3
44+
uses: github/codeql-action/init@v4
4545
with:
4646
languages: ${{ matrix.language }}
4747
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -52,7 +52,7 @@ jobs:
5252
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5353
# If this step fails, then you should remove it and run the build manually (see below)
5454
- name: Autobuild
55-
uses: github/codeql-action/autobuild@v3
55+
uses: github/codeql-action/autobuild@v4
5656

5757
# ℹ️ Command-line programs to run using the OS shell.
5858
# 📚 https://git.io/JvXDl
@@ -66,4 +66,4 @@ jobs:
6666
# make release
6767

6868
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@v3
69+
uses: github/codeql-action/analyze@v4

.github/workflows/main.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,13 @@ jobs:
280280
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/chrome.deb
281281
apt install -y /tmp/chrome.deb
282282
283+
- name: Install Sharp dependencies for image processing
284+
shell: bash
285+
run: |
286+
export DEBIAN_FRONTEND=noninteractive
287+
apt-get update -y
288+
apt-get install -y libvips-dev
289+
283290
- name: Copy code
284291
shell: bash
285292
run: |
@@ -338,8 +345,8 @@ jobs:
338345
working-directory: /opt/countly/ui-tests/cypress
339346
run: |
340347
ARTIFACT_ARCHIVE_NAME="$(date '+%Y%m%d-%H.%M')_${GITHUB_REPOSITORY#*/}_CI#${{ github.run_number }}_${{ matrix.test_type }}.tar.gz"
341-
mkdir -p screenshots videos
342-
tar zcvf "$ARTIFACT_ARCHIVE_NAME" screenshots videos
348+
mkdir -p screenshots videos downloads
349+
tar zcvf "$ARTIFACT_ARCHIVE_NAME" screenshots videos downloads
343350
curl -o /tmp/uploader.log -u "${{ secrets.BOX_UPLOAD_AUTH }}" ${{ secrets.BOX_UPLOAD_PATH }} -T "$ARTIFACT_ARCHIVE_NAME"
344351
345352
ui-test-sdk:

CHANGELOG.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,69 @@
22
Dependencies:
33
- Remove SQLite
44

5+
## Version 25.03.xx
6+
Fixes:
7+
- [push] Fixed timeout setting
8+
- [security] Fixed injection possibility on res.expose
9+
10+
Enterprise Fixes:
11+
- [groups] Add logs for user updates
12+
- [surveys] Change question map log to debug log
13+
14+
Enterprise Fixes:
15+
- [data-manager] Fixed bug when merging events with ampersand symbol in the name
16+
17+
Dependencies:
18+
- Bump axios from 1.12.2 to 1.13.1 in /plugins/cognito
19+
- Bump csvtojson from 1.1.12 to 2.0.14
20+
- Bump eslint-plugin-vue from 10.5.0 to 10.5.1
21+
- Bump express-rate-limit from 8.1.0 to 8.2.0
22+
- Bump get-random-values from 4.0.0 to 4.1.0
23+
- Bump lint-staged from 16.2.4 to 16.2.6
24+
- Bump mockttp from 4.2.0 to 4.2.1 in /plugins/crash_symbolication
25+
- Bump nodemailer from 7.0.9 to 7.0.10
26+
- Bump puppeteer from 24.25.0 to 24.27.0
27+
- Bump vite from 7.1.10 to 7.1.12
28+
29+
## Version 25.03.25
30+
Fixes:
31+
- [crashes] Fixed resolving audit log recording
32+
- [location] Fixed updating none gps coordinate location after gps location was used
33+
34+
Enterprise Fixes:
35+
- [ab-testing] Add script for fixing variant cohort
36+
- [groups] Fix user permission update after updating user group permission
37+
## Version 25.03.24
38+
Fixes:
39+
- [jobs] Fix condition for scheduling alert job
40+
41+
Enterprise Fixes:
42+
- [compliance-hub] Fixed query patterns
43+
- [data-manager] Fixed bug preventing transformation of events ending in a dot
44+
- [data-manager] Fixed segment data deletion
45+
- [license] Stop sending metric after license expired
46+
- [users] Fix add/remove user to profile group
47+
- [users] Remove link to profile group page after removing user from group
48+
49+
Dependencies
50+
- Bump @faker-js/faker from 10.0.0 to 10.1.0 in /ui-tests
51+
- Bump countly-sdk-nodejs from 24.10.2 to 24.10.3
52+
- Bump lint-staged from 16.2.3 to 16.2.4
53+
- Bump puppeteer from 24.23.0 to 24.24.1
54+
55+
## Version 25.03.23
56+
Fixes:
57+
- [events] Entries in the event list are now sorted alphabetically
58+
- [mail] Add smtp debug option for mail module
59+
60+
Enterprise Fixes:
61+
- [block] Fixed filter for consent events
62+
- [drill] [survey] Fix survey answer in drill
63+
- [funnels] Show notification if funnel results are from cache/task manager
64+
- [revenue] Card in revenue page are now correctly indentified
65+
- [users] Add survey section to user feedback page
66+
- [users] Fixed uploading user profile pictures
67+
568
## Version 25.03.22
669
Fixes:
770
- [alerts] Fix: Migrate alerts to the new events model

Dockerfile-core

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM phusion/baseimage:focal-1.2.0
1+
FROM phusion/baseimage:jammy-1.0.4
22

33
ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,times-of-day,compliance-hub,alerts,onboarding,consolidate,remote-config,hooks,dashboards,sdk,data-manager,guides
44
# Countly Enterprise:
@@ -40,7 +40,7 @@ RUN useradd -r -M -U -d /opt/countly -s /bin/false countly && \
4040
libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils \
4141
# push / nghttp2
4242
gcc g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev \
43-
libevent-dev libjansson-dev libjemalloc-dev cython python3-dev python-setuptools && \
43+
libevent-dev libjansson-dev libjemalloc-dev python3-dev python-setuptools && \
4444
# node
4545
wget -qO- https://deb.nodesource.com/setup_20.x | bash - && \
4646
# data_migration (mongo clients)
@@ -85,7 +85,7 @@ RUN useradd -r -M -U -d /opt/countly -s /bin/false countly && \
8585
# cleanup
8686
npm remove -y --no-save mocha nyc should supertest && \
8787
apt-get remove -y build-essential libkrb5-dev wget \
88-
gcc g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev cython python3-dev python-setuptools && \
88+
gcc g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev python3-dev python-setuptools && \
8989
apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
9090
apt-get clean && \
9191
rm -rf /var/lib/apt/lists/* /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* ~/.npm ~/.cache && \

api/parts/data/usage.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ plugins.register("/sdk/user_properties", async function(ob) {
10181018

10191019
if (plugins.getConfig('api', params.app && params.app.plugins, true).city_data === true && !userProps.loc && typeof data.lat !== "undefined" && typeof data.lon !== "undefined") {
10201020
// only override lat/lon if no recent gps location exists in user document
1021-
if (!params.app_user.loc || (params.app_user.loc.gps && params.time.mstimestamp - params.app_user.loc.date > 7 * 24 * 3600)) {
1021+
if (!params.app_user.loc || !params.app_user.loc.gps || params.time.mstimestamp - params.app_user.loc.date > 7 * 24 * 3600) {
10221022
userProps.loc = {
10231023
gps: false,
10241024
geo: {
@@ -1049,7 +1049,7 @@ plugins.register("/sdk/user_properties", async function(ob) {
10491049

10501050
if (plugins.getConfig('api', params.app && params.app.plugins, true).city_data === true && !userProps.loc && data.ll && typeof data.ll[0] !== "undefined" && typeof data.ll[1] !== "undefined") {
10511051
// only override lat/lon if no recent gps location exists in user document
1052-
if (!params.app_user.loc || (params.app_user.loc.gps && params.time.mstimestamp - params.app_user.loc.date > 7 * 24 * 3600)) {
1052+
if (!params.app_user.loc || !params.app_user.loc.gps || params.time.mstimestamp - params.app_user.loc.date > 7 * 24 * 3600) {
10531053
userProps.loc = {
10541054
gps: false,
10551055
geo: {
@@ -1113,7 +1113,7 @@ plugins.register("/sdk/user_properties", async function(ob) {
11131113
userProps.av_major = null;
11141114
userProps.av_minor = null;
11151115
userProps.av_patch = null;
1116-
userProps.av_rel = null;
1116+
userProps.av_prerel = null;
11171117
userProps.av_build = null;
11181118
}
11191119
}

api/parts/jobs/job.js

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -254,32 +254,33 @@ class Job extends EventEmitter {
254254

255255
this._json.next = next.getTime();
256256
}
257-
if (this.name !== "alerts:monitor") {
258-
//check if any job already scheduled or running
259-
let query = {
260-
status: {"$in": [STATUS.SCHEDULED, STATUS.RUNNING]},
261-
name: this.name,
262-
};
263-
if (this._id) {
264-
query._id = {$ne: this._id};
265-
}
266-
var self = this;
267-
return new Promise((resolve, reject) => {
268-
Job.findMany(this.db(), query).then(existing => {
269-
if (existing && existing.length) {
270-
log.d('Job already scheduled or running: %j', existing);
271-
this._json.status = STATUS.CANCELLED; //set this as cancelled now as we have other scheduled
272-
}
273-
else {
274-
self._save().then(resolve, reject);
275-
}
276257

277-
});
278-
});
258+
//check if any job already scheduled or running
259+
let query = {
260+
status: {"$in": [STATUS.SCHEDULED, STATUS.RUNNING]},
261+
name: this.name,
262+
};
263+
264+
if (this.name === 'alerts:monitor' && this.data && Object.keys(this.data).length) {
265+
query.data = this.data;
279266
}
280-
else {
281-
return this._save();
267+
268+
if (this._id) {
269+
query._id = {$ne: this._id};
282270
}
271+
272+
var self = this;
273+
return new Promise((resolve, reject) => {
274+
Job.findMany(this.db(), query).then(existing => {
275+
if (existing && existing.length) {
276+
log.d('Job already scheduled or running: %j', existing);
277+
this._json.status = STATUS.CANCELLED; //set this as cancelled now as we have other scheduled
278+
}
279+
else {
280+
self._save().then(resolve, reject);
281+
}
282+
});
283+
});
283284
}
284285

285286
/**
@@ -1142,4 +1143,4 @@ module.exports = {
11421143
STATUS: STATUS,
11431144
STATUS_MAP: STATUS_MAP,
11441145
debounce: debounce
1145-
};
1146+
};

api/utils/pdf.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ exports.renderPDF = async function(html, callback, options = null, puppeteerArgs
4242
}
4343
const updatedTimeout = 240000;
4444
const page = await browser.newPage();
45-
45+
await page.setBypassCSP(true);
4646
page.on('console', (msg) => {
4747
log.d("Headless chrome page log", msg.text());
4848
});
@@ -74,6 +74,16 @@ exports.renderPDF = async function(html, callback, options = null, puppeteerArgs
7474
await page.setContent(html);
7575
}
7676

77+
const contentHeight = await page.evaluate(() => {
78+
/*global document*/
79+
return document.body.scrollHeight;
80+
});
81+
82+
options.width = '210mm'; // A4 width, for example
83+
options.height = `${contentHeight}px`; // full content height
84+
options.printBackground = true;
85+
options.preferCSSPageSize = true;
86+
7787
await page.pdf(options).then(callback, function(error) {
7888
log.d('pdf generation error', error);
7989
});

api/utils/render.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ exports.renderView = function(options, cb) {
6868
XDG_CONFIG_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium"),
6969
XDG_CACHE_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium")
7070
},
71-
args: ['--no-sandbox', '--disable-setuid-sandbox', '--ignore-certificate-errors'],
71+
args: ['--no-sandbox', '--disable-setuid-sandbox', '--ignore-certificate-errors', '--disable-web-security'],
7272
ignoreHTTPSErrors: true,
7373
userDataDir: pathModule.resolve(__dirname, "../../dump/chrome/" + Date.now())
7474
};
@@ -82,6 +82,7 @@ exports.renderView = function(options, cb) {
8282
try {
8383
log.d('Started rendering images');
8484
var page = await browser.newPage();
85+
await page.setBypassCSP(true);
8586

8687
page.on('console', (msg) => {
8788
log.d("Headless chrome page log", msg.text());

bin/docker/modify.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,26 @@ if [ "${COUNTLY_CONTAINER}" != "frontend" ]; then
1717
# Run ab-testing models compilation if it's there
1818
if [ -d /opt/countly/plugins/ab-testing ]; then
1919
if [ "${ID}" == "debian" ] || [ "${ID}" == "ubuntu" ]; then
20-
apt-get install -y python3-pip
20+
echo "Debian noninteractive"
21+
export DEBIAN_FRONTEND=noninteractive
22+
export TZ=Etc/UTC
23+
24+
apt-get -y update
25+
apt-get install -y software-properties-common build-essential python3-dev libncurses*-dev libsqlite3-dev libreadline6-dev libgdbm-dev zlib1g-dev libbz2-dev sqlite3 tk-dev zip libssl-dev libncurses5-dev liblzma-dev lsb-core lsb-release
26+
27+
export LC_ALL="en_US.UTF-8"
28+
export LC_CTYPE="en_US.UTF-8"
29+
export -n CC
30+
export -n CXX
31+
add-apt-repository -y ppa:deadsnakes/ppa
32+
apt -y install python3.12 python3.12-dev
33+
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
34+
python3.12 get-pip.py
2135
else
2236
yum install -y python36 python36-libs python36-devel python36-pip
2337
fi
38+
ln -s /usr/bin/python3 /usr/bin/python
2439
# shellcheck disable=SC1091
25-
python3.8 -m pip install -r /opt/countly/plugins/ab-testing/api/bayesian/requirements.txt
26-
cd /opt/countly/plugins/ab-testing/api/bayesian && python3.8 model.py
40+
python3.12 -m pip install -r "/opt/countly/plugins/ab-testing/api/bayesian/requirements_docker.txt" && sudo python3.12 "/opt/countly/plugins/ab-testing/api/bayesian/models/cmdstanpy_model.py"
2741
fi
2842
fi

bin/scripts/device_list/package-lock.json

Lines changed: 10 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)