Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
234 commits
Select commit Hold shift + click to select a range
6bb4997
build openpanel image ci
harshitsaamu Dec 4, 2025
31cfd93
Merge branch 'Openpanel-dev:main' into main
harshitsaamu Dec 4, 2025
604baa5
update image tags
harshitsaamu Dec 5, 2025
e7464c8
Merge branch 'main' of github.com:Dashverse/openpanel-forked
harshitsaamu Dec 5, 2025
05e8f85
add WHERE clause to fix conversion charts
harshitsaamu Dec 5, 2025
f79388e
fix conversion chart
harshitsaamu Dec 6, 2025
5683e56
Merge pull request #1 from Dashverse/conversion-chart-fix
harshitsaamu Dec 6, 2025
1aa6144
fix profile filter and funnel charts (#2)
harshitsaamu Dec 6, 2025
1d1b1a1
fix charts breakdown charts (#3)
harshitsaamu Dec 6, 2025
c7f8722
Merge branch 'Openpanel-dev:main' into main
harshitsaamu Dec 8, 2025
d8a62c5
expose profile created at timestamps for filtering (#4)
harshitsaamu Dec 8, 2025
69e3a85
Merge branch 'Openpanel-dev:main' into main
harshitsaamu Dec 11, 2025
8bd653b
remove event retention
harshitsaamu Dec 13, 2025
8266bf7
add group mq to api
harshitsaamu Dec 13, 2025
c8df7c6
add group mq to api
harshitsaamu Dec 13, 2025
b4d3e4f
add group mq to api
harshitsaamu Dec 13, 2025
bf95bc1
Fetch remote v1 (#5)
harshitsaamu Dec 14, 2025
f695064
Merge branch 'Openpanel-dev:main' into main
harshitsaamu Dec 14, 2025
98703f6
enable shard distribution (#6)
harshitsaamu Dec 15, 2025
6080f4d
Merge branch 'Openpanel-dev:main' into main
harshitsaamu Dec 16, 2025
1ea7ffc
add limits in breakdown charts (#7)
harshitsaamu Dec 22, 2025
c9649d3
fix api build (#8)
harshitsaamu Dec 22, 2025
654104e
optimise breakdown queries (#9)
harshitsaamu Dec 22, 2025
6d3e86e
revert breakdown queries, migrated to clickhouse 25.3 (#10)
harshitsaamu Dec 22, 2025
35b49e0
reduce breakdown query limit from 500 to 20 (#11)
harshitsaamu Dec 23, 2025
dcacd1e
reduce breakdown query limit from 500 to 20 (#12)
harshitsaamu Dec 23, 2025
a001d9b
remove stale interval, make it infinite to reduce load on db (#13)
harshitsaamu Dec 23, 2025
f16d2ca
Revert "remove stale interval, make it infinite to reduce load on db …
harshitsaamu Dec 23, 2025
d091ed0
Revert "Revert "remove stale interval, make it infinte to reduce load…
harshitsaamu Dec 23, 2025
9121187
add first seen event (#17)
harshitsaamu Dec 24, 2025
8ef971a
Increase BullMQ timeout for import worker to prevent job stalling (#18)
ayushjhanwar-png Dec 24, 2025
6881b72
Increase timeout worker (#19)
ayushjhanwar-png Dec 24, 2025
4e7c781
feat: add detailed logging to generateSessionIds for debugging
ayushjhanwar-png Dec 26, 2025
bb87c71
Merge pull request #21 from Dashverse/add-logs-to-generateSessionIds
ayushjhanwar-png Dec 26, 2025
9dd98e1
Add detailed logging to import phases 3, 4, and 5
ayushjhanwar-png Dec 26, 2025
b2f5bf4
Merge pull request #22 from Dashverse/add-logs-to-generateSessionIds
ayushjhanwar-png Dec 26, 2025
d220cd4
Reduce timeout to 5 minutes for testing and log analysis
ayushjhanwar-png Jan 6, 2026
60c7f5d
expose few materialised columns for filters (#24)
harshitsaamu Jan 8, 2026
c5f805d
centralised lock for event updates (#25)
harshitsaamu Jan 13, 2026
3d11fae
Revert "centralised lock for event updates (#25)" (#27)
harshitsaamu Jan 13, 2026
a7b5fff
Enable logs (#26)
harshitsaamu Jan 13, 2026
7e61662
add redis lock to prevent query bombarding at cache expiry (#28)
harshitsaamu Jan 14, 2026
3732a2c
update conversion query to use window functions (#29)
harshitsaamu Jan 20, 2026
d06d255
correlated subquery optimisations in charts service (#30)
harshitsaamu Jan 20, 2026
2ac21b1
large chart optimisations, properties with materialised columns optim…
harshitsaamu Jan 20, 2026
945315c
explicit handling for week and month (#32)
harshitsaamu Jan 20, 2026
4c50cae
fix week and monthly queries (#33)
harshitsaamu Jan 20, 2026
5cef5b0
Merge pull request #23 from Dashverse/reduce-timeout-5min-testing
ayushjhanwar-png Jan 21, 2026
3dd6260
add mv for daily event stats (#34)
harshitsaamu Jan 21, 2026
dac8cb1
fix migration script (#35)
harshitsaamu Jan 21, 2026
2b4f737
add materialise columns job (#36)
harshitsaamu Jan 21, 2026
8c201e2
add missing files (#37)
harshitsaamu Jan 21, 2026
7d96887
fix import (#38)
harshitsaamu Jan 21, 2026
0cf6d38
remove properties here (#39)
ayushjhanwar-png Jan 21, 2026
940d2f5
optimise property queries (#40)
harshitsaamu Jan 21, 2026
51222c5
add reasons for skipping materialisation (#41)
harshitsaamu Jan 21, 2026
3a44377
change thresholds for materialisation (#42)
harshitsaamu Jan 21, 2026
3272efd
fix: add chunking to CSV import to reduce memory usage
ayushjhanwar-png Jan 23, 2026
7764af7
Merge pull request #44 from Dashverse/fix/add-csv-chunking-10k
ayushjhanwar-png Jan 23, 2026
d2c45a7
#d2p-openpanel
ayushjhanwar-png Jan 23, 2026
7d13c63
fix: resolve memory leak in import worker
ayushjhanwar-png Jan 23, 2026
cf38e16
Merge pull request #45 from Dashverse/fix/memory-leak-import
ayushjhanwar-png Jan 23, 2026
a7d2a5d
fix: socket hangup retries memory leak issue
ayushjhanwar-png Jan 24, 2026
e8d8eb0
add custom cohort capability (#43)
harshitsaamu Jan 24, 2026
22b6b50
remove populate (#47)
harshitsaamu Jan 24, 2026
f26f6b0
add cohorts migration table (#48)
harshitsaamu Jan 24, 2026
69e2765
fix circular dependency (#49)
harshitsaamu Jan 24, 2026
8cc34fb
fix zod number issue (#50)
harshitsaamu Jan 24, 2026
3898ff6
fix: remove transformed events as null
ayushjhanwar-png Jan 24, 2026
8ec72d5
Fix cohort suggestion box (#51)
harshitsaamu Jan 24, 2026
c7c65ac
Merge pull request #46 from Dashverse/fix/memory-leak-transformedEvents
ayushjhanwar-png Jan 24, 2026
131d090
fix cohort loading issues (#52)
harshitsaamu Jan 24, 2026
1119ef5
fix cohort defination (#53)
harshitsaamu Jan 24, 2026
4a167a4
fix clickhouse insert query for cohort members (#54)
harshitsaamu Jan 24, 2026
e5eea1b
cohort suggestion box (#55)
harshitsaamu Jan 24, 2026
246ea9a
fix cohort criteria builder (#56)
harshitsaamu Jan 24, 2026
6fc3692
Revert "fix: socket hangup retries memory leak issue" (#57)
ayushjhanwar-png Jan 24, 2026
b51e3b6
fix properties filters, insert queries (#58)
harshitsaamu Jan 24, 2026
7dea2ce
pass cohort id in the filters (#59)
harshitsaamu Jan 24, 2026
d902d91
trigger new build (#60)
harshitsaamu Jan 24, 2026
f9f669b
enable static serves (#61)
harshitsaamu Jan 24, 2026
a016d59
force new hash for files (#62)
harshitsaamu Jan 24, 2026
fc4f064
remove cache from the build (#63)
harshitsaamu Jan 24, 2026
479b022
remove cache from the build (#64)
harshitsaamu Jan 24, 2026
dd61180
cohort creation changes (#65)
harshitsaamu Jan 24, 2026
05f0c9f
fix profiles filter name (#66)
harshitsaamu Jan 24, 2026
9b82baa
cohort ui fixes and query filters (#67)
harshitsaamu Jan 24, 2026
01e5e4c
expose cohort on main menu (#68)
harshitsaamu Jan 24, 2026
4c6c4f1
increase profile buffer clickhouse limits (#69)
harshitsaamu Jan 24, 2026
ada812b
fix: mutations settings to 1 and logging (#71)
ayushjhanwar-png Jan 27, 2026
c057643
fix: increase limits to 5 retry (#72)
ayushjhanwar-png Jan 28, 2026
4d13094
fix daily_stats mv queries (#74)
harshitsaamu Jan 28, 2026
5775bdf
feat: add custom events (#73)
harshitsaamu Jan 28, 2026
491ce20
fix circular dependency (#75)
harshitsaamu Jan 28, 2026
688decd
name selection issue custom events (#76)
harshitsaamu Jan 28, 2026
d377d74
remove icon and color (#77)
harshitsaamu Jan 28, 2026
885918b
fix filters for custom events (#78)
harshitsaamu Jan 28, 2026
8e51cf3
Fix filters custom events (#79)
harshitsaamu Jan 29, 2026
94ad949
Remove icon color edit custom event (#80)
harshitsaamu Jan 29, 2026
1aa32a3
conversion and funnel handling for custom events (#82)
harshitsaamu Jan 29, 2026
9716176
fix ctx for custom events in funnel charts (#83)
harshitsaamu Jan 29, 2026
91a3369
increase limits on inserts (#86)
harshitsaamu Jan 29, 2026
8b38c51
cohort breakdown (#81)
harshitsaamu Jan 29, 2026
7b48f80
add: feature to exclude Mixpanel events (#85)
ayushjhanwar-png Jan 29, 2026
5aa6a38
Fix/mutations to 0 (#84)
ayushjhanwar-png Jan 29, 2026
238b1b8
add support for custom dates, fix funnel and conversion for breakdown…
harshitsaamu Jan 29, 2026
62f76f9
fix conversion for cohorts (#88)
harshitsaamu Jan 29, 2026
937a048
multi step conversion charts (#89)
harshitsaamu Jan 29, 2026
b3fb452
fix edit cohort (#90)
harshitsaamu Jan 29, 2026
fa49ce1
fix property filters for cohorts (#91)
harshitsaamu Jan 30, 2026
2d56811
move to dynamic way of identifying materialised columns (#92)
harshitsaamu Jan 30, 2026
7288f7a
migration script changes (#94)
harshitsaamu Feb 2, 2026
1e1d11a
fix migration script (#95)
harshitsaamu Feb 2, 2026
f88b467
chunk migration scripts (#96)
harshitsaamu Feb 2, 2026
65b0c4b
Revert "Fix/mutations to 0 (#84)" (#98)
ayushjhanwar-png Feb 4, 2026
b7dabab
cohort handling with mv (#99)
harshitsaamu Feb 4, 2026
784b2a3
limit user count for static cohorts (#100)
harshitsaamu Feb 4, 2026
3aec372
limit user count for static cohorts to 10k (#101)
harshitsaamu Feb 5, 2026
ff039ce
make cohorts dynamic by default (#102)
harshitsaamu Feb 5, 2026
8b6aa8c
block refresh on static cohorts (#103)
harshitsaamu Feb 5, 2026
9192b77
handle charts with dynamic cohorts (#104)
harshitsaamu Feb 5, 2026
377839b
remove unused function (#105)
harshitsaamu Feb 5, 2026
dbd958a
fix fetch function async errors (#106)
harshitsaamu Feb 5, 2026
54144ca
fix chart errors (#107)
harshitsaamu Feb 5, 2026
4988c9f
optimise breakdown queries (#108)
harshitsaamu Feb 5, 2026
c14e541
fix conversion not in cohorts (#109)
harshitsaamu Feb 5, 2026
bd48016
optimise redis operations (#111)
harshitsaamu Feb 6, 2026
d88a96b
Migrate to events_imports_v2 with import_id partitioning (#110)
ayushjhanwar-png Feb 6, 2026
b41f83b
fix: Increase memory limit for Phase 3 import query to 10 GB (#112)
ayushjhanwar-png Feb 6, 2026
dd25b48
Increase Phase 3 memory limits to 40GB/20GB for large imports (#113)
ayushjhanwar-png Feb 6, 2026
656704e
micro batching redis optimisations (#115)
harshitsaamu Feb 6, 2026
9923eb3
Fix Phase 3 OOM: Batch process session events to reduce memory usage …
ayushjhanwar-png Feb 6, 2026
f59d259
fix cohorts charts (#118)
harshitsaamu Feb 6, 2026
761d621
Fix Phase 5 memory limit for large session aggregations (#120)
ayushjhanwar-png Feb 6, 2026
64315c3
Fix/phase3 batch insert memory optimization (#117)
ayushjhanwar-png Feb 6, 2026
fe7b2be
Breakdown fixes cohorts (#121)
harshitsaamu Feb 6, 2026
49914b7
Fix Phase 4 memory limit for large migrations (#122)
ayushjhanwar-png Feb 6, 2026
1272908
apply more fixes to fix charts (#123)
harshitsaamu Feb 6, 2026
b355074
apply more fixes to cohort breakdowns (#124)
harshitsaamu Feb 9, 2026
84da671
enable cohort refresh for dynamic cohorts (#125)
harshitsaamu Feb 9, 2026
962a1c7
add profile event property backfill and profile backfill (#126)
harshitsaamu Feb 10, 2026
64b3472
remove query limits for engage (#127)
harshitsaamu Feb 11, 2026
a31b067
change event flush frequency (#128)
harshitsaamu Feb 11, 2026
c3f0c28
fix profile property backfilling (#129)
harshitsaamu Feb 11, 2026
0c5c276
limit profile property backfilling for specific events (#130)
harshitsaamu Feb 11, 2026
eef3074
remove skip for properties backfilling (#131)
harshitsaamu Feb 11, 2026
48834ec
remove analysis for profile properties migration (#132)
harshitsaamu Feb 11, 2026
c95c9aa
profile event mv (#133)
harshitsaamu Feb 12, 2026
5d78984
fix cutom events charts (#134)
harshitsaamu Feb 12, 2026
fe83a34
handle materialised columns in custom events CTEs (#135)
harshitsaamu Feb 12, 2026
331079b
re position materialised columns (#136)
harshitsaamu Feb 15, 2026
f0e3fbf
get all columns in union for funnels and charts (#137)
harshitsaamu Feb 15, 2026
e5c7b0a
add: logging for duplicate events (#138)
ayushjhanwar-png Feb 16, 2026
17e50d0
Revert "add: logging for duplicate events (#138)" (#139)
ayushjhanwar-png Feb 16, 2026
3e92670
fix conversion numbers (#140)
harshitsaamu Feb 17, 2026
a63755c
fix build (#141)
harshitsaamu Feb 17, 2026
7e2f5fb
fix datetime import (#142)
harshitsaamu Feb 17, 2026
6c3eb6f
fix datetime import (#144)
harshitsaamu Feb 17, 2026
3ca2e70
add: deduplicate event migration (#143)
ayushjhanwar-png Feb 17, 2026
4f90828
fix: convert dup_pct to string before padStart (#145)
ayushjhanwar-png Feb 17, 2026
adcf688
Add: increase memory per query (#146)
ayushjhanwar-png Feb 17, 2026
a25d9c2
add grace period of 2 sec in conversion charts (#147)
harshitsaamu Feb 17, 2026
6902d7d
fix dashboard caching issues (#148)
harshitsaamu Feb 17, 2026
44d6882
Feat: move to events temp for janurary data with IST conversion (#149)
ayushjhanwar-png Feb 18, 2026
eed50cc
add: cehck events date (#150)
ayushjhanwar-png Feb 20, 2026
98e45df
Feat/validating ist fix (#151)
ayushjhanwar-png Feb 20, 2026
ff9a470
add: columns remove to 1 (#152)
ayushjhanwar-png Feb 20, 2026
5655495
add: columns remove to 1 (#153)
ayushjhanwar-png Feb 20, 2026
f4d2234
add: move jan data migration there right (#154)
ayushjhanwar-png Feb 20, 2026
935e0ff
add: script to validate how much data will be deleted by using OPTMIZ…
ayushjhanwar-png Feb 20, 2026
2ea2313
Revert: IST to UTC fix (#156)
ayushjhanwar-png Feb 20, 2026
57b420e
Add: uniq exact (#157)
ayushjhanwar-png Feb 20, 2026
3de3932
enable parallel event flush capability (#158)
harshitsaamu Feb 22, 2026
08d2851
add: Move 1st to 15th to events_tmp to events_tmp2 with dedup and mov…
ayushjhanwar-png Feb 23, 2026
50888c0
fix profile properties breakdown (#160)
harshitsaamu Feb 23, 2026
e2cb532
fix properties join issues (#161)
harshitsaamu Feb 23, 2026
6171b35
sort and limit breakdowns in query (#162)
harshitsaamu Feb 23, 2026
e0bba1b
move fixes on conversion charts (#163)
harshitsaamu Feb 24, 2026
7d5c1ea
fix number calculations (#164)
harshitsaamu Feb 24, 2026
4027d3a
Revert: events_tmp2 to events table (#165)
ayushjhanwar-png Feb 25, 2026
2142a1d
add: clickhouse connection logging and no shutdown of pods (#166)
ayushjhanwar-png Feb 25, 2026
a47ce35
download report capability (#167)
harshitsaamu Feb 25, 2026
bc83e97
add untracked files (#169)
harshitsaamu Feb 25, 2026
6bf8a48
fix date formatting issues (#170)
harshitsaamu Feb 25, 2026
58c5674
optimise profile id based events (#171)
harshitsaamu Feb 25, 2026
b123a4f
feat: add custom alerts (threshold + anomaly detection) for dashboard…
ayushjhanwar-png Mar 2, 2026
813c443
fix: add @openpanel/constants dependency to worker package (#174)
ayushjhanwar-png Mar 2, 2026
f4b2a13
fix: update pnpm lockfile for @openpanel/constants worker dependency …
ayushjhanwar-png Mar 2, 2026
73db305
feat: add custom alerts UI (threshold + anomaly) and rich Slack notif…
ayushjhanwar-png Mar 2, 2026
680f4e7
fix: remove spinner arrows from threshold value input (#177)
ayushjhanwar-png Mar 2, 2026
4cd0356
materialise profile properties (#178)
harshitsaamu Mar 3, 2026
96ad96c
fix materialise column errors (#179)
harshitsaamu Mar 4, 2026
ef1cb31
fix logging for big int (#181)
harshitsaamu Mar 4, 2026
536e9b8
add table filter on materialised columns (#180)
harshitsaamu Mar 4, 2026
b8ed725
conversion chart optimisations (#183)
harshitsaamu Mar 4, 2026
7c7fd52
feat: add global filters backend for reports (#184)
ayushjhanwar-png Mar 5, 2026
c5d1c7a
feat: add global filters UI in report sidebar (#185)
ayushjhanwar-png Mar 5, 2026
af028fa
feat: add hold property constant for funnel reports (#186)
ayushjhanwar-png Mar 5, 2026
6fe4182
fix: pass holdProperties and globalFilters to funnel tRPC query (#187)
ayushjhanwar-png Mar 5, 2026
d50a10d
feat: increase MAX_CARDINALITY to 5000 for materialized columns
ayushjhanwar-png Mar 6, 2026
91cc460
Revert "feat: increase MAX_CARDINALITY to 5000 for materialized columns"
ayushjhanwar-png Mar 6, 2026
0f4aec5
feat: add hold property constant support for conversion charts (#190)
ayushjhanwar-png Mar 6, 2026
2a70570
fix conversion charts (#191)
harshitsaamu Mar 6, 2026
f94c72a
feat: increase MAX_CARDINALITY to 5000 for materialized columns (#189)
ayushjhanwar-png Mar 6, 2026
5607d8c
feat: add global filters support for funnel and conversion charts (#192)
ayushjhanwar-png Mar 6, 2026
e7fd30c
change csv format, customise breakdown limits (#194)
harshitsaamu Mar 10, 2026
a7d6603
feat: add time-to-convert backend for funnel and conversion charts (#…
ayushjhanwar-png Mar 10, 2026
afd98e0
fix: handle NULL in TTC dateDiff for non-converting users (#196)
ayushjhanwar-png Mar 10, 2026
3acbc3e
fix: check empty string for LEFT JOIN non-matches in TTC (#197)
ayushjhanwar-png Mar 10, 2026
b215f8e
feat: add time-to-convert frontend for funnel and conversion charts (…
ayushjhanwar-png Mar 10, 2026
1aa83dd
fix: remove fastest/slowest from TTC summary (#199)
ayushjhanwar-png Mar 10, 2026
525e862
feat: add Codex AI code review workflow
sam17 Mar 11, 2026
0527e16
fix: persist measuring field and fix funnelGroup/funnelWindow clearin…
ayushjhanwar-png Mar 12, 2026
9a87c41
fix: use toDate instead of toDateTime for cohort event_date compariso…
ayushjhanwar-png Mar 12, 2026
dcab3ca
add quotes to columns (#202)
harshitsaamu Mar 13, 2026
60f4760
remove event based redis lookup for notifications (#204)
harshitsaamu Mar 13, 2026
da282ee
Fix/global cohort filter frontend (#203)
ayushjhanwar-png Mar 13, 2026
d92e96f
remove dedup check (#205)
harshitsaamu Mar 17, 2026
c143ac6
Revert "remove dedup check (#205)" (#206)
harshitsaamu Mar 17, 2026
a28c9e0
Revert "Revert "remove dedup check (#205)" (#206)" (#208)
ayushjhanwar-png Mar 17, 2026
b958648
feat: split Redis into dedicated session and event instances (#210)
harshitsaamu Mar 18, 2026
5a844e6
fix: use conversion rate (%) for alerts on conversion/funnel charts (…
ayushjhanwar-png Mar 19, 2026
252f02c
fix: restore changeDateRanges import in report-editor (#211)
ayushjhanwar-png Mar 19, 2026
0ec41b7
fix: strip pre-wrapped backticks from materialized columns in convers…
ayushjhanwar-png Mar 19, 2026
c3387a8
fix: use 7d historical range for hourly anomaly detection instead of …
ayushjhanwar-png Mar 20, 2026
c89b178
remove custom alerts (#214)
harshitsaamu Mar 20, 2026
29e8f30
feat: use profile_event_summary_mv for cohort breakdown queries (#216)
ayushjhanwar-png Mar 23, 2026
5e1f58d
feat: add report search to dashboard view (#218)
muralikrishna13-dash Mar 24, 2026
0750f28
fix: add {event_buffer} hash tags to Redis keys for cluster compatibi…
harshitsaamu Mar 24, 2026
2871165
perf: optimise conversion query with ASOF JOIN and column pruning (#222)
harshitsaamu Mar 24, 2026
e2e1204
Perf/conversion dedup empty id filter (#223)
harshitsaamu Mar 24, 2026
c89adae
fix: resolve GROUP BY aggregate error in start_events deduplication (…
harshitsaamu Mar 24, 2026
fdf86cf
feat: add download functionality to cohorts
harshitsaamu Mar 25, 2026
102fde4
fix: add {event_buffer} hash tag to live:visitors keys for cluster co…
harshitsaamu Mar 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/codex-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Codex Code Review

on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: codex-review-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
codex-review:
uses: Dashverse/infra/.github/workflows/codex-review.yml@main
secrets:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
app_id: ${{ secrets.APP_ID }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}

192 changes: 32 additions & 160 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ name: Docker Build and Push
on:
workflow_dispatch:
push:
# branches: [ "main" ]
branches: [ "main" ]
paths:
- "apps/api/**"
- "apps/worker/**"
- "apps/public/**"
- "apps/start/**"
- "packages/**"
- "!packages/sdks/**"
- "**Dockerfile"
- ".github/workflows/**"

env:
repo_owner: "openpanel-dev"

jobs:
changes:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,89 +45,28 @@ jobs:
- 'packages/**'
- '.github/workflows/**'

lint-and-test:
needs: changes
if: ${{ needs.changes.outputs.api == 'true' || needs.changes.outputs.worker == 'true' || needs.changes.outputs.public == 'true' || needs.changes.outputs.dashboard == 'true' }}
runs-on: ubuntu-latest
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping || exit 1"
--health-interval 5s
--health-timeout 3s
--health-retries 20
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Codegen
run: pnpm codegen

# - name: Run Biome
# run: pnpm lint

# - name: Run TypeScript checks
# run: pnpm typecheck

# - name: Run tests
# run: pnpm test

build-and-push-api:
permissions:
packages: write
contents: write
needs: [changes, lint-and-test]
needs: changes
if: ${{ needs.changes.outputs.api == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Generate tags
id: tags
- name: Generate short SHA
id: short-sha
run: |
# Sanitize branch name by replacing / with -
BRANCH_NAME=$(echo "${{ github.ref_name }}" | sed 's/\//-/g')
# Get first 4 characters of commit SHA
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-4)
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
echo "sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
- name: Login to Azure Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ secrets.AZURE_DASH_REGISTRY_URL }}
username: ${{ secrets.AZURE_DASH_REGISTRY_CLIENT_ID }}
password: ${{ secrets.AZURE_DASH_REGISTRY_CLIENT_SECRET }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand All @@ -141,57 +77,33 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/${{ env.repo_owner }}/api:${{ steps.tags.outputs.branch_name }}-${{ steps.tags.outputs.short_sha }}
${{ secrets.AZURE_DASH_REGISTRY_URL }}/openpanel-api:${{ steps.short-sha.outputs.sha }}
${{ secrets.AZURE_DASH_REGISTRY_URL }}/openpanel-api:latest
build-args: |
DATABASE_URL=postgresql://dummy:dummy@localhost:5432/dummy

- name: Create/Update API tag
if: github.ref == 'refs/heads/main'
run: |
# Delete existing tag if it exists
if git tag -l "api" | grep -q "api"; then
git tag -d "api"
echo "Deleted local tag: api"
fi

# Create new tag
git tag "api" "${{ github.sha }}"
echo "Created tag: api"

# Push tag to remote
git push origin "api" --force
echo "Pushed tag: api"

build-and-push-worker:
permissions:
packages: write
contents: write
needs: [changes, lint-and-test]
needs: changes
if: ${{ needs.changes.outputs.worker == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Generate tags
id: tags
- name: Generate short SHA
id: short-sha
run: |
# Sanitize branch name by replacing / with -
BRANCH_NAME=$(echo "${{ github.ref_name }}" | sed 's/\//-/g')
# Get first 4 characters of commit SHA
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-4)
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
echo "sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
- name: Login to Azure Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ secrets.AZURE_DASH_REGISTRY_URL }}
username: ${{ secrets.AZURE_DASH_REGISTRY_CLIENT_ID }}
password: ${{ secrets.AZURE_DASH_REGISTRY_CLIENT_SECRET }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand All @@ -202,57 +114,33 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/${{ env.repo_owner }}/worker:${{ steps.tags.outputs.branch_name }}-${{ steps.tags.outputs.short_sha }}
${{ secrets.AZURE_DASH_REGISTRY_URL }}/openpanel-worker:${{ steps.short-sha.outputs.sha }}
${{ secrets.AZURE_DASH_REGISTRY_URL }}/openpanel-worker:latest
build-args: |
DATABASE_URL=postgresql://dummy:dummy@localhost:5432/dummy

- name: Create/Update Worker tag
if: github.ref == 'refs/heads/main'
run: |
# Delete existing tag if it exists
if git tag -l "worker" | grep -q "worker"; then
git tag -d "worker"
echo "Deleted local tag: worker"
fi

# Create new tag
git tag "worker" "${{ github.sha }}"
echo "Created tag: worker"

# Push tag to remote
git push origin "worker" --force
echo "Pushed tag: worker"

build-and-push-dashboard:
permissions:
packages: write
contents: write
needs: [changes, lint-and-test]
needs: changes
if: ${{ needs.changes.outputs.dashboard == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Generate tags
id: tags
- name: Generate short SHA
id: short-sha
run: |
# Sanitize branch name by replacing / with -
BRANCH_NAME=$(echo "${{ github.ref_name }}" | sed 's/\//-/g')
# Get first 4 characters of commit SHA
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-4)
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
echo "sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
- name: Login to Azure Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ secrets.AZURE_DASH_REGISTRY_URL }}
username: ${{ secrets.AZURE_DASH_REGISTRY_CLIENT_ID }}
password: ${{ secrets.AZURE_DASH_REGISTRY_CLIENT_SECRET }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand All @@ -263,23 +151,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/${{ env.repo_owner }}/dashboard:${{ steps.tags.outputs.branch_name }}-${{ steps.tags.outputs.short_sha }}
${{ secrets.AZURE_DASH_REGISTRY_URL }}/openpanel-dashboard:${{ steps.short-sha.outputs.sha }}
${{ secrets.AZURE_DASH_REGISTRY_URL }}/openpanel-dashboard:latest
build-args: |
NO_CLOUDFLARE=1

- name: Create/Update Dashboard tag
if: github.ref == 'refs/heads/main'
run: |
# Delete existing tag if it exists
if git tag -l "dashboard" | grep -q "dashboard"; then
git tag -d "dashboard"
echo "Deleted local tag: dashboard"
fi

# Create new tag
git tag "dashboard" "${{ github.sha }}"
echo "Created tag: dashboard"

# Push tag to remote
git push origin "dashboard" --force
echo "Pushed tag: dashboard"
89 changes: 89 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Test Build

on:
push:
branches:
- '**'
- '!main'
paths:
- "apps/api/**"
- "apps/worker/**"
- "apps/start/**"
- "packages/**"
- "!packages/sdks/**"
- "**Dockerfile"
- ".github/workflows/**"

jobs:
changes:
runs-on: ubuntu-latest
outputs:
api: ${{ steps.filter.outputs.api }}
worker: ${{ steps.filter.outputs.worker }}
public: ${{ steps.filter.outputs.public }}
dashboard: ${{ steps.filter.outputs.dashboard }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref }}
filters: |
api:
- 'apps/api/**'
- 'packages/**'
- '.github/workflows/**'
worker:
- 'apps/worker/**'
- 'packages/**'
- '.github/workflows/**'
public:
- 'apps/public/**'
- 'packages/**'
- '.github/workflows/**'
dashboard:
- 'apps/start/**'
- 'packages/**'
- '.github/workflows/**'

test-build-api:
needs: changes
if: ${{ needs.changes.outputs.api == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Test build
run: docker buildx build --file apps/api/Dockerfile --build-arg DATABASE_URL=postgresql://dummy:dummy@localhost:5432/dummy .

test-build-worker:
needs: changes
if: ${{ needs.changes.outputs.worker == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Test build
run: docker buildx build --file apps/worker/Dockerfile --build-arg DATABASE_URL=postgresql://dummy:dummy@localhost:5432/dummy .

test-build-dashboard:
needs: changes
if: ${{ needs.changes.outputs.dashboard == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Test build
run: docker buildx build --file apps/start/Dockerfile --build-arg NO_CLOUDFLARE=1 .
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
"tsdown": "0.14.2",
"typescript": "catalog:"
}
}
}
Loading