Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
81a5f14
Entity Framework implementation.
SebastianStehle Jan 21, 2025
811f15d
Usage repository.
SebastianStehle Jan 22, 2025
4023205
Migrations.
SebastianStehle Jan 22, 2025
9c9917a
More dialects
SebastianStehle Jan 23, 2025
0f47aee
More stores.
SebastianStehle Jan 25, 2025
587e887
Add health checks and migrator.
SebastianStehle Jan 25, 2025
acca1f2
Temp
SebastianStehle Jan 26, 2025
0d67f03
Asset store tests
SebastianStehle Jan 26, 2025
7e60334
Fix
SebastianStehle Jan 27, 2025
c36462f
Asset folder repository
SebastianStehle Jan 27, 2025
6108fe6
More stuff.
SebastianStehle Jan 28, 2025
df64c67
TextState
SebastianStehle Jan 29, 2025
df041bf
Add missing files.
SebastianStehle Jan 29, 2025
90c2c70
Temp
SebastianStehle Jan 31, 2025
8a6777d
T
SebastianStehle Jan 31, 2025
eb0f970
First round of content tests
SebastianStehle Jan 31, 2025
af94622
Progress.
SebastianStehle Feb 2, 2025
1363e03
Run test
SebastianStehle Feb 2, 2025
2fc3ecc
Update dependencies.
SebastianStehle Feb 2, 2025
40669e7
Fixture improvements.
SebastianStehle Feb 3, 2025
c20fc8a
Update YDotNet
SebastianStehle Feb 3, 2025
f091bfc
Add trait.
SebastianStehle Feb 3, 2025
4a6b75e
Fix compose.
SebastianStehle Feb 3, 2025
30fa6b9
Fix filter
SebastianStehle Feb 3, 2025
bdc170b
Fix compose
SebastianStehle Feb 3, 2025
da4bd0e
Run postgres earlier.
SebastianStehle Feb 3, 2025
3577282
Update squidex libs.
SebastianStehle Feb 3, 2025
048b4c9
Another attempt.
SebastianStehle Feb 3, 2025
66cd81b
Minor improvements.
SebastianStehle Feb 3, 2025
e7ccfc0
Update build.
SebastianStehle Feb 3, 2025
2ff9e0d
Upload all docker logs.
SebastianStehle Feb 3, 2025
08119ce
Fix folder.
SebastianStehle Feb 3, 2025
16f926b
Use other host names.
SebastianStehle Feb 3, 2025
c5ec7cc
Another attempt.
SebastianStehle Feb 4, 2025
cd9178e
Fixes
SebastianStehle Feb 4, 2025
ee2691a
Update SQL server
SebastianStehle Feb 4, 2025
5ea3d4f
AllowLoadLocalInfile
SebastianStehle Feb 4, 2025
85e9baf
Fixes
SebastianStehle Feb 4, 2025
0c3dabc
Fix type.
SebastianStehle Feb 4, 2025
a01b07a
Use migrations
SebastianStehle Feb 4, 2025
c375962
Test and update migrations.
SebastianStehle Feb 4, 2025
9949051
Fix asset selector.
SebastianStehle Feb 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
  •  
  •  
  •  
70 changes: 63 additions & 7 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,19 @@ jobs:
cache-to: type=gha,mode=max
tags: squidex-local

- name: Build - TestContainers
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
default_network: host
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/backend/Squidex.sln --filter Category==TestContainers

- name: Test - Start Compose
run: docker compose up -d
working-directory: tools/TestSuite

- name: Test - RUN
- name: Test - RUN on Mongo
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
Expand All @@ -58,21 +66,63 @@ jobs:
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated

- name: Test - RUN on path
- name: Test - RUN on Postgres
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
environment: |
CONFIG__BACKUPURL=http://localhost:5000
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8081/squidex
CONFIG__SERVER__URL=http://localhost:8083
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test2
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter "Category!=NotAutomated & Category!=MongoOnly"

- name: Test - RUN on MySql
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
environment: |
CONFIG__BACKUPURL=http://localhost:5000
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8084
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test3
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter "Category!=NotAutomated & Category!=MongoOnly"

- name: Test - RUN on SqlServer
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
environment: |
CONFIG__BACKUPURL=http://localhost:5000
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8085
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test4
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter "Category!=NotAutomated & Category!=MongoOnly"

- name: Test - RUN on Mongo with path
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
environment: |
CONFIG__BACKUPURL=http://localhost:5000
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8081/squidex
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test5
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated

- name: Test - RUN with dedicated collections
- name: Test - RUN on Mongo with dedicated collections
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
Expand All @@ -82,7 +132,7 @@ jobs:
CONFIG__SERVER__URL=http://localhost:8082
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test3
options: --name test6
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated

Expand Down Expand Up @@ -112,8 +162,14 @@ jobs:
if: failure()
uses: jwalton/gh-docker-logs@v2.2.2
with:
images: 'squidex-local,squidex/resizer'
tail: '100'
dest: './docker-logs'

- name: Test - Upload docker logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: docker-logs
path: './docker-logs'

- name: Test - Cleanup
if: always()
Expand Down
38 changes: 8 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,34 +54,6 @@ jobs:
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated

- name: Test - RUN on path
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
environment: |
CONFIG__BACKUPURL=http://localhost:5000
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8081/squidex
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test2
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated

- name: Test - RUN with dedicated collections
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: squidex/build:9
environment: |
CONFIG__BACKUPURL=http://localhost:5000
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8082
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test3
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated

- name: Test - Install Playwright Dependencies
run: npm ci
working-directory: './tools/e2e'
Expand All @@ -108,8 +80,14 @@ jobs:
if: failure()
uses: jwalton/gh-docker-logs@v2.2.2
with:
images: 'squidex-local,squidex/resizer'
tail: '100'
dest: './docker-logs'

- name: Test - Upload docker logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: docker-logs
path: './docker-logs'

- name: Test - Cleanup
if: always()
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN dotnet restore
COPY backend .

# Test Backend
RUN dotnet test --no-restore --filter Category!=Dependencies
RUN dotnet test --no-restore --filter "Category!=Dependencies & Category!=TestContainer"

# Publish
RUN dotnet publish --no-restore src/Squidex/Squidex.csproj --output /build/ --configuration Release -p:version=$SQUIDEX__BUILD__VERSION
Expand Down
2 changes: 1 addition & 1 deletion backend/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dotnet_diagnostic.MA0004.severity = none
dotnet_diagnostic.MA0006.severity = none

# MA0007: Add a comma after the last value
dotnet_diagnostic.MA0007.severity = none
dotnet_diagnostic.MA0007.severity = warning

# MA0008: Add StructLayoutAttribute
dotnet_diagnostic.MA0008.severity = none
Expand Down
15 changes: 15 additions & 0 deletions backend/Squidex.sln
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Data.MongoDb", "src
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Data.Tests", "tests\Squidex.Data.Tests\Squidex.Data.Tests.csproj", "{AA2F3C32-E3C8-4DF3-A365-F25C7EC19BCD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squidex.Data.EntityFramework", "src\Squidex.Data.EntityFramework\Squidex.Data.EntityFramework.csproj", "{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -262,6 +264,18 @@ Global
{AA2F3C32-E3C8-4DF3-A365-F25C7EC19BCD}.Release|x64.Build.0 = Release|Any CPU
{AA2F3C32-E3C8-4DF3-A365-F25C7EC19BCD}.Release|x86.ActiveCfg = Release|Any CPU
{AA2F3C32-E3C8-4DF3-A365-F25C7EC19BCD}.Release|x86.Build.0 = Release|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Debug|x64.ActiveCfg = Debug|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Debug|x64.Build.0 = Debug|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Debug|x86.ActiveCfg = Debug|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Debug|x86.Build.0 = Debug|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Release|Any CPU.Build.0 = Release|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Release|x64.ActiveCfg = Release|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Release|x64.Build.0 = Release|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Release|x86.ActiveCfg = Release|Any CPU
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -284,6 +298,7 @@ Global
{23615A39-F3FB-4575-A91C-535899DFB636} = {94207AA6-4923-4183-A558-E0F8196B8CA3}
{F754F05E-02FF-47B2-AB46-BB05C7E6B29D} = {3378B841-53F8-48CC-87C1-1B30CF912BFD}
{AA2F3C32-E3C8-4DF3-A365-F25C7EC19BCD} = {3378B841-53F8-48CC-87C1-1B30CF912BFD}
{0348CFDA-4DA1-4DB5-9C6F-0D234FE3E4DA} = {3378B841-53F8-48CC-87C1-1B30CF912BFD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {02F2E872-3141-44F5-BD6A-33CD84E9FE08}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public sealed class AlgoliaActionHandler(RuleEventFormatter formatter, IScriptEn
{
More = new Dictionary<string, object>
{
["error"] = $"Invalid JSON: {ex.Message}"
}
["error"] = $"Invalid JSON: {ex.Message}",
},
};
}

Expand All @@ -85,7 +85,7 @@ public sealed class AlgoliaActionHandler(RuleEventFormatter formatter, IScriptEn
ApiKey = action.ApiKey,
Content = serializer.Serialize(content, true),
ContentId = contentId,
IndexName = indexName
IndexName = indexName,
};

return (ruleDescription, ruleJob);
Expand All @@ -107,7 +107,7 @@ protected override async Task<Result> ExecuteJobAsync(AlgoliaJob job,
{
var raw = new[]
{
new JRaw(job.Content)
new JRaw(job.Content),
};

var response = await index.SaveObjectsAsync(raw, null, ct, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public sealed class AzureQueueActionHandler(RuleEventFormatter formatter) : Rule
{
QueueConnectionString = action.ConnectionString,
QueueName = queueName!,
MessageBodyV2 = requestBody
MessageBodyV2 = requestBody,
};

return (ruleText, ruleJob);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public sealed class CommentActionHandler(RuleEventFormatter formatter, ICollabor

var ruleJob = new CommentCreated
{
AppId = contentEvent.AppId
AppId = contentEvent.AppId,
};

var text = await FormatAsync(action.Text, @event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed class CreateContentActionHandler(RuleEventFormatter formatter, IAp
{
var ruleJob = new Command
{
AppId = @event.AppId
AppId = @event.AppId,
};

var schema = await appProvider.GetSchemaAsync(@event.AppId.Id, action.Schema, true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal sealed partial class DeepDetectActionHandler(
AssetId = assetEvent.Id,
MaximumTags = action.MaximumTags,
MinimumPropability = action.MinimumProbability,
Url = urlGenerator.AssetContent(assetEvent.AppId, assetEvent.Id.ToString(), assetEvent.FileVersion)
Url = urlGenerator.AssetContent(assetEvent.AppId, assetEvent.Id.ToString(), assetEvent.FileVersion),
};

return Task.FromResult((Description, ruleJob));
Expand All @@ -81,7 +81,7 @@ protected override async Task<Result> ExecuteJobAsync(DeepDetectJob job,
data = new[]
{
job.Url,
}
},
}, ct);

var body = await response.Content.ReadAsStringAsync(ct);
Expand Down Expand Up @@ -120,7 +120,7 @@ protected override async Task<Result> ExecuteJobAsync(DeepDetectJob job,
AssetId = asset.Id,
AppId = asset.AppId,
Actor = job.Actor,
FromRule = true
FromRule = true,
};

foreach (var tag in tags)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed class DiscourseActionHandler(RuleEventFormatter formatter, IHttpCl

var json = new Dictionary<string, object?>
{
["title"] = await FormatAsync(action.Title!, @event)
["title"] = await FormatAsync(action.Title!, @event),
};

if (action.Topic != null)
Expand All @@ -46,7 +46,7 @@ public sealed class DiscourseActionHandler(RuleEventFormatter formatter, IHttpCl
ApiKey = action.ApiKey,
ApiUserName = action.ApiUsername,
RequestUrl = url,
RequestBody = requestBody
RequestBody = requestBody,
};

var description =
Expand All @@ -64,7 +64,7 @@ protected override async Task<Result> ExecuteJobAsync(DiscourseJob job,

var request = new HttpRequestMessage(HttpMethod.Post, job.RequestUrl)
{
Content = new StringContent(job.RequestBody, Encoding.UTF8, "application/json")
Content = new StringContent(job.RequestBody, Encoding.UTF8, "application/json"),
};

request.Headers.TryAddWithoutValidation("Api-Key", job.ApiKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public sealed class ElasticSearchActionHandler(RuleEventFormatter formatter, ISc
ServerHost = action.Host.ToString(),
ServerUser = action.Username,
ServerPassword = action.Password,
ContentId = contentId
ContentId = contentId,
};

if (delete)
Expand Down Expand Up @@ -88,8 +88,8 @@ public sealed class ElasticSearchActionHandler(RuleEventFormatter formatter, ISc
{
More = new Dictionary<string, object>
{
["error"] = $"Invalid JSON: {ex.Message}"
}
["error"] = $"Invalid JSON: {ex.Message}",
},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed class EmailActionHandler(RuleEventFormatter formatter) : RuleActio
MessageFrom = (await FormatAsync(action.MessageFrom, @event))!,
MessageTo = (await FormatAsync(action.MessageTo, @event))!,
MessageSubject = (await FormatAsync(action.MessageSubject, @event))!,
MessageBody = (await FormatAsync(action.MessageBody, @event))!
MessageBody = (await FormatAsync(action.MessageBody, @event))!,
};

var description = $"Send an email to {ruleJob.MessageTo}";
Expand Down Expand Up @@ -58,7 +58,7 @@ protected override async Task<Result> ExecuteJobAsync(EmailJob job,

smtpMessage.Body = new TextPart(TextFormat.Html)
{
Text = job.MessageBody
Text = job.MessageBody,
};

smtpMessage.Subject = job.MessageSubject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected override (string Description, FastlyJob Data) CreateJob(EnrichedEvent
{
Key = id,
FastlyApiKey = action.ApiKey,
FastlyServiceID = action.ServiceId
FastlyServiceID = action.ServiceId,
};

return (Description, ruleJob);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public sealed class KafkaActionHandler(RuleEventFormatter formatter, KafkaProduc
Headers = await ParseHeadersAsync(action.Headers, @event),
Schema = action.Schema,
PartitionKey = await FormatAsync(action.PartitionKey, @event),
PartitionCount = action.PartitionCount
PartitionCount = action.PartitionCount,
};

return (Description, ruleJob);
Expand Down
Loading