Skip to content

Commit 2db1637

Browse files
authored
Merge pull request #3 from vic-ffm/FEATURE-full-neo4J-support
Full Neo4J Cypher type support. Compatibility with Neo4J 6.x Refactoring of Exports module
2 parents b73526f + 6296cf6 commit 2db1637

Some content is hidden

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

50 files changed

+3510
-1708
lines changed

.env.example

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,78 @@ NEO4J_EXPORT_MIN_MEMORY_RESERVATION=104857600
127127
# Initial buffer size for JSON serialization. Buffer grows as needed.
128128
# Default: 16KB. Increase for databases with large properties.
129129
JSON_BUFFER_SIZE_KB=16
130+
131+
# ===============================================
132+
# Path Serialization Safety Thresholds
133+
# ===============================================
134+
# These thresholds control automatic behavior for path serialization.
135+
# The tool always attempts maximum extraction and degrades automatically.
136+
137+
# Absolute maximum path length allowed
138+
# Paths longer than this will be truncated with an error
139+
# Default: 100000
140+
MAX_PATH_LENGTH=100000
141+
142+
# Threshold for switching from Full to Compact mode
143+
# When path has more nodes than this, properties are omitted
144+
# Default: 1000
145+
PATH_FULL_MODE_LIMIT=1000
146+
147+
# Threshold for switching from Compact to IdsOnly mode
148+
# When path has more nodes than this, only IDs are exported
149+
# Default: 10000
150+
PATH_COMPACT_MODE_LIMIT=10000
151+
152+
# Maximum depth for serializing properties in path elements
153+
# Default: 5
154+
PATH_PROPERTY_DEPTH=5
155+
156+
# ===============================================
157+
# Nested Graph Element Safety Thresholds
158+
# ===============================================
159+
# These thresholds control automatic behavior for nested elements.
160+
# The tool always serializes nested elements, never returns errors.
161+
162+
# Absolute maximum nesting depth allowed
163+
# Default: 10
164+
MAX_NESTED_DEPTH=10
165+
166+
# Depth at which to switch from Deep to Shallow mode
167+
# Shallow mode omits properties but includes labels/types
168+
# Default: 5
169+
NESTED_SHALLOW_MODE_DEPTH=5
170+
171+
# Depth at which to switch from Shallow to Reference mode
172+
# Reference mode only includes IDs and basic type info
173+
# Default: 8
174+
NESTED_REFERENCE_MODE_DEPTH=8
175+
176+
# ===============================================
177+
# Label Truncation Limits
178+
# ===============================================
179+
# These limits control how many labels are serialized for nodes
180+
# in different contexts to prevent excessive JSON size.
181+
182+
# Maximum number of labels per node in full serialization mode
183+
# When a node has more labels than this, they are truncated
184+
# Default: 100
185+
MAX_LABELS_PER_NODE=100
186+
187+
# Maximum number of labels in reference mode (minimal serialization)
188+
# Used when nodes appear as references in paths or nested structures
189+
# Default: 10
190+
MAX_LABELS_IN_REFERENCE_MODE=10
191+
192+
# Maximum number of labels in path compact mode
193+
# Used when serializing nodes within paths in compact mode
194+
# Default: 5
195+
MAX_LABELS_IN_PATH_COMPACT=5
196+
197+
# ===============================================
198+
# Collection Limits
199+
# ===============================================
200+
201+
# Maximum number of items to include in collections (lists, maps)
202+
# Collections larger than this are truncated with a warning
203+
# Default: 10000
204+
MAX_COLLECTION_ITEMS=10000
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
name: Build and Release Binaries
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
env:
9+
DOTNET_VERSION: '9.0.x'
10+
DOTNET_NOLOGO: true
11+
DOTNET_CLI_TELEMETRY_OPTOUT: true
12+
13+
jobs:
14+
build:
15+
name: Build binaries for all platforms
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
packages: write
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: ${{ env.DOTNET_VERSION }}
29+
30+
- name: Get version from Directory.Build.props
31+
id: version
32+
run: |
33+
VERSION=$(grep -oP '(?<=<Version>)[^<]+' Directory.Build.props)
34+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
35+
echo "Building version: ${VERSION}"
36+
37+
- name: Restore dependencies
38+
run: dotnet restore Neo4jExport/Neo4jExport.fsproj
39+
40+
- name: Build macOS Apple Silicon (osx-arm64)
41+
run: |
42+
dotnet publish Neo4jExport/Neo4jExport.fsproj \
43+
-c Release \
44+
-r osx-arm64 \
45+
--self-contained true \
46+
-p:PublishSingleFile=true \
47+
-p:IncludeNativeLibrariesForSelfExtract=true \
48+
-p:PublishReadyToRun=false \
49+
-p:EnableCompressionInSingleFile=true \
50+
-p:DebugType=embedded \
51+
-o ./publish/macos-apple-silicon
52+
53+
- name: Build macOS Intel (osx-x64)
54+
run: |
55+
dotnet publish Neo4jExport/Neo4jExport.fsproj \
56+
-c Release \
57+
-r osx-x64 \
58+
--self-contained true \
59+
-p:PublishSingleFile=true \
60+
-p:IncludeNativeLibrariesForSelfExtract=true \
61+
-p:PublishReadyToRun=false \
62+
-p:EnableCompressionInSingleFile=true \
63+
-p:DebugType=embedded \
64+
-o ./publish/macos-intel
65+
66+
- name: Build Linux AMD64 (linux-x64)
67+
run: |
68+
dotnet publish Neo4jExport/Neo4jExport.fsproj \
69+
-c Release \
70+
-r linux-x64 \
71+
--self-contained true \
72+
-p:PublishSingleFile=true \
73+
-p:IncludeNativeLibrariesForSelfExtract=true \
74+
-p:PublishReadyToRun=true \
75+
-p:EnableCompressionInSingleFile=true \
76+
-p:DebugType=embedded \
77+
-o ./publish/linux-amd64
78+
79+
- name: Build Linux ARM64 (linux-arm64)
80+
run: |
81+
dotnet publish Neo4jExport/Neo4jExport.fsproj \
82+
-c Release \
83+
-r linux-arm64 \
84+
--self-contained true \
85+
-p:PublishSingleFile=true \
86+
-p:IncludeNativeLibrariesForSelfExtract=true \
87+
-p:PublishReadyToRun=true \
88+
-p:EnableCompressionInSingleFile=true \
89+
-p:DebugType=embedded \
90+
-o ./publish/linux-arm64
91+
92+
- name: Build Windows x64 (win-x64)
93+
run: |
94+
dotnet publish Neo4jExport/Neo4jExport.fsproj \
95+
-c Release \
96+
-r win-x64 \
97+
--self-contained true \
98+
-p:PublishSingleFile=true \
99+
-p:IncludeNativeLibrariesForSelfExtract=true \
100+
-p:PublishReadyToRun=true \
101+
-p:EnableCompressionInSingleFile=true \
102+
-p:DebugType=embedded \
103+
-o ./publish/windows-x64
104+
105+
- name: Build Windows ARM64 (win-arm64)
106+
run: |
107+
dotnet publish Neo4jExport/Neo4jExport.fsproj \
108+
-c Release \
109+
-r win-arm64 \
110+
--self-contained true \
111+
-p:PublishSingleFile=true \
112+
-p:IncludeNativeLibrariesForSelfExtract=true \
113+
-p:PublishReadyToRun=false \
114+
-p:EnableCompressionInSingleFile=true \
115+
-p:DebugType=embedded \
116+
-o ./publish/windows-arm64
117+
118+
- name: Rename binaries
119+
run: |
120+
mv ./publish/macos-apple-silicon/neo4j-export ./publish/neo4j-export-darwin-arm64
121+
mv ./publish/macos-intel/neo4j-export ./publish/neo4j-export-darwin-amd64
122+
mv ./publish/linux-amd64/neo4j-export ./publish/neo4j-export-linux-amd64
123+
mv ./publish/linux-arm64/neo4j-export ./publish/neo4j-export-linux-arm64
124+
mv ./publish/windows-x64/neo4j-export.exe ./publish/neo4j-export-windows-amd64.exe
125+
mv ./publish/windows-arm64/neo4j-export.exe ./publish/neo4j-export-windows-arm64.exe
126+
127+
- name: Create checksums
128+
run: |
129+
cd ./publish
130+
sha256sum neo4j-export-* > checksums.txt
131+
cat checksums.txt
132+
133+
- name: Upload artifacts
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: neo4j-export-binaries
137+
path: |
138+
./publish/neo4j-export-*
139+
./publish/checksums.txt
140+
retention-days: 90
141+
142+
- name: Create Release
143+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
144+
uses: softprops/action-gh-release@v2
145+
with:
146+
tag_name: v${{ steps.version.outputs.version }}-${{ github.run_number }}
147+
name: Release v${{ steps.version.outputs.version }}-${{ github.run_number }}
148+
draft: false
149+
prerelease: false
150+
generate_release_notes: true
151+
files: |
152+
./publish/neo4j-export-*
153+
./publish/checksums.txt
154+
body: |
155+
## Neo4j Export Tool v${{ steps.version.outputs.version }}
156+
157+
### Downloads
158+
159+
| Platform | Architecture | Download |
160+
|----------|--------------|----------|
161+
| macOS | Apple Silicon (ARM64) | [neo4j-export-darwin-arm64](https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}-${{ github.run_number }}/neo4j-export-darwin-arm64) |
162+
| macOS | Intel (x64) | [neo4j-export-darwin-amd64](https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}-${{ github.run_number }}/neo4j-export-darwin-amd64) |
163+
| Linux | x64 | [neo4j-export-linux-amd64](https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}-${{ github.run_number }}/neo4j-export-linux-amd64) |
164+
| Linux | ARM64 | [neo4j-export-linux-arm64](https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}-${{ github.run_number }}/neo4j-export-linux-arm64) |
165+
| Windows | x64 | [neo4j-export-windows-amd64.exe](https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}-${{ github.run_number }}/neo4j-export-windows-amd64.exe) |
166+
| Windows | ARM64 | [neo4j-export-windows-arm64.exe](https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}-${{ github.run_number }}/neo4j-export-windows-arm64.exe) |
167+
168+
### Installation
169+
170+
1. Download the appropriate binary for your platform
171+
2. Make it executable (macOS/Linux): `chmod +x neo4j-export-*`
172+
3. Move to your PATH or run directly
173+
174+
### Verify checksums
175+
176+
Download `checksums.txt` and verify:
177+
```bash
178+
sha256sum -c checksums.txt
179+
```

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
.env.local
1313
.env.*.local
1414

15-
# Node
15+
# Node
1616
node_modules
1717
npm-debug.log
1818

@@ -86,14 +86,18 @@ llm-generated*
8686

8787
# Working Docs (markdown files)
8888
*.md
89+
/neo4j-docs/
8990
!README.md
9091
!VERSIONING.md
92+
!Metadata.md
93+
!Types.md
94+
9195

9296
# Distribution directory - contains built binaries
9397
/dist/*
9498
!/dist/README.md
9599

96-
# Legacy subdirectories from old build process
100+
# Legacy subdirectories from old build process
97101
/darwin-amd64/
98102
/darwin-arm64/
99103
/linux-amd64/
@@ -150,4 +154,4 @@ bld/
150154
*~
151155
*.swp
152156
*.swo
153-
*.bak
157+
*.bak

Dockerfile

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,29 @@
1-
# Multi-stage build: Build stage using SDK, Runtime stage using Azure Linux Chiseled
2-
3-
# Build stage - Use Azure Linux SDK to compile the F# project
1+
# Build stage
42
FROM mcr.microsoft.com/dotnet/sdk:9.0-azurelinux3.0 AS build
53

6-
# Set up build environment
74
WORKDIR /src
85

9-
# Copy project file and restore dependencies (better layer caching)
106
COPY Neo4jExport/Neo4jExport.fsproj ./Neo4jExport/
117
RUN dotnet restore Neo4jExport/Neo4jExport.fsproj
128

13-
# Install Fantomas tool for code formatting checks
14-
# Using version 6.3.9 to match project dependency
159
RUN dotnet tool install -g fantomas --version 6.3.9
1610
ENV PATH="${PATH}:/root/.dotnet/tools"
1711

18-
# Copy source code
1912
COPY Neo4jExport/ ./Neo4jExport/
2013

21-
# Restore again after copying all source to ensure all dependencies are available
2214
RUN dotnet restore Neo4jExport/Neo4jExport.fsproj
2315

24-
# Run formatting check - always show results but don't fail the build
2516
RUN echo "=== Running Fantomas Format Check ===" && \
2617
fantomas --check Neo4jExport/ || \
2718
(echo "Code formatting check completed. See differences above." && true)
2819

29-
# Build and publish the project
3020
RUN dotnet publish Neo4jExport/Neo4jExport.fsproj -c Release -o /app/publish
3121

32-
# Runtime stage - Use Azure Linux Chiseled (Distroless) for optimal performance
22+
# Runtime stage
3323
FROM mcr.microsoft.com/dotnet/runtime:9.0-azurelinux3.0-distroless AS runtime
3424

35-
# Set up the application directory
3625
WORKDIR /app
3726

38-
# Copy the published application from build stage
3927
COPY --from=build /app/publish .
4028

41-
# Chiseled images run as non-root by default - no need for explicit user management
42-
43-
# Define the entry point for the container
4429
ENTRYPOINT ["dotnet", "neo4j-export.dll"]

0 commit comments

Comments
 (0)