Skip to content

Commit 07899d0

Browse files
committed
[bfops/import-csharp]: Merge remote-tracking branch 'origin/master' into bfops/import-csharp
2 parents 2c7b668 + 4115658 commit 07899d0

File tree

338 files changed

+53089
-17
lines changed

Some content is hidden

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

338 files changed

+53089
-17
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Docs - Check Link Validity
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
merge_group:
9+
10+
jobs:
11+
check-links:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '16' # or the version of Node.js you're using
21+
22+
- name: Install dependencies
23+
working-directory: docs
24+
run: |
25+
npm install
26+
27+
- name: Run link check
28+
working-directory: docs
29+
run: |
30+
npm run check-links
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Docs - Validate nav.ts Matches nav.js
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
merge_group:
9+
10+
jobs:
11+
validate-build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '16'
22+
23+
- name: Install dependencies
24+
working-directory: docs
25+
run: |
26+
npm install
27+
28+
- name: Backup existing nav.js
29+
working-directory: docs
30+
run: |
31+
mv docs/nav.js docs/nav.js.original
32+
33+
- name: Build nav.ts
34+
working-directory: docs
35+
run: |
36+
npm run build
37+
38+
- name: Compare generated nav.js with original nav.js
39+
working-directory: docs
40+
run: |
41+
diff -q docs/nav.js docs/nav.js.original || (echo "Generated nav.js differs from committed version. Run 'npm run build' and commit the updated file." && exit 1)
42+
43+
- name: Restore original nav.js
44+
working-directory: docs
45+
if: success() || failure()
46+
run: |
47+
mv docs/nav.js.original docs/nav.js

.github/workflows/pr-only-ci.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,12 @@ jobs:
3131
with:
3232
ref: ${{ env.GIT_REF }}
3333
- uses: dsherret/rust-toolchain-file@v1
34-
- name: Checkout docs
35-
uses: actions/checkout@v4
36-
with:
37-
repository: clockworklabs/spacetime-docs
38-
ref: master
39-
path: spacetime-docs
4034
- name: Check for docs change
4135
run: |
42-
cargo run --features markdown-docs -p spacetimedb-cli > spacetime-docs/docs/cli-reference.md
43-
cd spacetime-docs
36+
cargo run --features markdown-docs -p spacetimedb-cli > docs/docs/cli-reference.md
37+
cd docs
4438
# This is needed because our website doesn't render markdown quite properly.
45-
# See the README in spacetime-docs for more details.
39+
# See the README in docs for more details.
4640
sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md
4741
sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 <b>\2</b>!' docs/cli-reference.md
4842
git status

crates/commitlog/src/lib.rs

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ pub mod stream;
3232
pub mod tests;
3333

3434
/// [`Commitlog`] options.
35-
#[derive(Clone, Copy, Debug)]
35+
#[derive(Clone, Copy, Debug, PartialEq)]
36+
#[cfg_attr(
37+
feature = "serde",
38+
derive(serde::Serialize, serde::Deserialize),
39+
serde(rename_all = "kebab-case")
40+
)]
3641
pub struct Options {
3742
/// Set the log format version to write, and the maximum supported version.
3843
///
@@ -42,23 +47,27 @@ pub struct Options {
4247
/// with new or very old versions.
4348
///
4449
/// Default: [`DEFAULT_LOG_FORMAT_VERSION`]
50+
#[cfg_attr(feature = "serde", serde(default = "Options::default_log_format_version"))]
4551
pub log_format_version: u8,
4652
/// The maximum size in bytes to which log segments should be allowed to
4753
/// grow.
4854
///
4955
/// Default: 1GiB
56+
#[cfg_attr(feature = "serde", serde(default = "Options::default_max_segment_size"))]
5057
pub max_segment_size: u64,
5158
/// The maximum number of records in a commit.
5259
///
5360
/// If this number is exceeded, the commit is flushed to disk even without
5461
/// explicitly calling [`Commitlog::flush`].
5562
///
5663
/// Default: 65,535
64+
#[cfg_attr(feature = "serde", serde(default = "Options::default_max_records_in_commit"))]
5765
pub max_records_in_commit: NonZeroU16,
5866
/// Whenever at least this many bytes have been written to the currently
5967
/// active segment, an entry is added to its offset index.
6068
///
6169
/// Default: 4096
70+
#[cfg_attr(feature = "serde", serde(default = "Options::default_offset_index_interval_bytes"))]
6271
pub offset_index_interval_bytes: NonZeroU64,
6372
/// If `true`, require that the segment must be synced to disk before an
6473
/// index entry is added.
@@ -74,22 +83,53 @@ pub struct Options {
7483
/// strictly every `offset_index_interval_bytes`.
7584
///
7685
/// Default: false
86+
#[cfg_attr(
87+
feature = "serde",
88+
serde(default = "Options::default_offset_index_require_segment_fsync")
89+
)]
7790
pub offset_index_require_segment_fsync: bool,
7891
}
7992

8093
impl Default for Options {
8194
fn default() -> Self {
82-
Self {
83-
log_format_version: DEFAULT_LOG_FORMAT_VERSION,
84-
max_segment_size: 1024 * 1024 * 1024,
85-
max_records_in_commit: NonZeroU16::MAX,
86-
offset_index_interval_bytes: NonZeroU64::new(4096).unwrap(),
87-
offset_index_require_segment_fsync: false,
88-
}
95+
Self::DEFAULT
8996
}
9097
}
9198

9299
impl Options {
100+
pub const DEFAULT_MAX_SEGMENT_SIZE: u64 = 1024 * 1024 * 1024;
101+
pub const DEFAULT_MAX_RECORDS_IN_COMMIT: NonZeroU16 = NonZeroU16::MAX;
102+
pub const DEFAULT_OFFSET_INDEX_INTERVAL_BYTES: NonZeroU64 = NonZeroU64::new(4096).expect("4096 > 0, qed");
103+
pub const DEFAULT_OFFSET_INDEX_REQUIRE_SEGMENT_FSYNC: bool = false;
104+
105+
pub const DEFAULT: Self = Self {
106+
log_format_version: DEFAULT_LOG_FORMAT_VERSION,
107+
max_segment_size: Self::default_max_segment_size(),
108+
max_records_in_commit: Self::default_max_records_in_commit(),
109+
offset_index_interval_bytes: Self::default_offset_index_interval_bytes(),
110+
offset_index_require_segment_fsync: Self::default_offset_index_require_segment_fsync(),
111+
};
112+
113+
pub const fn default_log_format_version() -> u8 {
114+
DEFAULT_LOG_FORMAT_VERSION
115+
}
116+
117+
pub const fn default_max_segment_size() -> u64 {
118+
Self::DEFAULT_MAX_SEGMENT_SIZE
119+
}
120+
121+
pub const fn default_max_records_in_commit() -> NonZeroU16 {
122+
Self::DEFAULT_MAX_RECORDS_IN_COMMIT
123+
}
124+
125+
pub const fn default_offset_index_interval_bytes() -> NonZeroU64 {
126+
Self::DEFAULT_OFFSET_INDEX_INTERVAL_BYTES
127+
}
128+
129+
pub const fn default_offset_index_require_segment_fsync() -> bool {
130+
Self::DEFAULT_OFFSET_INDEX_REQUIRE_SEGMENT_FSYNC
131+
}
132+
93133
/// Compute the length in bytes of an offset index based on the settings in
94134
/// `self`.
95135
pub fn offset_index_len(&self) -> u64 {

demo/Blackholio/.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.idea/
2+
.vsconfig
3+
.vs/
4+
5+
### macOS ###
6+
# General
7+
.DS_Store
8+
.AppleDouble
9+
.LSOverride
10+
11+
# Icon must end with two \r
12+
Icon
13+
14+
15+
# Thumbnails
16+
._*
17+
18+
# Files that might appear in the root of a volume
19+
.DocumentRevisions-V100
20+
.fseventsd
21+
.Spotlight-V100
22+
.TemporaryItems
23+
.Trashes
24+
.VolumeIcon.icns
25+
.com.apple.timemachine.donotpresent
26+
27+
# Directories potentially created on remote AFP share
28+
.AppleDB
29+
.AppleDesktop
30+
Network Trash Folder
31+
Temporary Items
32+
.apdisk
33+
34+
### macOS Patch ###
35+
# iCloud generated files
36+
*.icloud
37+
38+
# End of https://www.toptal.com/developers/gitignore/api/macos

0 commit comments

Comments
 (0)