Skip to content

Commit a136eb4

Browse files
committed
style fixes and CI build process
Added CI support process
1 parent b3bd81e commit a136eb4

26 files changed

+912
-182
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve Spring Data FalkorDB
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
## 🐛 Bug Description
11+
A clear and concise description of what the bug is.
12+
13+
## 🔄 Steps to Reproduce
14+
Steps to reproduce the behavior:
15+
1. Set up FalkorDB with '...'
16+
2. Create entity with '...'
17+
3. Execute operation '...'
18+
4. See error
19+
20+
## ✅ Expected Behavior
21+
A clear and concise description of what you expected to happen.
22+
23+
## ❌ Actual Behavior
24+
A clear and concise description of what actually happened.
25+
26+
## 📊 Environment
27+
- **Spring Data FalkorDB version**: [e.g., 1.0.0-SNAPSHOT]
28+
- **FalkorDB version**: [e.g., latest, v4.0.9]
29+
- **Java version**: [e.g., OpenJDK 17]
30+
- **Spring Boot version** (if applicable): [e.g., 3.2.0]
31+
- **Operating System**: [e.g., Ubuntu 20.04, macOS 13, Windows 11]
32+
33+
## 📋 Code Sample
34+
```java
35+
// Minimal code sample that reproduces the issue
36+
@Node("Person")
37+
public class Person {
38+
@Id
39+
@GeneratedValue
40+
private Long id;
41+
// ...
42+
}
43+
```
44+
45+
## 📝 Error Logs
46+
```
47+
Paste any relevant error logs here
48+
```
49+
50+
## 💡 Additional Context
51+
Add any other context about the problem here, such as:
52+
- Does this happen with specific graph structures?
53+
- Is this related to relationship mapping?
54+
- Does this occur only with certain query patterns?
55+
56+
## 🔍 Possible Solution (Optional)
57+
If you have ideas on how to fix this, please share them here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,44 @@
1-
<!--
1+
# Pull Request
22

3-
Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
4-
Make sure that:
3+
## 📝 Description
4+
Brief description of the changes made in this PR.
55

6-
-->
6+
## 🔗 Related Issue(s)
7+
Fixes #(issue_number)
8+
Closes #(issue_number)
9+
Related to #(issue_number)
710

8-
- [ ] You have read the [Spring Data FalkorDB contribution guidelines](https://github.com/falkordb/spring-data-falkordb/blob/master/CONTRIBUTING.adoc).
9-
- [ ] You use the code formatters provided [here](https://github.com/spring-projects/spring-data-build/tree/master/etc/ide) and have them applied to your changes. Don’t submit any formatting related changes.
10-
- [ ] You submit test cases (unit or integration tests) that back your changes.
11-
- [ ] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
11+
## 📋 Type of Change
12+
Please delete options that are not relevant.
13+
14+
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
15+
- [ ] ✨ New feature (non-breaking change which adds functionality)
16+
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
17+
- [ ] 📚 Documentation update
18+
- [ ] 🧹 Code cleanup/refactoring
19+
- [ ] 🧪 Test improvements
20+
21+
## 🧪 Testing
22+
- [ ] Tests pass locally with my changes
23+
- [ ] I have added tests that prove my fix is effective or that my feature works
24+
- [ ] I have run the Twitter integration test specifically: `./mvnw test -Dtest=FalkorDBTwitterIntegrationTests`
25+
- [ ] FalkorDB integration tests pass
26+
27+
## ✅ Checklist
28+
- [ ] I have read the [Spring Data FalkorDB contribution guidelines](CONTRIBUTING.md)
29+
- [ ] My code follows the project's style guidelines (checkstyle passes)
30+
- [ ] I have performed a self-review of my own code
31+
- [ ] I have commented my code, particularly in hard-to-understand areas
32+
- [ ] I have made corresponding changes to the documentation
33+
- [ ] I have added myself as author in the headers of classes I touched
34+
- [ ] My changes generate no new warnings
35+
- [ ] New and existing unit tests pass locally with my changes
36+
- [ ] Any dependent changes have been merged and published
37+
38+
## 🔧 Environment Tested
39+
- **Java version**: [e.g., OpenJDK 17]
40+
- **FalkorDB version**: [e.g., latest Docker image]
41+
- **Operating System**: [e.g., Ubuntu 20.04, macOS 13]
42+
43+
## 📚 Additional Notes
44+
Any additional information that might be helpful for reviewers.

.github/workflows/ci.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Tests (Java ${{ matrix.java }})
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
java: [17, 21]
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up JDK ${{ matrix.java }}
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: ${{ matrix.java }}
27+
distribution: 'temurin'
28+
29+
- name: Cache Maven dependencies
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.m2/repository
33+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
34+
restore-keys: |
35+
${{ runner.os }}-maven-
36+
37+
- name: Install Redis CLI
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y redis-tools
41+
42+
- name: Start FalkorDB
43+
run: |
44+
docker run -d --name falkordb -p 6379:6379 falkordb/falkordb:latest
45+
# Wait for FalkorDB to be ready
46+
echo "Waiting for FalkorDB to start..."
47+
timeout 60 bash -c 'until nc -z localhost 6379; do sleep 1; done'
48+
echo "FalkorDB is ready"
49+
50+
- name: Verify FalkorDB connection
51+
run: |
52+
# Test basic Redis/FalkorDB connectivity
53+
redis-cli -p 6379 ping || (echo "FalkorDB not responding" && exit 1)
54+
# Test FalkorDB graph functionality
55+
redis-cli -p 6379 GRAPH.QUERY test "RETURN 'Hello FalkorDB' as greeting" || (echo "FalkorDB graph functionality not working" && exit 1)
56+
57+
- name: Run tests
58+
run: ./mvnw clean verify -B -Dcheckstyle.skip=true
59+
env:
60+
MAVEN_OPTS: -Xmx1024m
61+
62+
- name: Run Twitter integration tests specifically
63+
run: ./mvnw test -Dtest=FalkorDBTwitterIntegrationTests -Dcheckstyle.skip=true
64+
65+
- name: Run all integration tests
66+
run: ./mvnw test -Dtest="*IntegrationTest*" -Dcheckstyle.skip=true
67+
68+
- name: Show FalkorDB logs on failure
69+
if: failure()
70+
run: docker logs falkordb
71+
72+
- name: Upload test reports
73+
if: always()
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: test-reports-java-${{ matrix.java }}
77+
path: |
78+
**/target/surefire-reports/
79+
**/target/failsafe-reports/
80+
retention-days: 7
81+
82+
build:
83+
name: Build and Package
84+
runs-on: ubuntu-latest
85+
needs: test
86+
87+
steps:
88+
- name: Checkout code
89+
uses: actions/checkout@v4
90+
91+
- name: Set up JDK 17
92+
uses: actions/setup-java@v4
93+
with:
94+
java-version: 17
95+
distribution: 'temurin'
96+
97+
- name: Cache Maven dependencies
98+
uses: actions/cache@v4
99+
with:
100+
path: ~/.m2/repository
101+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
102+
restore-keys: |
103+
${{ runner.os }}-maven-
104+
105+
- name: Build package
106+
run: ./mvnw clean package -DskipTests -B -Dcheckstyle.skip=true
107+
108+
- name: Upload build artifacts
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: build-artifacts
112+
path: target/*.jar
113+
retention-days: 7
114+
115+
checkstyle:
116+
name: Code Style Check
117+
runs-on: ubuntu-latest
118+
119+
steps:
120+
- name: Checkout code
121+
uses: actions/checkout@v4
122+
123+
- name: Set up JDK 17
124+
uses: actions/setup-java@v4
125+
with:
126+
java-version: 17
127+
distribution: 'temurin'
128+
129+
- name: Cache Maven dependencies
130+
uses: actions/cache@v4
131+
with:
132+
path: ~/.m2/repository
133+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
134+
restore-keys: |
135+
${{ runner.os }}-maven-
136+
137+
- name: Run Checkstyle
138+
run: ./mvnw checkstyle:check -B

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Release version'
10+
required: true
11+
default: '1.0.0'
12+
13+
jobs:
14+
release:
15+
name: Release to Maven Central
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: 17
26+
distribution: 'temurin'
27+
28+
- name: Cache Maven dependencies
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.m2/repository
32+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
33+
restore-keys: |
34+
${{ runner.os }}-maven-
35+
36+
- name: Install Redis CLI
37+
run: |
38+
sudo apt-get update
39+
sudo apt-get install -y redis-tools
40+
41+
- name: Start FalkorDB
42+
run: |
43+
docker run -d --name falkordb -p 6379:6379 falkordb/falkordb:latest
44+
# Wait for FalkorDB to be ready
45+
echo "Waiting for FalkorDB to start..."
46+
timeout 60 bash -c 'until nc -z localhost 6379; do sleep 1; done'
47+
echo "FalkorDB is ready"
48+
49+
- name: Run full test suite
50+
run: ./mvnw clean verify -B -Dcheckstyle.skip=true
51+
env:
52+
MAVEN_OPTS: -Xmx1024m
53+
54+
- name: Build and Package
55+
run: ./mvnw clean package -DskipTests -B -P release
56+
57+
- name: Upload Release Assets
58+
if: github.event_name == 'release'
59+
uses: actions/upload-release-asset@v1
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
upload_url: ${{ github.event.release.upload_url }}
64+
asset_path: target/spring-data-falkordb-*.jar
65+
asset_name: spring-data-falkordb-${{ github.event.release.tag_name }}.jar
66+
asset_content_type: application/java-archive

0 commit comments

Comments
 (0)