Skip to content

Commit ff44e37

Browse files
evereqRolandM99paradoxe35dependabot[bot]samuelmbabhazi
authored
Stage (#9213)
* fix: remove and use only lax to avoid the oauth flow to be restrictive * feat: migrate GitHub workflows to Ubicloud/Warp runners and normalize YAML quoting * chore(deps): bump min-document from 2.19.0 to 2.19.2 Bumps [min-document](https://github.com/Raynos/min-document) from 2.19.0 to 2.19.2. - [Commits](Raynos/min-document@v2.19.0...v2.19.2) --- updated-dependencies: - dependency-name: min-document dependency-version: 2.19.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * feat(redis): migrate from cache-manager-redis-yet to @keyv/redis (#9172) * feat(redis): improve Redis connection configuration - Add pingInterval (30s) to prevent LB/firewall disconnections - Add keepAlive (10s) for TCP keepalive - Add reconnectStrategy with exponential backoff (1s-5s) - Add connectTimeout (10s) for connection stability - Apply improvements to session store, cache store, and health checks - Optimize for DigitalOcean Valkey 8 compatibility Resolves #9162 (step 4) * fix typos * fix(redis): implement true exponential backoff in reconnectStrategy - Replace linear progression (1000 + retries * 200) with exponential backoff (1000 * 2^retries) - Retry delays now: 1000ms, 2000ms, 4000ms, 5000ms (capped) - Previous formula was arithmetic, not exponential as claimed in comment - Apply fix to session store, cache store, and health checks Resolves #9162 (reconnectStrategy fix) * feat: migrate from cache-manager-redis-yet to @keyv/redis with production-ready options - Replace outdated cache-manager-redis-yet with modern @keyv/redis adapter - Create new CacheModule with Keyv Redis integration - Add production-ready Redis connection options: - keepAlive: 10_000ms for TCP keepalive - reconnectStrategy with exponential backoff (1s-5s) - connectTimeout: 10_000ms for connection stability - pingInterval: 30_000ms to prevent LB/firewall disconnections - isolationPoolOptions with connection pooling (min: 1, max: 100) - TLS support for secure connections - Configure Keyv options for optimal performance: - namespace: 'gauzy-cache' for key organization - useUnlink: true for better performance (UNLINK vs DEL) - clearBatchSize: 1000 for batch operations - throwOnConnectError: true for error handling - Create CacheService with get/set/delete/clear methods - Update app.module.ts to use new CacheModule - Remove cache-manager-redis-yet dependency from package.json * fix cspell * fix redis config * fix ttl config * fix ttl config * remove unused import * chore: sanitize .env.sample - remove sensitive credentials * Refactor cache service * refactor(cache): migrate from cache-manager-redis-yet to cacheable with 2-layer non-blocking cache - Replace cache-manager-redis-yet with cacheable package - Implement 2-layer caching (in-memory L1 + Redis L2) - Configure non-blocking mode for Redis operations - Add Redis URL validation to prevent invalid URLs - Remove custom cache module in favor of NestJS cache-manager integration - Add fallback to in-memory cache if Redis connection fails Follows NestJS caching documentation and cacheable best practices: https://docs.nestjs.com/techniques/caching https://cacheable.org/docs/cacheable/#non-blocking-with-keyvredis * refactor(cache): simplify cache configuration using createKeyvNonBlocking helper - Use createKeyvNonBlocking() helper function from @keyv/redis for non-blocking Redis setup - Remove manual Redis client configuration (disableOfflineQueue, reconnectStrategy, event listeners) - Remove explicit primary cache configuration (Cacheable manages in-memory LRU by default) - Replace 'as any' type cast with factory function for type safety - Simplify code from ~120 lines to ~40 lines while maintaining same functionality Benefits: - Automatic non-blocking configuration (disableOfflineQueue: true, reconnectStrategy: false, throwOnConnectError: false) - Type-safe cache-manager integration without 'as any' cast - Cleaner, more maintainable code following cacheable best practices - Default in-memory LRU cache managed by Cacheable (Layer 1) - Non-blocking Redis cache for distributed persistence (Layer 2) Follows cacheable documentation: https://cacheable.org/docs/cacheable/#non-blocking-with-keyvredis * fix(cache): improve security and error handling Security improvements: - Remove credential logging: Replace plain-text Redis URL logging with sanitized connection info - Log only host, port, and protocol (rediss/redis) without username/password - Prevent credential exposure in application logs (compliance & security best practice) Error handling improvements: - Fix invalid fallback: Replace 'store: undefined' with proper in-memory config - Add try-catch around Redis initialization to handle connection failures gracefully - Return '{ isGlobal: true }' for in-memory fallback instead of broken 'store: undefined' - Ensure cache operations continue to work even when Redis is unavailable Before (security risk): console.log('REDIS_URL: ', url); // Logs: redis://user:password@host:6379 After (secure): console.log('Redis Cache: Connecting to redis://host:6379'); // No credentials Before (broken fallback): return { store: undefined }; // Cache operations will fail After (working fallback): return { isGlobal: true }; // In-memory cache works correctly * fix 2layer cache * add primary store * fix config * fix return * fix deeepscan * feat: add comprehensive Redis configuration properties for cache consistency - Parse Redis URL to extract username, password, host, port - Add conditional socket configuration based on TLS/TCP mode - TLS mode: tls, passphrase, rejectUnauthorized, connectTimeout - TCP mode: keepAlive, keepAliveInitialDelay, connectTimeout - Add pingInterval for connection keep-alive - Maintain consistency with RedisHealthIndicator configuration - Respect non-blocking mode constraints (reconnectStrategy omitted) * fix parse * fix parse * add default port * improve parse int * fix comment --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: rolandm99 <[email protected]> Co-authored-by: Paradoxe Ngwasi <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: samuel mbabhazi <[email protected]>
2 parents ec8919d + d0ada24 commit ff44e37

File tree

61 files changed

+2254
-2170
lines changed

Some content is hidden

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

61 files changed

+2254
-2170
lines changed

.cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
"keyresult",
269269
"keyresults",
270270
"keyrings",
271+
"keyv",
271272
"killall",
272273
"KNEX",
273274
"knexfile",
@@ -348,6 +349,7 @@
348349
"ngsw",
349350
"ngtools",
350351
"nocase",
352+
"nodenext",
351353
"nodownload",
352354
"NOLOGO",
353355
"notif",

.github/workflows/agent-prod.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Agent Build Prod
22

33
on:
44
workflow_run:
5-
workflows: ['Release Prod']
5+
workflows: ["Release Prod"]
66
branches: [master]
77
types:
88
- completed
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
os: [buildjet-16vcpu-ubuntu-2204]
20+
os: [ubicloud-standard-16]
2121

2222
steps:
2323
- name: Check out Git repository
@@ -27,28 +27,28 @@ jobs:
2727
uses: buildjet/setup-node@v4
2828
with:
2929
node-version: 20.18.1
30-
cache: 'yarn'
30+
cache: "yarn"
3131

3232
- name: Change permissions
33-
run: 'sudo chown -R $(whoami) ./*'
33+
run: "sudo chown -R $(whoami) ./*"
3434

3535
- name: Install system dependencies
36-
run: 'sudo apt-get update && sudo apt install -y curl gnupg git libappindicator3-1 ca-certificates binutils icnsutils graphicsmagick'
36+
run: "sudo apt-get update && sudo apt install -y curl gnupg git libappindicator3-1 ca-certificates binutils icnsutils graphicsmagick"
3737

3838
- name: Fix node-gyp and Python
3939
run: python3 -m pip install packaging setuptools
4040

4141
- name: Install latest version of NPM
42-
run: 'sudo npm install -g npm@9'
42+
run: "sudo npm install -g npm@9"
4343

4444
- name: Install node-gyp package
45-
run: 'sudo npm install --quiet -g [email protected]'
45+
run: "sudo npm install --quiet -g [email protected]"
4646

4747
- name: Install Yarn dependencies
48-
run: 'yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts'
48+
run: "yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts"
4949

5050
- name: Run Postinstall Manually
51-
run: 'yarn postinstall.manual'
51+
run: "yarn postinstall.manual"
5252

5353
- name: Bump agent version
5454
uses: actions/github-script@v7
@@ -57,24 +57,24 @@ jobs:
5757
const script = require('./.scripts/bump-version-electron.js')
5858
console.log(script.agent(true))
5959
env:
60-
PROJECT_REPO: 'https://github.com/ever-co/ever-gauzy.git'
61-
AGENT_APP_NAME: 'ever-gauzy-agent'
62-
COMPANY_SITE_LINK: 'https://gauzy.co'
63-
AGENT_APP_DESCRIPTION: 'Ever Gauzy Agent'
64-
AGENT_APP_ID: 'com.ever.gauzyagent'
60+
PROJECT_REPO: "https://github.com/ever-co/ever-gauzy.git"
61+
AGENT_APP_NAME: "ever-gauzy-agent"
62+
COMPANY_SITE_LINK: "https://gauzy.co"
63+
AGENT_APP_DESCRIPTION: "Ever Gauzy Agent"
64+
AGENT_APP_ID: "com.ever.gauzyagent"
6565

6666
- name: Build Agent
67-
run: 'yarn build:agent:linux:release:gh'
67+
run: "yarn build:agent:linux:release:gh"
6868
env:
6969
USE_HARD_LINKS: false
7070
GH_TOKEN: ${{ secrets.GH_TOKEN }}
7171
EP_GH_IGNORE_TIME: true
7272
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
73-
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
74-
SENTRY_PROFILE_SAMPLE_RATE: '${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}'
75-
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
76-
SENTRY_POSTGRES_TRACKING_ENABLED: '${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}'
77-
SENTRY_PROFILING_ENABLED: '${{ secrets.SENTRY_PROFILING_ENABLED }}'
73+
SENTRY_TRACES_SAMPLE_RATE: "${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}"
74+
SENTRY_PROFILE_SAMPLE_RATE: "${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}"
75+
SENTRY_HTTP_TRACING_ENABLED: "${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}"
76+
SENTRY_POSTGRES_TRACKING_ENABLED: "${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}"
77+
SENTRY_PROFILING_ENABLED: "${{ secrets.SENTRY_PROFILING_ENABLED }}"
7878
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
7979
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
8080
NX_NO_CLOUD: true
@@ -84,7 +84,7 @@ jobs:
8484

8585
strategy:
8686
matrix:
87-
os: [macos-latest]
87+
os: [warp-macos-15-arm64-6x]
8888

8989
steps:
9090
- name: Check out Git repository
@@ -94,22 +94,22 @@ jobs:
9494
uses: actions/setup-node@v4
9595
with:
9696
node-version: 20.18.1
97-
cache: 'yarn'
97+
cache: "yarn"
9898

9999
- name: Fix node-gyp and Python
100100
run: python3 -m pip install --break-system-packages packaging setuptools
101101

102102
- name: Install latest version of NPM
103-
run: 'sudo npm install -g npm@9'
103+
run: "sudo npm install -g npm@9"
104104

105105
- name: Install node-gyp package
106-
run: 'sudo npm install --quiet -g [email protected]'
106+
run: "sudo npm install --quiet -g [email protected]"
107107

108108
- name: Install Yarn dependencies
109-
run: 'yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts'
109+
run: "yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts"
110110

111111
- name: Run Postinstall Manually
112-
run: 'yarn postinstall.manual'
112+
run: "yarn postinstall.manual"
113113

114114
- name: Bump Agent version
115115
uses: actions/github-script@v7
@@ -118,24 +118,24 @@ jobs:
118118
const script = require('./.scripts/bump-version-electron.js')
119119
console.log(script.agent(true))
120120
env:
121-
PROJECT_REPO: 'https://github.com/ever-co/ever-gauzy.git'
122-
AGENT_APP_NAME: 'ever-gauzy-agent'
123-
COMPANY_SITE_LINK: 'https://gauzy.co'
124-
AGENT_APP_DESCRIPTION: 'Ever Gauzy Agent'
125-
AGENT_APP_ID: 'com.ever.gauzyagent'
121+
PROJECT_REPO: "https://github.com/ever-co/ever-gauzy.git"
122+
AGENT_APP_NAME: "ever-gauzy-agent"
123+
COMPANY_SITE_LINK: "https://gauzy.co"
124+
AGENT_APP_DESCRIPTION: "Ever Gauzy Agent"
125+
AGENT_APP_ID: "com.ever.gauzyagent"
126126

127127
- name: Build Agent
128-
run: 'yarn build:agent:mac:release'
128+
run: "yarn build:agent:mac:release"
129129
env:
130130
USE_HARD_LINKS: false
131131
GH_TOKEN: ${{ secrets.GH_TOKEN }}
132132
EP_GH_IGNORE_TIME: true
133133
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
134-
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
135-
SENTRY_PROFILE_SAMPLE_RATE: '${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}'
136-
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
137-
SENTRY_POSTGRES_TRACKING_ENABLED: '${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}'
138-
SENTRY_PROFILING_ENABLED: '${{ secrets.SENTRY_PROFILING_ENABLED }}'
134+
SENTRY_TRACES_SAMPLE_RATE: "${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}"
135+
SENTRY_PROFILE_SAMPLE_RATE: "${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}"
136+
SENTRY_HTTP_TRACING_ENABLED: "${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}"
137+
SENTRY_POSTGRES_TRACKING_ENABLED: "${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}"
138+
SENTRY_PROFILING_ENABLED: "${{ secrets.SENTRY_PROFILING_ENABLED }}"
139139
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
140140
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
141141
NX_NO_CLOUD: true
@@ -148,7 +148,7 @@ jobs:
148148

149149
strategy:
150150
matrix:
151-
os: [windows-latest]
151+
os: [warp-windows-2025-x64-8x]
152152

153153
steps:
154154
- name: Check out Git repository
@@ -158,22 +158,22 @@ jobs:
158158
uses: actions/setup-node@v4
159159
with:
160160
node-version: 20.18.1
161-
cache: 'yarn'
161+
cache: "yarn"
162162

163163
- name: Fix node-gyp and Python
164164
run: python3 -m pip install packaging setuptools
165165

166166
- name: Install latest version of NPM
167-
run: 'npm install -g npm@9'
167+
run: "npm install -g npm@9"
168168

169169
- name: Install node-gyp package
170-
run: 'npm install --quiet -g [email protected]'
170+
run: "npm install --quiet -g [email protected]"
171171

172172
- name: Install Yarn dependencies
173-
run: 'yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts'
173+
run: "yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts"
174174

175175
- name: Run Postinstall Manually
176-
run: 'yarn postinstall.manual'
176+
run: "yarn postinstall.manual"
177177

178178
- name: Bump Agent version
179179
uses: actions/github-script@v7
@@ -182,11 +182,11 @@ jobs:
182182
const script = require('./.scripts/bump-version-electron.js')
183183
console.log(script.agent(true))
184184
env:
185-
PROJECT_REPO: 'https://github.com/ever-co/ever-gauzy.git'
186-
AGENT_APP_NAME: 'ever-gauzy-agent'
187-
COMPANY_SITE_LINK: 'https://gauzy.co'
188-
AGENT_APP_DESCRIPTION: 'Ever Gauzy Agent'
189-
AGENT_APP_ID: 'com.ever.gauzyagent'
185+
PROJECT_REPO: "https://github.com/ever-co/ever-gauzy.git"
186+
AGENT_APP_NAME: "ever-gauzy-agent"
187+
COMPANY_SITE_LINK: "https://gauzy.co"
188+
AGENT_APP_DESCRIPTION: "Ever Gauzy Agent"
189+
AGENT_APP_ID: "com.ever.gauzyagent"
190190

191191
- name: Build Agent
192192
run: |
@@ -196,11 +196,11 @@ jobs:
196196
GH_TOKEN: ${{ secrets.GH_TOKEN }}
197197
EP_GH_IGNORE_TIME: true
198198
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
199-
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
200-
SENTRY_PROFILE_SAMPLE_RATE: '${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}'
201-
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
202-
SENTRY_POSTGRES_TRACKING_ENABLED: '${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}'
203-
SENTRY_PROFILING_ENABLED: '${{ secrets.SENTRY_PROFILING_ENABLED }}'
199+
SENTRY_TRACES_SAMPLE_RATE: "${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}"
200+
SENTRY_PROFILE_SAMPLE_RATE: "${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}"
201+
SENTRY_HTTP_TRACING_ENABLED: "${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}"
202+
SENTRY_POSTGRES_TRACKING_ENABLED: "${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}"
203+
SENTRY_PROFILING_ENABLED: "${{ secrets.SENTRY_PROFILING_ENABLED }}"
204204
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
205205
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
206206
NX_NO_CLOUD: true

0 commit comments

Comments
 (0)