Skip to content
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

RDART-771 EJSON support #1295

Merged
merged 154 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
3ba78cb
Worthy of first commit
nielsenko May 26, 2023
0273fa0
Add actual generator
nielsenko May 27, 2023
16f5675
Tweak pubspec.yaml for bette PANA score
nielsenko May 28, 2023
a3bc311
move ejson project into ejson folder
nielsenko May 30, 2023
61cd59c
Merge branch 'ejson' into kn/ejson
nielsenko May 30, 2023
3dbc762
Rudimentary generator inplace
nielsenko May 31, 2023
804f669
Custom decoding tests
nielsenko May 31, 2023
8143bf5
Fix realm generator tests
nielsenko May 31, 2023
92a0570
Update pubspec repo ref
nielsenko May 31, 2023
7baa523
wip
nielsenko May 31, 2023
161273b
Add copyright headers
nielsenko May 31, 2023
0a1a7be
Fix multi parameter ctor bug. More tests
nielsenko May 31, 2023
73fa459
Add bad input test, and cheat a bit for dynamic tests
nielsenko Jun 1, 2023
ccf303a
A few compile tests in place
nielsenko Jun 2, 2023
15d5d02
Split in multiple project and move to melos
nielsenko Jun 2, 2023
c7cfc49
Basic source error reporting
nielsenko Jun 2, 2023
d60e9d5
add qa script to melos.yaml (combines format:check, analyze, and test)
nielsenko Jun 2, 2023
ca36932
testCompile supports skip
nielsenko Jun 2, 2023
453ab4e
Enable melos qa on github actions
nielsenko Jun 2, 2023
c686b9d
Use utc in test
nielsenko Jun 2, 2023
b984838
Add LICENSE file + repo link in pubspecs
nielsenko Jun 2, 2023
e927940
More melos magic
nielsenko Jun 2, 2023
b07b7ea
Make ejson package public
nielsenko Jun 2, 2023
3b7c93f
Add internal dep
nielsenko Jun 2, 2023
4b947fc
Use >- over | to work around windows line ending issue
nielsenko Jun 3, 2023
a1eacad
Force \n in DartFormatter due to windows line ending issue
nielsenko Jun 3, 2023
4ccd674
Drop qa:static scripts (qa:full calls qa)
nielsenko Jun 3, 2023
94b7a63
Fix bug in testCompile
nielsenko Jun 3, 2023
02d59b7
format and check coverage
nielsenko Jun 3, 2023
8995ebb
Use ejson in realm
nielsenko Jun 5, 2023
eb8f49e
Lint rules (WIP)
nielsenko Jun 12, 2023
32e5068
Report lints as errors instead of infos
nielsenko Jun 14, 2023
f27e365
Use links for LICENSE file
nielsenko Jun 14, 2023
287afb8
Link READMEs
nielsenko Jun 14, 2023
633b65b
Expand melos:qa to include test:lints and analyze:deps
nielsenko Jun 14, 2023
5b59f5f
Fix tests after rebase
nielsenko Aug 1, 2023
979bbc7
Support ObjectId and Uuid out-of-the-box
nielsenko Sep 11, 2023
4ff8544
Update analyzer dependency for ejson
nielsenko Jan 3, 2024
548cfb6
Update lint related deps
nielsenko Jan 3, 2024
92fdd71
Fix lints and tests
nielsenko Jan 3, 2024
8a8be68
Run builder runner
nielsenko Jan 3, 2024
2ecd55e
Fix realm generator tests
nielsenko Jan 4, 2024
5283e39
Flatten package structure
nielsenko Feb 19, 2024
9819632
Avoid path deps in public packages and remove publish_to:
nielsenko Feb 1, 2024
55d5410
Add melos support
nielsenko Jan 31, 2024
39711b2
Add lints package on bootstrap
nielsenko Feb 5, 2024
e59883d
Simplify CI a bit with melos
nielsenko Feb 6, 2024
663cfd6
Update root .gitignore
nielsenko Feb 7, 2024
2bb3b7f
build_native.dart (wip)
nielsenko Feb 7, 2024
60e0d27
Split bootstrap pre-hook into separate setup script (for speed when s…
nielsenko Feb 7, 2024
b440f76
Align SDK requirement (handled by melos bootstrap)
nielsenko Feb 19, 2024
de5a823
melos bootstrap needed
nielsenko Feb 19, 2024
fb1fb65
fixup: bad rebase
nielsenko Feb 19, 2024
5c6acf0
Reorder steps
nielsenko Feb 19, 2024
7cba56e
missing deps in example
nielsenko Feb 19, 2024
b4f4be1
Cleanup .gitignore hierarchy
nielsenko Feb 19, 2024
8d3425e
Align analysis_options.yaml files with symlinks
nielsenko Feb 19, 2024
3cefd07
realm/example is a flutter project
nielsenko Feb 19, 2024
d51c66f
Remove last remnants of toplevel ejson folder
nielsenko Feb 20, 2024
488740c
Tweak melos.yaml
nielsenko Feb 20, 2024
4dd38cb
TMP: workaround
nielsenko Feb 20, 2024
a916a1e
Coverage (wip)
nielsenko Feb 20, 2024
ea14469
Use combine_coverage package instead of lcov
nielsenko Feb 20, 2024
103f86c
Only report on lib folder
nielsenko Feb 20, 2024
c445f02
Prune coverage a bit
nielsenko Feb 20, 2024
ef857a3
Don't run tests twice
nielsenko Feb 20, 2024
e8da64b
Skip redundant step
nielsenko Feb 20, 2024
0a3871b
Update checkout action to v4
nielsenko Feb 20, 2024
8085349
Update upload-artifact action to v4
nielsenko Feb 20, 2024
4cc49bf
Update download-artifact action to v4
nielsenko Feb 20, 2024
d566694
Update dorny/test-reporter action to v1.8.0
nielsenko Feb 21, 2024
220c426
Skip redundant step
nielsenko Feb 21, 2024
b02e872
Update actions/setup-java action to v4
nielsenko Feb 21, 2024
0e20453
Update gradle/gradle-build-action action to v3
nielsenko Feb 21, 2024
6b28047
Don't use random github action to install ninja-build. It is not main…
nielsenko Feb 21, 2024
a7645d7
Update futureware-tech/simulator-action action to v3
nielsenko Feb 21, 2024
ac51e94
Update geekyeggo/delete-artifact action to v4
nielsenko Feb 21, 2024
aab77f2
Fix symlink blunder
nielsenko Feb 21, 2024
475e220
Tighten analysis rules
nielsenko Feb 21, 2024
7495215
add upgrade script to melos.yaml
nielsenko Feb 21, 2024
a577df2
bump custom_lint_builder
nielsenko Feb 21, 2024
89bfa58
tweak publish-release.yml
nielsenko Feb 21, 2024
cedaa52
Update format and lint:format to not touch generated files (workaroun…
nielsenko Feb 22, 2024
b6bdf0b
Implicit casts made explicit, as mandated by stricter analysis_option…
nielsenko Feb 22, 2024
cb8b38e
melos run format
nielsenko Feb 22, 2024
3296990
tweak melos.yaml
nielsenko Feb 22, 2024
43f9a1d
Fix lints and increase coverage
nielsenko Feb 22, 2024
2a7a900
switch to melos coverage:groom
nielsenko Feb 22, 2024
c4adf67
strong-mode has been superceeded by strict
nielsenko Feb 22, 2024
428bcb0
enable custom_lint tools
nielsenko Feb 22, 2024
e8ff3d8
Add example to package ejson
nielsenko Feb 26, 2024
c720016
Fix missing quotes on int and double values in canonical mode
nielsenko Feb 26, 2024
705f497
Relax Array type from LIst to Iterable
nielsenko Feb 26, 2024
2a8f767
Update a ejson_lint/example README.md
nielsenko Feb 26, 2024
902a348
Fix missing quotes on DateTime in canonical mode
nielsenko Feb 26, 2024
8f7168f
Fix ejson_generator tests
nielsenko Feb 26, 2024
dfaa4e0
Only install ninja on linux builds
nielsenko Feb 26, 2024
b1b7394
Tweak a test
nielsenko Feb 26, 2024
0ee6bba
Force a new native build..
nielsenko Feb 26, 2024
771f993
Tweak condition for Ninja (android- & linux-)
nielsenko Feb 26, 2024
b5eb5b5
Fix linux.. and simplify
nielsenko Feb 26, 2024
b67d3e9
Upgrade realm-core to v14.0.1
nielsenko Feb 26, 2024
48d27bb
testing hypothesis
nielsenko Feb 27, 2024
ab1893c
Rework install command
nielsenko Feb 27, 2024
bb5a761
Drop ejson_serialization_setup.g.dart (for now)
nielsenko Feb 27, 2024
b861fcb
Support Uint8List
nielsenko Feb 27, 2024
3468c5b
Get rid of to<T> extension (use fromJson<T> instead)
nielsenko Feb 27, 2024
d054b65
Update ejson codecs
nielsenko Feb 27, 2024
56d4716
Fix "generator" tests
nielsenko Feb 27, 2024
20031e3
Fix realm_value_test.dart
nielsenko Feb 27, 2024
83bf607
Convert coverage, despite test failure
nielsenko Feb 27, 2024
bf54b95
More encoding tests
nielsenko Feb 27, 2024
f4cf7c8
Fix blunder regarding canonical vs. relaxed
nielsenko Feb 27, 2024
78c34d6
Don't forget windows *sigh*
nielsenko Feb 27, 2024
d67ff97
Split test and coverage handling
nielsenko Feb 27, 2024
8fa295a
Small formatting error
nielsenko Feb 27, 2024
dbe0fcd
Use super.<x> syntax
nielsenko Feb 27, 2024
562a338
Drop some imports
nielsenko Feb 27, 2024
1369c6c
Don't use _ prefix on already local stuff
nielsenko Feb 27, 2024
cebfd50
DateTime codec use local time in relaxed mode, but millisecondSinceEp…
nielsenko Feb 28, 2024
929fca3
export ejson.dart from realm.dart to avoid extra import in user code
nielsenko Feb 28, 2024
df0033e
export ejson_annotation.dart from ejson.dart to avoid extra import in…
nielsenko Feb 28, 2024
3bef5c8
Update copyright
nielsenko Feb 28, 2024
f44360e
Remove redundant "library;"
nielsenko Feb 28, 2024
fbdb4de
Remove the now unnecesary imports
nielsenko Feb 28, 2024
d075bac
Remove deprecated exports
nielsenko Feb 28, 2024
07aeec4
Add unsynced to CSpell
nielsenko Feb 28, 2024
b9b2217
Don't use ejson_generator for realm objects, but have realm_generator…
nielsenko Feb 29, 2024
28566ab
Update .expected files
nielsenko Feb 29, 2024
e5a4d26
Drop dep on ejson_annotation and ejson_generator
nielsenko Feb 29, 2024
a152496
Rerun generator (.g.dart files no longer generated)
nielsenko Feb 29, 2024
f9c0945
format
nielsenko Feb 29, 2024
a115515
Absolute symlinks should be relative
nielsenko Mar 1, 2024
7286f95
Upgrade simulator to iPhone SE (3rd generation)
nielsenko Mar 1, 2024
58d8027
Update example with to/From-EJson
nielsenko Mar 1, 2024
393046e
Update CHANGELOG
nielsenko Mar 1, 2024
59d2801
Dart doc updates
nielsenko Mar 1, 2024
be09a79
Missing headers
nielsenko Mar 1, 2024
684d288
Missing headers .. unrelated to ejson
nielsenko Mar 1, 2024
c0341b5
Implement PR feedback (part 1)
nielsenko Mar 5, 2024
1370a12
Refactor int.toEJson to take an optional forcedFormat argument, and o…
nielsenko Mar 5, 2024
7cbf211
Add toEJsonString and fromEJsonString<T> convinience functions
nielsenko Mar 5, 2024
deccc53
Missing tests for Uint8List aka binary with subtype '00'
nielsenko Mar 5, 2024
edf4caa
Fix Uint8List decoding bug
nielsenko Mar 5, 2024
26c1947
Generate registerX function
nielsenko Mar 5, 2024
b7f5982
Refactor realm_generator EJSON support a bit
nielsenko Mar 5, 2024
04155e1
fix realm example
nielsenko Mar 5, 2024
46340f2
Update CONTRIBUTING.md
nielsenko Mar 5, 2024
5126b35
No need to build realm_dart for maccatalyst by default, as flutter do…
nielsenko Mar 6, 2024
85a21ef
More work on build.dart
nielsenko Mar 6, 2024
87ddff7
Update build:native script to use tool/build.dart
nielsenko Mar 6, 2024
7db14a0
A bit of gold plating..
nielsenko Mar 6, 2024
3d72e93
.. and some bugfixes
nielsenko Mar 6, 2024
904ef5b
Important to drain both stdout and stderr
nielsenko Mar 6, 2024
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
15 changes: 8 additions & 7 deletions .github/workflows/binary-combine-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,39 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch x86 build
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
uses: actions/download-artifact@v4
with:
name: librealm-android-x86
path: packages/realm_dart/binary/android
- name: Fetch x86_64 build
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
uses: actions/download-artifact@v4
with:
name: librealm-android-x86_64
path: packages/realm_dart/binary/android
- name: Fetch armeabi-v7a build
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
uses: actions/download-artifact@v4
with:
name: librealm-android-armeabi-v7a
path: packages/realm_dart/binary/android
- name: Fetch arm64-v8a build
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
uses: actions/download-artifact@v4
with:
name: librealm-android-arm64-v8a
path: packages/realm_dart/binary/android

- name: Store combined artifact
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
uses: actions/upload-artifact@v4
with:
name: librealm-android
path: packages/realm_dart/binary/android
retention-days: 1

- name: Delete individual build artifacts
uses: geekyeggo/delete-artifact@54ab544f12cdb7b71613a16a2b5a37a9ade990af
uses: geekyeggo/delete-artifact@v4
with:
name: |
librealm-android-x86
librealm-android-x86_64
librealm-android-armeabi-v7a
librealm-android-arm64-v8a
librealm-android-arm64-v8a
failOnError: false
11 changes: 6 additions & 5 deletions .github/workflows/binary-combine-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:

steps:
- name: Fetch device build
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
uses: actions/download-artifact@v4
with:
name: librealm-ios-device
path: binary/ios
- name: Fetch simulator build
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
uses: actions/download-artifact@v4
with:
name: librealm-ios-simulator
path: binary/ios
- name: Fetch catalyst build
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
uses: actions/download-artifact@v4
with:
name: librealm-ios-catalyst
path: binary/ios
Expand All @@ -36,16 +36,17 @@ jobs:
rm -rf ./binary/ios/Release-*

- name: Store .xcframework artifact
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
uses: actions/upload-artifact@v4
with:
name: librealm-ios
path: binary/ios
retention-days: 1

- name: Delete individual framework artifacts
uses: geekyeggo/delete-artifact@54ab544f12cdb7b71613a16a2b5a37a9ade990af
uses: geekyeggo/delete-artifact@v4
with:
name: |
librealm-ios-device
librealm-ios-simulator
librealm-ios-catalyst
failOnError: false
15 changes: 8 additions & 7 deletions .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
build: ${{ fromJSON(inputs.build) }}
steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
uses: actions/checkout@v4
with:
submodules: 'recursive'

Expand All @@ -41,17 +41,18 @@ jobs:
path: ./packages/realm_dart/binary/**
key: binaries-${{ matrix.build }}-${{ inputs.runner }}-${{hashFiles('./packages/realm_dart/src/**')}}


- name: Setup Ninja
if: steps.check-cache.outputs.cache-hit != 'true'
nielsenko marked this conversation as resolved.
Show resolved Hide resolved
uses: seanmiddleditch/gha-setup-ninja@1815f2d05c2cd60c2d900f89843139b8dde09f4c
if: steps.check-cache.outputs.cache-hit != 'true' && (startsWith(matrix.build, 'android') || startsWith(matrix.build, 'linux'))
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build

- name: Setup Android NDK
if: startsWith(matrix.build, 'android-')
if: startsWith(matrix.build, 'android')
run: echo "ANDROID_NDK=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV

- name: Downgrade XCode for MacOS
if: ${{ matrix.build == 'macos' }}
if: matrix.build == 'macos'
run: sudo xcode-select -s /Applications/Xcode_14.0.1.app

- name: Build
Expand All @@ -61,7 +62,7 @@ jobs:
cmake --build --preset ${{ matrix.build }} --config Release ${{ startsWith(matrix.build, 'android-') && '--target strip' || '' }}

- name: Store artifacts
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
uses: actions/upload-artifact@v4
with:
name: librealm-${{ matrix.build }}
path: packages/realm_dart/binary/${{ inputs.binary }}/**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8230315d06ad95c617244d2f265d237a1682d445
uses: actions/checkout@v4
with:
submodules: false
- name: Enforce Changelog
Expand Down
77 changes: 30 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Enable ccache
run: echo "PATH=/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" >> $GITHUB_ENV

- name: Fetch artifacts
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
uses: actions/download-artifact@v4
with:
name: librealm-ios
path: packages/realm_dart/binary/ios
Expand All @@ -312,13 +312,18 @@ jobs:
with:
channel: 'stable'

- name: Setup Melos
run: |
dart pub global activate melos
dart pub global run melos bootstrap

- name: Install dependencies
run: dart pub get

- name: Launch Simulator
uses: futureware-tech/simulator-action@v2
uses: futureware-tech/simulator-action@v3
with:
model: 'iPhone 8'
model: 'iPhone SE (3rd generation)'
os: 'iOS'
os_version: '>= 14.0'

Expand All @@ -331,7 +336,7 @@ jobs:
--suppress-analytics

- name: Publish Test Report
uses: dorny/test-reporter@v1.7.0
uses: dorny/test-reporter@v1.8.0
if: success() || failure()
with:
name: Test Results Flutter iOS
Expand Down Expand Up @@ -373,7 +378,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
uses: actions/checkout@v4
with:
submodules: 'recursive'

Expand All @@ -384,16 +389,16 @@ jobs:
sudo udevadm trigger --name-match=kvm

- name: Gradle cache
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3

- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11

- name: Fetch artifacts
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
uses: actions/download-artifact@v4
with:
name: librealm-android
path: packages/realm_dart/binary/android
Expand All @@ -403,6 +408,11 @@ jobs:
with:
channel: 'stable'

- name: Setup Melos
run: |
dart pub global activate melos
dart pub global run melos bootstrap

- name: Install dependencies
run: dart pub get

Expand Down Expand Up @@ -447,7 +457,7 @@ jobs:
script: cd packages/realm/tests && flutter test integration_test/all_tests.dart --dart-define=BAAS_BAASAAS_API_KEY=$BAAS_BAASAAS_API_KEY --dart-define=BAAS_DIFFERENTIATOR=$BAAS_DIFFERENTIATOR --file-reporter=json:test-results.json --suppress-analytics

- name: Publish Test Report
uses: dorny/test-reporter@v1.7.0
uses: dorny/test-reporter@v1.8.0
if: success() || failure()
with:
name: Test Results Flutter Android
Expand Down Expand Up @@ -481,10 +491,11 @@ jobs:

runs-on: ${{ matrix.os }}-latest
name: Generator Tests

timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
uses: actions/checkout@v4
with:
submodules: 'recursive'

Expand All @@ -493,8 +504,15 @@ jobs:
with:
channel: 'stable'

- name: Setup Melos
run: |
dart pub global activate melos
dart pub global run melos bootstrap

- name: Delete generated files in realm_dart
run: find . -name "*.realm.dart" -delete
run: |
find . -name "*.g.dart" -delete
find . -name "*.realm.dart" -delete
working-directory: packages/realm_dart

- name: Run generator in realm_dart
Expand Down Expand Up @@ -533,53 +551,18 @@ jobs:
exit 1
fi

- name: Run generator tests
run: |
dart pub get
dart test -r expanded --coverage ./coverage/ --test-randomize-ordering-seed random

- name: Generate generator coverage report
if: matrix.os == 'ubuntu'
run: |
dart run coverage:format_coverage \
--in coverage/ \
--out ./coverage/lcov.info \
--check-ignore \
--lcov \
--packages .dart_tool/package_config.json \
--report-on lib

- name: Publish Generator Coverage
if: matrix.os == 'ubuntu'
id: publish-coverage
uses: coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: generator
path-to-lcov: packages/realm_generator/coverage/lcov.info
parallel: true

- name: Output Coveralls response
if: matrix.os == 'ubuntu'
run: echo ${{ steps.publish-coverage.outputs.coveralls-api-result }}

coverage-finished:
needs:
- generator
- dart-tests-linux
runs-on: ubuntu-latest
steps:

- name: Coveralls Finished
id: publish-coverage
uses: coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

- name: Output Coveralls response
run: echo ${{ steps.publish-coverage.outputs.coveralls-api-result }}

slack-on-failure:
name: Report failure in main branch
needs:
Expand Down
Loading
Loading