Skip to content

[skip] Add reactive sessions. #792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4,366 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
4366 commits
Select commit Hold shift + click to select a range
a3a29cc
import Nullable from core since it is documented there
jberdine Feb 20, 2025
140f54b
hide sknative properties in docs
jberdine Feb 20, 2025
e6f65c1
hide `implements NativeStub`
jberdine Feb 20, 2025
f6752f5
Improve native Reducer docs (#763)
jberdine Feb 20, 2025
45a1fc4
Add expectCmp
mbouaziz Feb 20, 2025
dad9a0c
Fix arparser tests
mbouaziz Feb 20, 2025
1b31a78
Fix semver tests
mbouaziz Feb 20, 2025
69f61d1
Fix skdate tests
mbouaziz Feb 20, 2025
280e428
Generalize skjson CI job
mbouaziz Feb 20, 2025
99d2efa
Test all skiplang libs
mbouaziz Feb 20, 2025
85fe2f3
Fix arparser, semver, skdate tests and add them to the CI (#764)
mbouaziz Feb 21, 2025
3e14f02
Print messages for todo runtime errors
mbouaziz Feb 25, 2025
f853865
Print messages for todo runtime errors (#768)
mbouaziz Feb 25, 2025
ab2e63e
Use max
mbouaziz Feb 24, 2025
76546a5
Use map
mbouaziz Feb 24, 2025
a361cc3
Remove dead unsafeGetFileIterWithReducer
mbouaziz Feb 24, 2025
b02b577
GetFixedFiles is only called with no reducer
mbouaziz Feb 24, 2025
56f574b
Optimize getFixedFilesNoReducer
mbouaziz Feb 24, 2025
a74b415
Name the iterator more explicitly
mbouaziz Feb 24, 2025
31af3bb
FixedDataMapIterator fields should be private
mbouaziz Feb 24, 2025
b66d54b
Use stuff we compute
mbouaziz Feb 24, 2025
a64183e
Simplify EagerDir#getIterRaw
mbouaziz Feb 24, 2025
7f272b6
EagerDir cleanups (#767)
mbouaziz Feb 25, 2025
83678da
Get rid of IterHolder
mbouaziz Feb 24, 2025
0ae8d3e
Replace itemsAfterKey with keysAfter
mbouaziz Feb 25, 2025
ec94fce
Get rid IterHolder (#770)
mbouaziz Feb 25, 2025
74d0dfc
Fix multiple iteration over NonEmptyIterator
mbouaziz Feb 25, 2025
8fbc59b
Fix multiple iterations over NonEmptyIterator... (#773)
mbouaziz Feb 26, 2025
dd61043
StringBytes are not mutable
mbouaziz Feb 21, 2025
e92aff6
ArrayBytes are only readonly
mbouaziz Feb 25, 2025
6861260
IndexedSequenceIterator stride is always 1
mbouaziz Feb 21, 2025
b8a3362
sizeHint may throw ContainerChanged too
mbouaziz Feb 21, 2025
1de1eb0
Remove useless collect
mbouaziz Feb 21, 2025
bf5469f
FileIterator#isEmpty is not used
mbouaziz Feb 21, 2025
b49bfa0
Rename EmptyIterator into EmptyFileIterator
mbouaziz Feb 25, 2025
3d06c00
DeletedDir iterator
mbouaziz Feb 22, 2025
cc4ba73
Use SortedSet constructor directly
mbouaziz Feb 21, 2025
dcc3f8d
Use Iterator#filterNone
mbouaziz Feb 21, 2025
b31f9e5
Use Array#map rather than iterating
mbouaziz Feb 21, 2025
03e345a
Avoid map
mbouaziz Feb 21, 2025
530330e
Less vectors
mbouaziz Feb 21, 2025
3e050e4
Various Iterator cleanups (#766)
mbouaziz Feb 26, 2025
f11e52a
Use uint32_t rather than u_int32_t
mbouaziz Feb 26, 2025
0541b1d
Remove unnecessary includes
mbouaziz Feb 26, 2025
ee760e3
Use stdint.h
mbouaziz Feb 26, 2025
76ca17b
Use time.h
mbouaziz Feb 26, 2025
6655b51
No C++ left here
mbouaziz Feb 26, 2025
13c7323
Ensure null terminator
mbouaziz Feb 26, 2025
9b91f44
Use Time.time_ms
mbouaziz Feb 26, 2025
2582c46
No need for the current_time_millis.sk burden anymore
mbouaziz Feb 26, 2025
6a18215
Move C recommended flags from prelude to cc
mbouaziz Feb 26, 2025
a47ddd2
Build skdate with cc rather than skbuild
mbouaziz Feb 26, 2025
43acc5a
Skdate cleanup (#774)
mbouaziz Feb 26, 2025
a2e5fc1
SKDB does not depend on skbuild
mbouaziz Feb 26, 2025
10a00f0
Remove skbuild
mbouaziz Feb 26, 2025
95c77b1
Skbuild is dead (#775)
mbouaziz Feb 26, 2025
22ab01b
[skdb] Clean wasm test chain
skiplabsdaniel Feb 15, 2025
c23afa4
[skdb] Clean wasm test chain (#760)
skiplabsdaniel Feb 26, 2025
e835994
Changing the order in which we update sub-directories.
pikatchu Feb 12, 2025
23ce5ae
Fixed bug in the comparison function + fixed SQL updates
pikatchu Feb 25, 2025
a21e1d3
Changing the order in which we update sub-directories. (#753)
pikatchu Feb 26, 2025
5448748
Remove superfluous prepare
mbouaziz Feb 27, 2025
7722084
Fix typos
mbouaziz Feb 27, 2025
b648b62
Remove superfluous prepare script (#780)
mbouaziz Feb 27, 2025
9a6df76
Make ProcessBuilder#process_cmd immutable
mbouaziz Feb 26, 2025
584692d
Remove ProcessBuilder#clone
mbouaziz Feb 26, 2025
ca499bc
Constructor for ProcessBuilder
mbouaziz Feb 26, 2025
de3155f
Make ProcessBuilder default constructor and fields private
mbouaziz Feb 26, 2025
858a824
Allow passing extra args to skc
mbouaziz Feb 26, 2025
072160a
Use named args for build_config
mbouaziz Feb 28, 2025
3309374
Move skc_extra_options from CompileOptions to BuildConfig
mbouaziz Feb 28, 2025
0f9ff84
Allow passing extra args to skc from skargo (#782)
mbouaziz Feb 28, 2025
8ef6b26
Check TG_OP to determine trigger type in postgres
bennostein Feb 28, 2025
1a835b4
Check TG_OP to determine trigger type in postgres (#783)
bennostein Feb 28, 2025
93c5efb
Bump NPM versions (excluding ./examples) from 0.0.10 to 0.0.11
bennostein Feb 28, 2025
8a484b3
Update examples/hackernews with new package versions
bennostein Feb 28, 2025
5efee93
Bump NPM versions from 0.0.10 to 0.0.11 (#785)
bennostein Feb 28, 2025
761c70e
[skip/server] Add option to disable CORS.
beauby Feb 27, 2025
2863474
Fix up export paths for @skipruntime/server
bennostein Feb 28, 2025
b79bb0c
[skip/server] Add option to disable CORS. (#779)
bennostein Feb 28, 2025
059d3d1
Bump NPM versions (excluding ./examples) from 0.0.11 to 0.0.12
bennostein Feb 28, 2025
dc4707e
Update package-lock.json for new server mocha tests
bennostein Feb 28, 2025
0626b14
Update examples/hackernews with new package versions
bennostein Feb 28, 2025
7aabc48
NPM versions 0.0.11 -> 0.0.12 (#786)
bennostein Feb 28, 2025
d3756e9
[examples/hackernews] Clean up SQL calls.
beauby Feb 26, 2025
f935311
[examples/hackernews] Add login.
beauby Feb 17, 2025
8619f02
[examples/hackernews] Improve layout.
beauby Feb 19, 2025
b763a80
[examples/hackernews] Add relative time.
beauby Feb 24, 2025
81a61e0
[examples/hackernews] Better fixtures.
beauby Feb 25, 2025
6e7f0ad
[examples/hackernews] Add button to simulate activity.
beauby Feb 26, 2025
0f15986
[examples/hackernews] Various improvements. (#776)
beauby Mar 2, 2025
0d5e741
Bump docs site
jberdine Mar 3, 2025
97730f3
instantiateUserObject
mbouaziz Oct 3, 2024
f1226fe
Remove unnecessary as
mbouaziz Mar 4, 2025
0643f8e
Remove unnecessary type annotation
mbouaziz Mar 5, 2025
9ee8152
Remove unused is
mbouaziz Mar 5, 2025
0b139b8
Remove deprecated comment
mbouaziz Mar 5, 2025
8e68d5c
Remove unused castBool
mbouaziz Mar 5, 2025
9dce0cb
EagerCollectionImpl.getName
mbouaziz Mar 5, 2025
a5536be
Minor cleanups in Skipruntime-ts (#789)
mbouaziz Mar 5, 2025
668013e
Validate more Postgres numeric type aliases
bennostein Mar 6, 2025
f24d6c4
Extract some utils from main Postgres adapter file
bennostein Mar 6, 2025
28cbb7d
Refactor postgres numeric type validation
bennostein Mar 6, 2025
2916f13
Validate more Postgres numeric type aliases; extract to a utils file …
bennostein Mar 6, 2025
3b7c87b
ValuesImpl#toArray as a method rather than a field
mbouaziz Feb 25, 2025
38c4334
ValuesImpl#next is private
mbouaziz Feb 25, 2025
fbf594a
Cache NonEmptyIterator values in JS
mbouaziz Feb 25, 2025
4758497
We don't need first, uniqueValue, and clone anymore
mbouaziz Feb 25, 2025
0cbcf11
NonEmptyIterator#clone is not used anymore
mbouaziz Feb 25, 2025
acf68e4
Make NonEmptyIterator mutable fields private
mbouaziz Feb 24, 2025
5651719
NonEmptyIterator#getUnique
mbouaziz Feb 21, 2025
80bdeb3
Make assertUnique return the value
mbouaziz Feb 22, 2025
21b8a64
Restrict MapFunRow to NonEmptyIterator
mbouaziz Feb 24, 2025
c61ff98
Use NonEmptyIterator#first
mbouaziz Feb 24, 2025
01f2937
NonEmptyIterator#toArray
mbouaziz Feb 24, 2025
2dad6e2
Make NonEmptyIterator not extend Iterator
mbouaziz Feb 24, 2025
e3745be
EmptyIterator#next is useless
mbouaziz Feb 24, 2025
24eb388
Use NonEmptyIterator#first rather than next()
mbouaziz Feb 24, 2025
ac2374e
NonEmptyIterator#nonEmptyReduce rather than using next
mbouaziz Feb 24, 2025
4a99c26
Make next private
mbouaziz Feb 25, 2025
ff39b5c
Use nonEmptyMap rather than map
mbouaziz Feb 25, 2025
638e209
Get rid of materialized
mbouaziz Feb 25, 2025
eeb57b5
getUnique does iterate
mbouaziz Feb 25, 2025
b158678
Make sure people do not misuse NonEmptyIterator
mbouaziz Feb 25, 2025
faf1fc0
Simplify nonEmptyReduce
mbouaziz Feb 25, 2025
e455139
iter is not mutable anymore
mbouaziz Feb 25, 2025
ddb9638
Backward-compatibility
mbouaziz Feb 28, 2025
8fbb4f4
Update bootstrap
mbouaziz Feb 28, 2025
ccb74ea
Rework ValuesImpl and NonEmptyIterator (#771)
mbouaziz Mar 7, 2025
d8bbbef
Add hacking section on building against local packages
jberdine Mar 7, 2025
7795f44
Add hacking section on building against local packages (#794)
jberdine Mar 10, 2025
6705780
Use unique resource instance IDs instead of generating PG client IDs
bennostein Mar 6, 2025
237af0f
Add PG update during unit test
bennostein Mar 6, 2025
036ccce
Add second table and delete during postgres unit test
bennostein Mar 6, 2025
d0bfd09
Handle non-unique keys in initial postgres payload
bennostein Mar 6, 2025
4a9be2c
Tweak postgres unit test to include a table with non-unique key
bennostein Mar 6, 2025
38628af
Use resource instance IDs instead of generating postgres client IDs (…
bennostein Mar 10, 2025
29f0264
[skip-adapter/postgres] Support non-unique key columns (#793)
bennostein Mar 10, 2025
cfc8f90
Bump prismjs from 1.29.0 to 1.30.0 in /www
dependabot[bot] Mar 12, 2025
b3b5d5e
@docusaurus/preset-classic is actually only used for its types
mbouaziz Mar 12, 2025
327c346
Catch package-lock.json up to latest versions
bennostein Mar 12, 2025
82ef5bc
Catch package-lock.json up to latest versions (#798)
bennostein Mar 12, 2025
0c03a37
[skip/tests] Mark the Postgres tests as skipped rather than passed.
beauby Mar 13, 2025
06f521d
[skip/tests] Mark the Postgres tests as skipped rather than passed. (…
beauby Mar 13, 2025
0fae7b9
Restructure pg-adapter subscribe; improve error messages.
bennostein Mar 11, 2025
35180d4
Test case for swallowed exceptions in mappers on external resources
bennostein Mar 12, 2025
02317cc
Add and use mechanism to make assertions about stderr in unit tests
bennostein Mar 12, 2025
4889701
Catch and log errors thrown in async contexts during reactive updates
bennostein Mar 12, 2025
d5b9107
Suppress error due to dangling promise
jberdine Mar 13, 2025
8ebef9e
Fix incorrect return type of async function
jberdine Mar 13, 2025
5001297
Disable noise lint
jberdine Mar 13, 2025
ce0c6a0
Restructure pg adapter `subscribe`; improve error messages. (#795)
bennostein Mar 13, 2025
2eead9a
Fix typos
mbouaziz Mar 12, 2025
644b40e
Test and fix trimTrailingSeparators
mbouaziz Mar 12, 2025
c29e705
Test dirname
mbouaziz Mar 12, 2025
889672d
Test basename
mbouaziz Mar 12, 2025
4563328
Test extname
mbouaziz Mar 12, 2025
0894bb7
Test normalize
mbouaziz Mar 12, 2025
e64d1a1
Test join
mbouaziz Mar 12, 2025
d88b1c2
sk_StringIterator struct to make substring clearer
mbouaziz Mar 12, 2025
3339fdb
Extract String#splitIterator from String#split
mbouaziz Mar 10, 2025
e0aff22
Add Path.relativeTo
mbouaziz Mar 10, 2025
c5d321d
Path: add tests, fix trimTrailingSeparators, add relativeTo (#796)
mbouaziz Mar 13, 2025
f8724ba
Merge branch 'main' into dependabot/npm_and_yarn/www/prismjs-1.30.0
mbouaziz Mar 13, 2025
45b0987
Bump prismjs from 1.29.0 to 1.30.0 in /www (#797)
mbouaziz Mar 13, 2025
1a78775
Bump @babel/helpers from 7.26.0 to 7.26.10 in /www
dependabot[bot] Mar 13, 2025
07ddd1f
Bump @babel/helpers from 7.26.0 to 7.26.10 in /www (#800)
mbouaziz Mar 13, 2025
a8969ff
Bump @babel/runtime-corejs3 from 7.26.0 to 7.26.10 in /www
dependabot[bot] Mar 13, 2025
972368b
Bump @babel/runtime-corejs3 from 7.26.0 to 7.26.10 in /www (#802)
mbouaziz Mar 13, 2025
2836291
Bump @babel/runtime from 7.26.0 to 7.26.10 in /www
dependabot[bot] Mar 13, 2025
eeae559
Bump @babel/runtime from 7.26.0 to 7.26.10 in /www (#803)
mbouaziz Mar 13, 2025
781cdb7
Scaffolding for @skip-adapter/kafka
bennostein Jan 28, 2025
abe92c9
Implement external service adapter for Kafka
bennostein Jan 31, 2025
cd0ceb3
Update @skip-adapter/kafka package versions
bennostein Feb 12, 2025
cf85196
Minor fixes/tweaks to appease eslint
bennostein Feb 12, 2025
206fd03
Add and configure kafka image for CircleCI
bennostein Feb 13, 2025
10de215
Parameterize KafkaExternalService by a messageProcessor
bennostein Feb 18, 2025
202e4fa
Switch circleci Kafka config to Raft consensus protocol
bennostein Feb 19, 2025
8f9f390
Simplify async shutdown on KafkaExternalService
bennostein Feb 19, 2025
b1fd0d3
Add docker-compose and reactive service for kafka example
bennostein Feb 25, 2025
b977938
Add HAProxy for kafka example
bennostein Feb 25, 2025
e29b455
Add README for Kafka chatroom example
bennostein Feb 25, 2025
30d1f26
Add web backend for kafka chatroom example
bennostein Feb 25, 2025
20e4138
Add backend healthchecks; defer reverse-proxy startup until healthy
bennostein Mar 5, 2025
d9b116f
Configure Kafka logging level, replication factor, broker ID
bennostein Mar 5, 2025
8c85056
Flesh out web service routes and healthcheck
bennostein Mar 5, 2025
e58d5ef
Use resource instance ID as kafka group ID
bennostein Feb 27, 2025
e5ce967
Copy hackernews react frontend over to chatroom example
bennostein Mar 5, 2025
6966fa3
Pull kafka adapter source into chatroom example for iteration without…
bennostein Mar 5, 2025
b0aeee3
Populate kafka with initial messages/likes; add barebones chatroom fr…
bennostein Mar 5, 2025
c7c0f51
Progress on chatroom front end, message ordering, styling, etc.
bennostein Mar 5, 2025
ab75d9a
Properly handle limit-excluded messages in frontend
bennostein Mar 4, 2025
79ed535
Drop unnecessary wrapping div
bennostein Mar 4, 2025
b88f4e8
Add logic to display list of users who liked message; improve chatroo…
bennostein Mar 5, 2025
64f556d
Extract chatroom example initialization code from web service
bennostein Mar 5, 2025
0ecc532
Apply autoformatter to chatroom example code
bennostein Mar 5, 2025
7afc3ac
Update to latest package versions; use new healthcheck endpoint
bennostein Mar 5, 2025
a154f4e
Update skip-adapter/kafka version; pull in changes from example; drop…
bennostein Mar 7, 2025
96ad150
Update example to point at proper @skip-adapter/kafka package
bennostein Mar 7, 2025
c6f8ec1
Flesh out skip-adapter/kafka docs (and some analogous changes for pos…
bennostein Mar 7, 2025
0b0c945
Rename load_balancer images in examples to reverse_proxy
bennostein Mar 13, 2025
9614632
Minor fixes re PR comments: formatting, unnecessary cast/lint suppres…
bennostein Mar 13, 2025
f6801a5
Use callbacks.error to signal errors in async context in Kafka adapter
bennostein Mar 13, 2025
22df082
Add chatroom to CircleCI check-examples job
bennostein Mar 13, 2025
628b4bf
temporarily commit packed version of kafka NPM package for example CI…
bennostein Mar 13, 2025
85116f8
`@skip-adapter/kafka`: external service wrapper around Kafka data str…
bennostein Mar 13, 2025
6b37357
CodeQL: disable C/C++ and Java/Kotlin
mbouaziz Mar 13, 2025
f6cdc35
CodeQL: disable C/C++ and Java/Kotlin (#805)
mbouaziz Mar 13, 2025
8568af4
Add comment reminding to keep check_format.sh and .prettierignore in …
mbouaziz Mar 13, 2025
f085be1
Clearer c/c++ extension regex
mbouaziz Mar 13, 2025
d1873fc
Check Python formatting in pre-commit hook
mbouaziz Mar 13, 2025
81d5fd5
Check Python formatting in pre-commit hook (#804)
mbouaziz Mar 14, 2025
dc28e0e
Simplify iteration
mbouaziz Feb 28, 2025
c168528
Consider the prelude as a whole
mbouaziz Feb 28, 2025
b337e4e
Move filtering on dirs
mbouaziz Mar 3, 2025
4879293
Switch to an associative array
mbouaziz Feb 28, 2025
c0a2061
Generalize skip package tests
mbouaziz Feb 28, 2025
ec51ab6
Search for all Skargo.toml
mbouaziz Feb 28, 2025
cf3e63e
Simplify conditions by handling dependencies earlier
mbouaziz Feb 28, 2025
12cccaa
Remove $skjson
mbouaziz Feb 28, 2025
427d8db
Remove $skdb
mbouaziz Feb 28, 2025
76c0321
Exclude ts from SK_CHANGED
mbouaziz Feb 28, 2025
aaf7e2a
Remove $prelude
mbouaziz Feb 28, 2025
acbdcbc
Remove $skc
mbouaziz Mar 3, 2025
dee9edb
Also compute TS_CHANGED
mbouaziz Mar 3, 2025
1233c6f
Compute $check_ts at the same time
mbouaziz Mar 3, 2025
7ddbcf6
Remove $skipruntime
mbouaziz Mar 3, 2025
15a8f97
Remove $ts_prelude
mbouaziz Mar 3, 2025
ab35b7d
Remove $skdb_wasm
mbouaziz Mar 3, 2025
b7c421d
Skip changed implies TS changed
mbouaziz Mar 3, 2025
a7827a3
Use --jobs 8 to run skip tests
mbouaziz Mar 3, 2025
a49a9f7
Skstore tests are a normal case
mbouaziz Mar 3, 2025
48385e8
At least build skip packages that have no tests
mbouaziz Mar 3, 2025
056c8d9
CI improvements (#788)
mbouaziz Mar 14, 2025
9615f61
Drop unused re-imports of skjson primitives in core/index
bennostein Mar 14, 2025
42e2f6a
Rename sk_freeze to more accurately match behavior
bennostein Mar 14, 2025
27cbf7f
[skjson] Rename sk_freeze and remove unused export (#806)
bennostein Mar 14, 2025
1793486
CodeQL: switch to advanced setup
mbouaziz Mar 14, 2025
d7656df
Disable C/C++/Java/Kotlin analyses
mbouaziz Mar 14, 2025
eb8aae7
Keep weekly analysis only
mbouaziz Mar 14, 2025
7db5446
Ignore issues in sql/
mbouaziz Mar 14, 2025
f535e35
CodeQL: switch to advanced setup (#807)
mbouaziz Mar 14, 2025
fec3177
sktest is only a dev dependency of skc
mbouaziz Mar 10, 2025
125efe0
Remove dead SyntaxError.errorsToString
mbouaziz Mar 10, 2025
4766f9a
Pass cwd to AsmOutput Metadata
mbouaziz Mar 10, 2025
2418867
Output relative DIFile
mbouaziz Mar 12, 2025
6992bf1
Option to anonymize paths (DIFiles only)
mbouaziz Mar 12, 2025
11a8041
Anonymize paths (positions)
mbouaziz Mar 12, 2025
7a2f4bf
Skc: option to canonize paths in generated ll (#801)
mbouaziz Mar 14, 2025
41a7556
[skip] Add reactive sessions.
beauby Mar 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
174 changes: 174 additions & 0 deletions .circleci/base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
version: 2.1

commands:
setup:
description: "Setup skip toolchain"
steps:
- run:
name: Fetch submodules
command: |
git submodule update --init --recursive

jobs:
fast-checks:
docker:
- image: skiplabs/skip:latest
steps:
- checkout
- run:
name: Check code is formatted
command: |
make check-fmt
- run:
name: Check shell scripts
command: |
make check-sh

check-ts:
docker:
- image: skiplabs/skip:latest
steps:
- checkout
- setup
- run:
name: Typecheck and lint typescript sources
command: SKIPRUNTIME=$(pwd)/build/skipruntime npm install && npm run build && npm run lint

compiler:
docker:
- image: skiplabs/skiplang:latest
resource_class: xlarge
steps:
- checkout
- setup
- run:
name: Run compiler tests
no_output_timeout: 30m
command: |
mkdir -p ~/test-results
cd skiplang/compiler && make STAGE=1
PATH=$(realpath ./stage1/bin):$PATH skargo test --jobs 8 --junitxml ~/test-results/skc.xml
- store_test_results:
path: ~/test-results/skc.xml

skdb:
docker:
- image: skiplabs/skdb-base:latest
steps:
- checkout
- setup
- run:
name: Run native skdb tests
command: |
make test-native

skdb-wasm:
docker:
- image: skiplabs/skdb-base:latest
steps:
- checkout
- setup
- run:
name: Run wasm skdb tests
no_output_timeout: 15m
command: |
mkdir -p ~/test-results
make test-wasm
- store_test_results:
path: ~/test-results/skdb-wasm.xml

skip-package-build:
docker:
- image: skiplabs/skiplang:latest
parameters:
dir:
type: string
steps:
- checkout
- setup
- run:
name: Build << parameters.dir >>
command: |
cd << parameters.dir >> && skargo build --all-targets

skip-package-tests:
docker:
- image: skiplabs/skiplang:latest
parameters:
dir:
type: string
steps:
- checkout
- setup
- run:
name: Run << parameters.dir >> tests
command: |
mkdir -p ~/test-results
cd << parameters.dir >> && skargo test --jobs 8 --junitxml ~/test-results/$(tr / - <<< "<< parameters.dir >>").xml
- store_test_results:
path: ~/test-results

skipruntime:
docker:
- image: skiplabs/skip:latest
- image: cimg/postgres:17.0
environment:
PGHOST: localhost
PGDATABASE: postgres
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: secret
- image: bitnami/kafka
command: sh -c "((sleep 15 && /opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --create --topic skip-test-topic)&) && /opt/bitnami/scripts/kafka/run.sh"
environment:
KAFKA_CFG_PROCESS_ROLES: controller,broker
KAFKA_CFG_NODE_ID: 0
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT"
KAFKA_CFG_LISTENERS: "PLAINTEXT://:9092,CONTROLLER://:9093"
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "0@localhost:9093"
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
steps:
- checkout
- setup
- run:
name: Run wasm skip runtime tests
no_output_timeout: 10m
command: |
mkdir -p ~/test-results
make test-skipruntime-ts
- store_test_results:
path: ~/test-results/skipruntime.xml

check-examples:
docker:
- image: cimg/base:2025.01
steps:
- checkout
- setup
- setup_remote_docker
- run:
name: Build hackernews docker images
working_directory: ~/project/examples/hackernews
command: docker compose build
- run:
name: Start hackernews services
working_directory: ~/project/examples/hackernews
command: docker compose up --wait
- run:
name: Test hackernews back end health
command: (docker run --network hackernews_default -it cimg/base:2025.01 curl --silent --max-time 0.1 --insecure --location https://haproxy/api/posts || true) | grep --quiet "data:"
- run:
name: Tear down hackernews example
working_directory: ~/project/examples/hackernews
command: docker compose down
- run:
name: Build chatroom docker images
working_directory: ~/project/examples/chatroom
command: docker compose build
- run:
name: Start chatroom services
working_directory: ~/project/examples/chatroom
command: docker compose up --wait
- run:
name: Test chatroom back end health
command: (docker run --network chatroom_default -it cimg/base:2025.01 curl --silent --max-time 0.1 --insecure --location https://haproxy/api/messages || true) | grep --quiet "data:"
23 changes: 23 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2.1

setup: true

orbs:
continuation: circleci/[email protected]

jobs:
setup:
executor: continuation/default
steps:
- checkout
- run:
name: Generate config
command: |
.circleci/generate_config.sh > generated_config.yml
- continuation/continue:
configuration_path: generated_config.yml

workflows:
setup:
jobs:
- setup
139 changes: 139 additions & 0 deletions .circleci/generate_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#!/bin/bash

# TODO: This is flaky as it relies on coarse directory-level diffs.

BASE="$(git merge-base main HEAD)"

git diff --quiet HEAD "$BASE" -- examples/
examples=$?

shopt -s globstar
declare -A SK_CHANGED
for skargo_toml in **/Skargo.toml; do
dir=$(dirname "$skargo_toml")
git diff --quiet HEAD "$BASE" -- "$dir" :^"$dir/ts" \
&& SK_CHANGED["$dir"]=false || SK_CHANGED["$dir"]=true
done

if ${SK_CHANGED[skiplang/prelude]}; then
SK_CHANGED[skiplang/compiler]=true
SK_CHANGED[sql]=true
fi
if ${SK_CHANGED[skiplang/sqlparser]}; then
SK_CHANGED[sql]=true
fi

check_ts=false
declare -A TS_CHANGED
# shellcheck disable=SC2046 # We actually want splitting in jq command output
for dir in $(jq --raw-output ".workspaces[]" package.json); do
git diff --quiet HEAD "$BASE" -- "$dir" \
&& TS_CHANGED["$dir"]=false || TS_CHANGED["$dir"]=true
${TS_CHANGED["$dir"]} && check_ts=true
done

for dir in "${!SK_CHANGED[@]}"; do
${SK_CHANGED["$dir"]} && TS_CHANGED["$dir"]=true
done

for dir in "${!TS_CHANGED[@]}"; do
changed=${TS_CHANGED["$dir"]}
while [ "$dir" != "." ] && [ "$dir" != "/" ]; do
if ${TS_CHANGED["$dir"]:-false} && ! $changed; then break; fi
TS_CHANGED["$dir"]=$changed
dir=$(dirname "$dir")
done
done

if ${TS_CHANGED[skiplang/skjson]}; then
TS_CHANGED[sql]=true
TS_CHANGED[skipruntime-ts]=true
fi
if ${TS_CHANGED[skiplang/prelude]}; then
TS_CHANGED[sql]=true
TS_CHANGED[skipruntime-ts]=true
fi

cat .circleci/base.yml

echo "workflows:"

cat <<EOF
fast-checks:
jobs:
- fast-checks
EOF

if $check_ts
then
cat <<EOF
check-ts:
jobs:
- check-ts
EOF
fi

for dir in "${!SK_CHANGED[@]}"; do
if ${SK_CHANGED["$dir"]}; then
case "$dir" in
skipruntime-ts/* )
TS_CHANGED[skipruntime-ts]=true
;;
sql)
cat <<EOF
skdb:
jobs:
- skdb
EOF
;;
skiplang/compiler)
cat <<EOF
compiler:
jobs:
- compiler
EOF
;;
skiplang/sqlparser) ;;
*)
name=$(basename "$dir")
if [ -d "$dir/tests" ]; then
echo " $name-tests:"
echo " jobs:"
echo " - skip-package-tests:"
else
echo " $name-build:"
echo " jobs:"
echo " - skip-package-build:"
fi
echo " dir: $dir"
echo " name: $name"
esac
fi
done

if ${TS_CHANGED[sql]}
then
cat <<EOF
skdb-wasm:
jobs:
- skdb-wasm
EOF
fi

if ${TS_CHANGED[skipruntime-ts]}
then
cat <<EOF
skipruntime:
jobs:
- skipruntime
EOF
fi

if (( examples != 0 ))
then
cat <<EOF
examples:
jobs:
- check-examples
EOF
fi
Loading