Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop' into feat/import-fwdata-project-as-…
Browse files Browse the repository at this point in the history
…crdt

# Conflicts:
#	backend/LocalWebApp/Program.cs
  • Loading branch information
hahn-kev committed Jun 7, 2024
2 parents 1defd3e + 3e77c43 commit 2e6126b
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 7 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/develop-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,27 @@ on:
workflow_dispatch:
push:
paths:
- 'backend/**'
- 'backend/LexBoxApi/**'
- 'backend/LexCore/**'
- 'backend/LexData/**'
- 'backend/LfClassicData/**'
- 'backend/MiniLcm/**'
- 'backend/SyncReverserProxy/**'
- 'backend/Testing/**'
- '.github/workflows/lexbox-api.yaml'
- '.github/workflows/deploy.yaml'
- 'deployment/lexbox-deployment.yaml'
branches:
- develop
pull_request:
paths:
- 'backend/**'
- 'backend/LexBoxApi/**'
- 'backend/LexCore/**'
- 'backend/LexData/**'
- 'backend/LfClassicData/**'
- 'backend/MiniLcm/**'
- 'backend/SyncReverserProxy/**'
- 'backend/Testing/**'
- '.github/workflows/lexbox-api.yaml'
- '.github/workflows/deploy.yaml'
- 'deployment/lexbox-deployment.yaml'
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/fw-lite.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: FieldWorks Lite
on:
workflow_dispatch:
push:
paths:
- 'backend/FwDataMiniLcmBridge/**'
- 'backend/harmony/**'
- 'backend/LcmCrdt/**'
- 'backend/LocalWebApp/**'
- 'backend/MiniLcm/**'
- 'frontend/viewer/**'
- '.github/workflows/fw-lite.yaml'
branches:
- develop
pull_request:
paths:
- 'backend/FwDataMiniLcmBridge/**'
- 'backend/harmony/**'
- 'backend/LcmCrdt/**'
- 'backend/LocalWebApp/**'
- 'backend/MiniLcm/**'
- 'frontend/viewer/**'
- '.github/workflows/fw-lite.yaml'
branches:
- develop

jobs:
build-app:
name: Build FW Lite
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- uses: actions/setup-node@v4
with:
node-version-file: './frontend/package.json'
- name: Dotnet build
working-directory: backend/LocalWebApp
run: dotnet build --configuration Release
- name: Dotnet test
working-directory: backend/LcmCrdt.Tests
run: dotnet test --configuration Release --logger:"xunit;LogFileName={assembly}.results.xml" --results-directory ./test-results
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0
if: always()
with:
check_name: FW Lite Unit Tests
files: ./backend/LcmCrdt.Tests/test-results/*.xml
- name: Build viewer
working-directory: frontend/viewer
run: |
corepack enable
pnpm install
pnpm run build-app
- name: Publish linux
working-directory: backend/LocalWebApp
run: dotnet publish -r linux-x64 -o ./publish/linux
- name: Publish osx
working-directory: backend/LocalWebApp
run: dotnet publish -r osx-x64 -o ./publish/osx
- name: Publish win
working-directory: backend/LocalWebApp
run: dotnet publish -r win-x64 -o ./publish/win
- name: Upload artifacts
# uploading in one artifact as there's a lot of duplication between builds so compression goes far
uses: actions/upload-artifact@v4
with:
name: fw-lite
if-no-files-found: error
path: backend/LocalWebApp/publish/*
3 changes: 2 additions & 1 deletion .github/workflows/lexbox-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ jobs:
- name: Dotnet build
run: dotnet build
- name: Unit tests
working-directory: backend/Testing
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()
with:
check_name: C# Unit Tests
files: ./test-results/*.xml
files: ./backend/Testing/test-results/*.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion backend/LexData/SeedingData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async ValueTask UpdateApp(object dbApp, OpenIddictApplicationDescriptor seedApp,
OpenIddictConstants.Permissions.Scopes.Profile
},
// port is dynamic due to the nature of the native app
RedirectUris = { new Uri("http://localhost:5173/api/auth/oauth-callback") }
RedirectUris = { new Uri("http://localhost:5173/api/auth/oauth-callback"), new Uri("http://127.0.0.1:5173/api/auth/oauth-callback") }
}
], a => a.ClientId ?? throw new InvalidOperationException("ClientId is null"));

Expand Down
2 changes: 1 addition & 1 deletion backend/LocalWebApp/LocalAppKernel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static void AddAuthHelpers(this IServiceCollection services, IHostEnviro
services.AddTransient<AuthHelpers>(sp => sp.GetRequiredService<AuthHelpersFactory>().GetCurrentHelper());
services.AddSingleton<OAuthService>();
services.AddSingleton<IHostedService>(sp => sp.GetRequiredService<OAuthService>());
services.AddOptionsWithValidateOnStart<AuthConfig>().ValidateDataAnnotations();
services.AddOptionsWithValidateOnStart<AuthConfig>().BindConfiguration("Auth").ValidateDataAnnotations();
services.AddSingleton<LoggerAdapter>();
var httpClientBuilder = services.AddHttpClient(AuthHelpers.AuthHttpClientName);
if (environment.IsDevelopment())
Expand Down
6 changes: 6 additions & 0 deletions backend/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ tasks:
label: dotnet
dir: ./LocalWebApp
cmd: dotnet watch --no-hot-reload
local-web-app-with-local-lexbox:
label: Run LocalWebApp with Local LexBox
env:
Auth__DefaultAuthority: "https://localhost:3000"
dir: ./LocalWebApp
cmd: dotnet watch --no-hot-reload

publish-local-all:
cmds:
Expand Down
1 change: 1 addition & 0 deletions deployment/base/app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ data:
environment-name: "Development"
hg-otel-disabled: "false" # "true" to disable OpenTelemetry
hg-domain: "hg.localhost"
enable-oauth: "false"

10 changes: 10 additions & 0 deletions deployment/base/lexbox-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ spec:
secretKeyRef:
key: SMTP_PASSWORD
name: email
- name: Authentication__OpenId__Enable
valueFrom:
configMapKeyRef:
name: app-config
key: enable-oauth
- name: Authentication__Google__ClientId
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -275,6 +280,11 @@ spec:
configMapKeyRef:
name: app-config
key: environment-name
- name: Authentication__OpenId__Enable
valueFrom:
configMapKeyRef:
name: app-config
key: enable-oauth
- name: set-repo-structure-owner-to-www-data
securityContext:
# Make sure we're authorized to set ownership
Expand Down
1 change: 1 addition & 0 deletions deployment/develop/app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ metadata:
data:
environment-name: "Development"
hg-domain: "hg-develop.lexbox.org"
enable-oauth: "true"

2 changes: 0 additions & 2 deletions deployment/develop/lexbox-deployment.patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ spec:
- name: ASPNETCORE_ENVIRONMENT
value: "Staging" #we don't want to act like dev as that's for local development
valueFrom:
- name: Authentication__OpenId__Enable
value: "true"
- name: Email__SmtpHost
value: email-smtp.us-east-1.amazonaws.com
- name: Email__SmtpPort
Expand Down
4 changes: 4 additions & 0 deletions frontend/viewer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "viewer",
"private": true,
"packageManager": "[email protected]",
"engines": {
"node": ">=20"
},
"version": "1.0.0",
"type": "module",
"main": "dist-web-component/viewer.js",
Expand Down

0 comments on commit 2e6126b

Please sign in to comment.