Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed May 29, 2024
2 parents 272760c + ecb9ebb commit c220446
Show file tree
Hide file tree
Showing 204 changed files with 9,660 additions and 1,074 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "7.0.10",
"version": "8.0.5",
"commands": [
"dotnet-ef"
]
Expand Down
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# force LF line endings on all shell scripts, even on Windows
*.sh text eol=lf

# Verify settings
*.verified.txt text eol=lf working-tree-encoding=UTF-8
*.verified.xml text eol=lf working-tree-encoding=UTF-8
*.verified.json text eol=lf working-tree-encoding=UTF-8
59 changes: 59 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "CodeQL"

on:
push:
branches: [ "develop", "main" ]
pull_request:
branches: [ "develop", "main" ]
schedule:
- cron: '34 21 * * 2'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (github.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

strategy:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: autobuild
- language: javascript-typescript
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true


# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
6 changes: 3 additions & 3 deletions .github/workflows/deploy-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ jobs:
uses: ./.github/workflows/lexbox-api.yaml
with:
version: ${{ needs.set-version.outputs.version }}
label-latest: true
label-latest: false

build-ui:
name: Build UI
needs: [ set-version ]
uses: ./.github/workflows/lexbox-ui.yaml
with:
version: ${{ needs.set-version.outputs.version }}
label-latest: true
label-latest: false

build-hgweb:
name: Build hgweb
needs: [ set-version ]
uses: ./.github/workflows/lexbox-hgweb.yaml
with:
version: ${{ needs.set-version.outputs.version }}
label-latest: true
label-latest: false

deploy:
name: Deploy Develop
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
repository: ${{ vars.FLEET_REPO }}
ssh-key: ${{ secrets.FLEET_REPO_SSH_KEY }}
path: fleet
ref: main
- name: Copy yaml resources to fleet repo
run: |
cp lexbox/deployment/${{ inputs.k8s-environment }}/resources.yaml fleet/${{ inputs.k8s-environment }}/
Expand Down Expand Up @@ -121,11 +122,12 @@ jobs:
curl -s --head "$TARGET" > response.txt
# get version from response, trim off the header and fix the line endings
versionHeader=$((grep "lexbox-version" response.txt || echo VersionNotFound) | cut -d' ' -f 2 | tr -d '[:space:]')
if [[ "$versionHeader" == "$EXPECTED_VERSION" ]]; then
echo "Version is correct"
status_code=$(grep -oP "HTTP\/\d(\.\d)? \K\d+" response.txt)
if [[ "$versionHeader" == "$EXPECTED_VERSION" && "$status_code" == "200" ]]; then
echo "Version and status code are correct"
exit 0
else
echo "Version '$versionHeader' is incorrect, expected '$EXPECTED_VERSION'"
echo "Health check failed, Version '$versionHeader', expected '$EXPECTED_VERSION', status code '$status_code'"
n=$((n+1))
sleep $((DelayMultiplier * n))
fi
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: testspace-com/setup-testspace@v1.0.6
with:
domain: ${{ github.repository_owner }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/lexbox-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Dotnet build
run: dotnet build
- name: Unit tests
run: dotnet test --logger xunit --results-directory ./test-results --filter "Category!=Integration" --blame-hang-timeout 10m
run: dotnet test --logger:"xunit;LogFileName={assembly}.results.xml" --results-directory ./test-results --filter "Category!=Integration" --blame-hang-timeout 10m
- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0
if: always()
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lexbox-hgweb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
deploy-hgweb:
uses: ./.github/workflows/deploy.yaml
if: ${{github.ref == 'refs/heads/develop'}}
if: ${{github.ref == 'refs/heads/develop' && github.event_name == 'push'}}
secrets: inherit
needs: publish-hgweb
with:
version: ${{ needs.publish-hgweb.outputs.version }}
image: 'ghcr.io/sillsdev/lexbox-hgweb'
deploy-domain: 'develop.lexbox.org'
deploy-domain: lexbox.dev.languagetechnology.org
k8s-environment: 'develop'
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "backend/harmony"]
path = backend/harmony
url = https://github.com/hahn-kev/harmony.git
branch = add-crdt
2 changes: 2 additions & 0 deletions .idea/.idea.LexBox/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 39 additions & 18 deletions .idea/.idea.LexBox/.idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/.idea.LexBox/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/.idea.LexBox/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions LexBox.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LfClassicData", "backend\Lf
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniLcm", "backend\MiniLcm\MiniLcm.csproj", "{6D4062DC-1B1A-4A24-9C61-0F6A18A39882}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalWebApp", "backend\LocalWebApp\LocalWebApp.csproj", "{2CDF7126-733B-46E8-9B93-7DC31DE39682}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LcmCrdt", "backend\LcmCrdt\LcmCrdt.csproj", "{6B857F83-72E3-43E6-91C3-A946F3F988D8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LcmCrdt.Tests", "backend\LcmCrdt.Tests\LcmCrdt.Tests.csproj", "{7D874D9B-1CA9-49E9-8B03-91B5C324E938}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crdt", "backend\harmony\src\Crdt\Crdt.csproj", "{740C8FF5-8006-4047-8C52-53873C2DD7C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crdt.Core", "backend\harmony\src\Crdt.Core\Crdt.Core.csproj", "{8B54FFB5-0BDF-403E-83CC-A3B3861EC507}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -65,9 +75,34 @@ Global
{6D4062DC-1B1A-4A24-9C61-0F6A18A39882}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D4062DC-1B1A-4A24-9C61-0F6A18A39882}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D4062DC-1B1A-4A24-9C61-0F6A18A39882}.Release|Any CPU.Build.0 = Release|Any CPU
{2CDF7126-733B-46E8-9B93-7DC31DE39682}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2CDF7126-733B-46E8-9B93-7DC31DE39682}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2CDF7126-733B-46E8-9B93-7DC31DE39682}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2CDF7126-733B-46E8-9B93-7DC31DE39682}.Release|Any CPU.Build.0 = Release|Any CPU
{6B857F83-72E3-43E6-91C3-A946F3F988D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B857F83-72E3-43E6-91C3-A946F3F988D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B857F83-72E3-43E6-91C3-A946F3F988D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B857F83-72E3-43E6-91C3-A946F3F988D8}.Release|Any CPU.Build.0 = Release|Any CPU
{7D874D9B-1CA9-49E9-8B03-91B5C324E938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D874D9B-1CA9-49E9-8B03-91B5C324E938}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D874D9B-1CA9-49E9-8B03-91B5C324E938}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D874D9B-1CA9-49E9-8B03-91B5C324E938}.Release|Any CPU.Build.0 = Release|Any CPU
{740C8FF5-8006-4047-8C52-53873C2DD7C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{740C8FF5-8006-4047-8C52-53873C2DD7C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{740C8FF5-8006-4047-8C52-53873C2DD7C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{740C8FF5-8006-4047-8C52-53873C2DD7C4}.Release|Any CPU.Build.0 = Release|Any CPU
{8B54FFB5-0BDF-403E-83CC-A3B3861EC507}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B54FFB5-0BDF-403E-83CC-A3B3861EC507}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B54FFB5-0BDF-403E-83CC-A3B3861EC507}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B54FFB5-0BDF-403E-83CC-A3B3861EC507}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E8BB768B-C3DC-4BE6-9B9F-82319E05AF86} = {7B6E21C4-5AF4-4505-B7D9-59A3886C5090}
{6D4062DC-1B1A-4A24-9C61-0F6A18A39882} = {7B6E21C4-5AF4-4505-B7D9-59A3886C5090}
{2CDF7126-733B-46E8-9B93-7DC31DE39682} = {7B6E21C4-5AF4-4505-B7D9-59A3886C5090}
{6B857F83-72E3-43E6-91C3-A946F3F988D8} = {7B6E21C4-5AF4-4505-B7D9-59A3886C5090}
{7D874D9B-1CA9-49E9-8B03-91B5C324E938} = {7B6E21C4-5AF4-4505-B7D9-59A3886C5090}
{740C8FF5-8006-4047-8C52-53873C2DD7C4} = {7B6E21C4-5AF4-4505-B7D9-59A3886C5090}
{8B54FFB5-0BDF-403E-83CC-A3B3861EC507} = {7B6E21C4-5AF4-4505-B7D9-59A3886C5090}
EndGlobalSection
EndGlobal
4 changes: 3 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ tasks:
- echo "#OTEL_SDK_DISABLED=true" >> deployment/local-dev/local.env
- echo "GOOGLE_OAUTH_CLIENT_ID=__REPLACE__.apps.googleusercontent.com" >> deployment/local-dev/local.env
- echo "GOOGLE_OAUTH_CLIENT_SECRET=__REPLACE__" >> deployment/local-dev/local.env
- kubectl --context=docker-desktop apply -f deployment/setup/namespace.yaml
setup-win:
platforms: [ windows ]
cmds:
Expand Down Expand Up @@ -83,4 +84,5 @@ tasks:
deps: [ infra-up, api:only, k8s:infra-forward ]
interactive: true


local-web-app:
deps: [ ui:viewer-dev, api:local-web-app ]
13 changes: 12 additions & 1 deletion backend/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,15 @@ dotnet_diagnostic.VSTHRD200.severity = none
dotnet_diagnostic.IDE0058.severity = suggestion

[{*Kernel}.cs]
dotnet_diagnostic.IDE0058.severity = none
dotnet_diagnostic.IDE0058.severity = none


# Verify settings
[*.{received,verified}.{txt,xml,json}]
charset = "utf-8-bom"
end_of_line = lf
indent_size = unset
indent_style = unset
insert_final_newline = false
tab_width = unset
trim_trailing_whitespace = false
31 changes: 31 additions & 0 deletions backend/LcmCrdt.Tests/LcmCrdt.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageReference Include="FluentAssertions" Version="6.12.0"/>
<PackageReference Include="xunit" Version="2.5.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3"/>
<PackageReference Include="XunitXml.TestLogger" Version="3.1.20" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit"/>
<Using Include="FluentAssertions"/>
<Using Include="Crdt"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LcmCrdt\LcmCrdt.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit c220446

Please sign in to comment.