Skip to content

Commit dda5dbe

Browse files
ejsmithniemyjski
andauthored
Beginning work on new Svelte UI (#1417)
* Created new sveltekit project * Added VS Code launch support for svelte. * Added tailwind and dasiyui * Added helpful resources * Added models generated from swagger. * WIP Added login page * Updated login * Fixed launch config and updated login styles * WIP - login page validation work. * Added api client. * Added problem details * Fixed tests * Fixed tests * WIP Problem details. * Login page refactor * Some cleanup and get events list page * Minor * Store token in localstorage, redirect back to page after login * Logout page * Added api launch config * Fixed formatting. * Change default proxy port to match API. Some work on OAuth login. * Login page fixes * Fixed login page * Swagger fixes * Google login working * Adding other oauth providers * State is google specific * Added shared layout for auth pages. * Few minor oauth updates * Fixed merge build errors * Fixed build errors * Update deps * Applied linting * Regenerated models after Nullable reference types * Added default templates npx swagger-typescript-api generate-templates -o api-templates * Updates to client side model generation * Added ability to pull in fluent validation rules into swagger. * Updated generation * more generation improvements * Improved code gen * More code gen fixes * Updated signup model validation * code gen improvements * Removed constructor * Some cleanup of problem details / validation * Updated swagger config * WIP: MiniValidation with automatic problem details DamianEdwards/MiniValidation#51 * Login and logout flow + dashboard with auth detection. * Reverted some model state changes * Reworked how api client redirects * Added websockets and layout auth redirection * Added samples for both paging and infinity paging * Updated to tanstack query (other one was deprecated) * More example resources * Updated deps * Added paging helpers to json response * Updated server response types and base summary model * Added Events Table component which supports column selection, default summaries (WIP) * Pushed summary updates * FetchClient changes to add middleware and make it more generic * Add global default options to FetchClient, setup global model validator, and global middleware to redirect on 401. * Some small fixes. * some fetch updates * Fixed build warnings * Early WIP - Taillog component * Greatly improved summaries * some query client work * WIP event tail log * Always return search tokens * Updated deps * Added default public env file * Conditionally turn off account creation * Moved oauth to use env * Added exceptionless client * Fixed client warnings and errors by adding trace logging. * changed file type of hook * Fixed app login * Fixed summary formatters * More efficient events tail log. * Added temporary drawer * Added live mode, start of pager. * Moving app base to /next, more FetchClient updates, fix unmount code for eventstail component. * Some styling * More style * Conditionally render summaries * Added new websocket message component to streamline how we listen to events * Working on getting both client apps to run together * Remove lint from build * Handle fallback for /next client app * Fixed logo * Change URL to /next for SPA startup * Change launchUrl to match SPA url * Some paging updates * Added paging summary * Fixed paging * Fixed paging * Fixed the pager on mobile. * Created generic table component (WIP) * forward events https://learn.svelte.dev/tutorial/event-forwarding * Ensure json doesn't get new line inserted * Fixed summary tests * Fixed validation tests * Fixed all tests * Fixed bad auto git merge * Fixed redirect * Added pagination helper. * WIP: Added column sorting * Added column picker * Added ability to navigate to the first page * Fixed binding issue * Fixed callback * Fixed drawer * Use store for drawer and for live view * WIP search and filtering * Added empty table message. * Workaround for $$Generic sveltejs/svelte-eslint-parser#306 * Fixed linting errors, updated deps * Use global fetch / loading * Updated deps * Work arounds for slot forwarding, couldn't reuse let:variable syntax and had to use writables for page. sveltejs/svelte#7021 * use persisted storage for events column options * WIP events drawer * Updated deps * Rearranged models a bit and pulled in some models from the exceptionless client * Added components for time formatting * WIP: Events drawer and overview. * Fix issue with code formatter changing line endings and causing git issues. Turn daisyui banner off. * Parallelize build * Events Sidebar * Ran formatting * Try building just exceptionless all in one image during docker build step * Don't run client tests yet * Try only building app docker image * Set artifact retention * Tweak how we start docker services * Don't wait for docker compose * Debug * Try different approach * Checkout on deploy * Try different docker build * Another parallel approach * Break out deploy * More build tweaks * Add code coverage * Use run-all to run multiple tasks * Revert some CSP policy changes * Comment out unused code to pass lint rules * Allow http gravatar * Add missing logo back * increased sidebar width * WIP - Error and Simple error stack traces * Fixed http file * Updated deps * Reworked how stack traces are rendered * removed extra whitespace. * Whitespace formatting * More styling fixes * make stack trace look nicer * Updated deps * WIP: Clickable filters with ability to enter custom keyword filters. * rearranged loading rendering order in component due to global loader. * Renamed functions * Added more search + log level component * Fixed warning --------- Co-authored-by: Blake Niemyjski <[email protected]>
1 parent 724e6b4 commit dda5dbe

File tree

472 files changed

+22590
-9747
lines changed

Some content is hidden

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

472 files changed

+22590
-9747
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ indent_style = space
1212
indent_size = 4
1313
trim_trailing_whitespace = true
1414

15+
[*.json]
16+
insert_final_newline = false
17+
1518
# Generated code
1619
[*{_AssemblyInfo.cs,.notsupported.cs,AsmOffsets.cs}]
1720
generated_code = true

.github/workflows/build.yaml

+193-26
Original file line numberDiff line numberDiff line change
@@ -8,98 +8,265 @@ env:
88
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
99

1010
jobs:
11-
build:
11+
12+
version:
13+
1214
runs-on: ubuntu-latest
1315
timeout-minutes: 30
16+
outputs:
17+
version: ${{ steps.version.outputs.version }}
18+
1419
steps:
20+
1521
- name: Checkout
1622
uses: actions/checkout@v3
1723
with:
1824
fetch-depth: 0
25+
1926
- name: Build Reason
2027
env:
2128
GITHUB_EVENT: ${{ toJson(github) }}
2229
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
30+
31+
- name: Version
32+
id: version
33+
run: |
34+
dotnet tool install --global minver-cli --version 4.3.0
35+
version=$(minver --tag-prefix v)
36+
echo "version=$version" >> $GITHUB_OUTPUT
37+
echo "### $version" >> $GITHUB_STEP_SUMMARY
38+
39+
test-api:
40+
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 30
43+
44+
steps:
45+
46+
- name: Checkout
47+
uses: actions/checkout@v3
48+
with:
49+
fetch-depth: 0
50+
2351
- name: Setup .NET Core
2452
uses: actions/setup-dotnet@v3
2553
with:
2654
dotnet-version: 7.0.*
2755
dotnet-quality: ga
28-
- name: Build Version
29-
run: |
30-
dotnet tool install --global minver-cli --version 4.3.0
31-
version=$(minver --tag-prefix v)
32-
echo "MINVERVERSIONOVERRIDE=$version" >> $GITHUB_ENV
33-
echo "VERSION=$version" >> $GITHUB_ENV
34-
echo "### Version: $version" >> $GITHUB_STEP_SUMMARY
35-
- name: Lint .NET
36-
run: dotnet format --verify-no-changes --no-restore --verbosity diagnostic
37-
- name: Build
38-
run: dotnet build --configuration Release /clp:NoSummary
56+
3957
- name: Start Services
58+
working-directory: docker
59+
run: docker compose up -d elasticsearch &
60+
61+
- uses: actions/cache@v3
62+
with:
63+
path: ~/.nuget/packages
64+
key: nuget-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
65+
restore-keys: |
66+
nuget-${{ runner.os }}-
67+
68+
- name: Nuget Restore
69+
run: dotnet restore
70+
71+
- name: Build
72+
run: dotnet build --no-restore --configuration Release
73+
74+
- name: Wait for Elasticsearch
4075
working-directory: docker
4176
run: docker compose up --wait elasticsearch
42-
- name: Run Tests
43-
run: dotnet test --configuration Release --no-build --logger GitHubActions
77+
78+
- name: Run .NET Tests
79+
run: dotnet test --no-restore --no-build --configuration Release --collect:"XPlat Code Coverage" -m:1 --logger trx --results-directory coverage --logger GitHubActions
80+
81+
- name: Copy Coverage to Predictable Location
82+
run: cp coverage/*/coverage.cobertura.xml coverage/coverage.cobertura.xml
83+
84+
- name: Code Coverage Summary Report
85+
uses: irongut/[email protected]
86+
with:
87+
filename: coverage/coverage.cobertura.xml
88+
badge: true
89+
format: "markdown"
90+
output: "both"
91+
92+
- name: Add Coverage PR Comment
93+
uses: marocchino/sticky-pull-request-comment@v2
94+
if: github.event_name == 'pull_request'
95+
with:
96+
recreate: true
97+
path: code-coverage-results.md
98+
99+
- name: Write Coverage to Job Summary
100+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
101+
102+
test-client:
103+
104+
runs-on: ubuntu-latest
105+
timeout-minutes: 30
106+
defaults:
107+
run:
108+
working-directory: ./src/Exceptionless.Web/ClientApp
109+
110+
steps:
111+
112+
- name: Checkout
113+
uses: actions/checkout@v3
114+
with:
115+
fetch-depth: 0
116+
117+
- name: Setup .NET Core
118+
uses: actions/setup-dotnet@v3
119+
with:
120+
dotnet-version: 7.0.*
121+
dotnet-quality: ga
122+
123+
- name: Cache node_modules
124+
uses: actions/cache@v3
125+
with:
126+
path: |
127+
node_modules
128+
key: node-modules-${{ hashFiles('package-lock.json') }}
129+
44130
- name: Setup Node.js environment
45131
uses: actions/setup-node@v3
46132
with:
47133
node-version: 18
134+
48135
- name: Install Npm Packages
49-
working-directory: src/Exceptionless.Web/ClientApp
50136
run: npm ci
137+
51138
- name: Lint Client
52-
working-directory: src/Exceptionless.Web/ClientApp
53-
run: |
54-
npm run lint
55-
npm run prettier:check
139+
run: npm run lint
140+
141+
- name: Run Unit Tests
142+
run: echo "npm run test:unit"
143+
144+
- name: Run Integration Tests
145+
run: echo "npm run test:integration"
146+
147+
build-docker:
148+
149+
runs-on: ubuntu-latest
150+
needs: [version]
151+
timeout-minutes: 30
152+
env:
153+
VERSION: ${{needs.version.outputs.version}}
154+
155+
steps:
156+
157+
- name: Checkout
158+
uses: actions/checkout@v3
159+
with:
160+
fetch-depth: 0
161+
56162
- name: Set up Docker Buildx
57163
if: "${{ env.DOCKER_USERNAME != '' }}"
58164
uses: docker/setup-buildx-action@v2
59165
with:
60166
platforms: linux/amd64
167+
168+
- name: Build api docker image
169+
run: |
170+
echo "::remove-matcher owner=csc::"
171+
docker buildx build . --target api --platform linux/amd64 --tag exceptionless/api-ci:latest --cache-from type=gha --cache-to type=gha,mode=max --load
172+
173+
- name: Build job docker image
174+
run: |
175+
echo "::remove-matcher owner=csc::"
176+
docker buildx build . --target job --platform linux/amd64 --tag exceptionless/job-ci:latest --cache-from type=gha --cache-to type=gha,mode=max --load
177+
178+
- name: Build app docker image
179+
run: |
180+
echo "::remove-matcher owner=csc::"
181+
docker buildx build . --target app --platform linux/amd64 --tag exceptionless/app-ci:latest --cache-from type=gha --cache-to type=gha,mode=max --load
182+
183+
- name: Build all-in-one docker image
184+
run: |
185+
echo "::remove-matcher owner=csc::"
186+
docker buildx build . --target exceptionless --platform linux/amd64 --tag exceptionless/exceptionless-ci:latest --cache-from type=gha --cache-to type=gha,mode=max --load
187+
188+
- name: Build all-in-one Elasticsearch 7 docker image
189+
if: "${{ env.DOCKER_USERNAME != '' && startsWith(github.ref, 'refs/tags/v') && github.event_name != 'pull_request' }}"
190+
run: |
191+
echo "::remove-matcher owner=csc::"
192+
docker buildx build . --target exceptionless7 --platform linux/amd64 --tag exceptionless/exceptionless:latest-elasticsearch7 --cache-from type=gha --cache-to type=gha,mode=max --load
193+
61194
- name: Login to GitHub Container Registry
62195
if: "${{ env.DOCKER_USERNAME != '' }}"
63196
uses: docker/login-action@v2
64197
with:
65198
registry: ghcr.io
66199
username: ${{ github.actor }}
67200
password: ${{ secrets.GITHUB_TOKEN }}
201+
68202
- name: Login to DockerHub
69203
if: "${{ env.DOCKER_USERNAME != '' }}"
70204
uses: docker/login-action@v2
71205
with:
72206
username: ${{ env.DOCKER_USERNAME }}
73207
password: ${{ secrets.DOCKER_PASSWORD }}
208+
209+
- name: Wait for test jobs
210+
uses: yogeshlonkar/wait-for-jobs@v0
211+
with:
212+
jobs: 'test-api,test-client'
213+
interval: '2500'
214+
ttl: '10'
215+
74216
- name: Publish CI Packages
75217
if: "${{ env.DOCKER_USERNAME != '' }}"
76218
run: |
77219
echo "::remove-matcher owner=csc::"
78-
# tag and push docker image
220+
# tag and push docker images
221+
79222
for image in {"api","job","app","exceptionless"}; do
80-
docker buildx build --target $image --platform linux/amd64 --output "type=image,push=true" . --tag exceptionless/$image-ci:$VERSION --tag exceptionless/$image-ci:latest --tag ghcr.io/exceptionless/exceptionless/$image:$VERSION --tag ghcr.io/exceptionless/exceptionless/$image:latest
223+
docker image tag exceptionless/$image-ci:latest exceptionless/$image-ci:$VERSION
224+
docker image tag exceptionless/$image-ci:latest ghcr.io/exceptionless/exceptionless/$image-ci:$VERSION
225+
docker image tag exceptionless/$image-ci:latest ghcr.io/exceptionless/exceptionless/$image-ci:latest
226+
227+
docker image push --all-tags exceptionless/$image-ci
81228
done
82-
#docker buildx build --target exceptionless7 --platform linux/amd64 --output "type=image,push=true" . --tag exceptionless/exceptionless-ci:$VERSION-elasticsearch7 --tag exceptionless/exceptionless-ci:latest-elasticsearch7 --tag ghcr.io/exceptionless/exceptionless/exceptionless:$VERSION-elasticsearch7 --tag ghcr.io/exceptionless/exceptionless/exceptionless:latest-elasticsearch7
229+
83230
- name: Publish Release Packages
84231
if: "${{ env.DOCKER_USERNAME != '' && startsWith(github.ref, 'refs/tags/v') && github.event_name != 'pull_request' }}"
85232
run: |
86-
# tag and push docker image
233+
echo "::remove-matcher owner=csc::"
234+
# tag and push docker images
235+
236+
# only build elasticsearch 7 all-in-one image for release builds
237+
docker image tag exceptionless/exceptionless:latest-elasticsearch7 exceptionless/exceptionless:$VERSION-elasticsearch7
238+
87239
for image in {"api","job","app","exceptionless"}; do
88-
docker buildx build --target $image --platform linux/amd64 --output "type=image,push=true" . --tag exceptionless/$image:$VERSION --tag exceptionless/$image:latest
240+
docker image tag exceptionless/$image-ci:latest exceptionless/$image:$VERSION
241+
docker image tag exceptionless/$image-ci:latest exceptionless/$image:latest
242+
243+
docker image push --all-tags exceptionless/$image
89244
done
90-
docker buildx build --target exceptionless7 --platform linux/amd64 --output "type=image,push=true" . --tag exceptionless/exceptionless:$VERSION-elasticsearch7 --tag exceptionless/exceptionless:latest-elasticsearch7
245+
246+
deploy:
247+
if: "${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && github.event_name != 'pull_request' }}"
248+
needs: [version,build-docker]
249+
runs-on: ubuntu-latest
250+
timeout-minutes: 30
251+
env:
252+
VERSION: ${{needs.version.outputs.version}}
253+
254+
steps:
255+
91256
- name: Install Helm
92257
if: "${{ env.DOCKER_USERNAME != '' && github.event_name != 'pull_request' }}"
93258
uses: azure/setup-helm@v3
94259
with:
95-
version: v3.11.1
260+
version: v3.13.0
261+
96262
- name: Deploy Changes to Development Environment
97263
if: "${{ env.DOCKER_USERNAME != '' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}"
98264
run: |
99265
az login --service-principal --username ${{ secrets.AZ_USERNAME }} --password ${{ secrets.AZ_PASSWORD }} --tenant ${{ secrets.AZ_TENANT }} --output none
100266
az aks get-credentials --resource-group exceptionless-v6 --name ex-k8s-v6
101267
sed -i "s/^appVersion:.*$/appVersion: '${VERSION}'/" ./k8s/exceptionless/Chart.yaml
102268
helm upgrade --set "version=${VERSION}" --reuse-values --values ./k8s/ex-dev-values.yaml ex-dev --namespace ex-dev ./k8s/exceptionless
269+
103270
- name: Deploy Changes to Production Environment
104271
if: "${{ env.DOCKER_USERNAME != '' && startsWith(github.ref, 'refs/tags/v') && github.event_name != 'pull_request' }}"
105272
run: |

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ k8s/ex-prod\.yaml
123123
*secrets*
124124
k8s/ex-*-snapshots.yaml
125125
node_modules
126-
src/Exceptionless\.Web/ClientApp/dist/
126+
src/Exceptionless\.Web/ClientApp/build/
127+
src/Exceptionless\.Web/ClientApp.angular/dist/
127128

128129
*.DotSettings

.husky/pre-commit

-4
This file was deleted.

.husky/task-runner.json

-11
This file was deleted.

exceptionless.http

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ Hello World!
7070

7171
### get events
7272

73-
GET {{apiUrl}}/events
73+
GET {{apiUrl}}/events?sort=date
74+
Authorization: Bearer {{token}}
75+
76+
### get events with after token
77+
78+
GET {{apiUrl}}/events?sort=date&after=WzE2OTQxNDczMjc1NTgsIjY0ZmFhMmZmZTBhZTljMmY1YzhmZjMxYyJd
7479
Authorization: Bearer {{token}}
7580

7681
###

k8s/ex-setup.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ $SP_ID=$(az aks show --resource-group $RESOURCE_GROUP --name $CLUSTER --query se
182182
$SP_SECRET=$(az ad sp credential reset --name $SP_ID --years 3 --query password -o tsv)
183183
# store secret in 1Password (Exceptionless Azure CI Service Principal)
184184
az aks update-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER --reset-service-principal --service-principal $SP_ID --client-secret $SP_SECRET
185+
az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER --overwrite-existing
185186

186187
# delete the entire thing
187188
az aks delete --resource-group $RESOURCE_GROUP --name $CLUSTER

src/Exceptionless.Core/Jobs/CloseInactiveSessionsJob.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected override async Task<JobResult> RunInternalAsync(JobContext context)
6666
continue;
6767

6868
sessionsToUpdate.Add(sessionStart);
69-
if (heartbeatResult is not null)
69+
if (heartbeatResult?.CacheKey is not null)
7070
{
7171
cacheKeysToRemove.Add(heartbeatResult.CacheKey);
7272
if (heartbeatResult.Close)

src/Exceptionless.Core/Models/EventSummaryModel.cs

-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
public record EventSummaryModel : SummaryData
44
{
5-
public required string Id { get; set; }
65
public DateTimeOffset Date { get; set; }
76
}

src/Exceptionless.Core/Models/StackSummaryModel.cs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ namespace Exceptionless.Core.Models;
55
[DebuggerDisplay("Id: {Id}, Status: {Status}, Title: {Title}, First: {FirstOccurrence}, Last: {LastOccurrence}")]
66
public record StackSummaryModel : SummaryData
77
{
8-
public required string Id { get; init; }
98
public required string Title { get; init; }
109
public StackStatus Status { get; init; }
1110
public DateTime FirstOccurrence { get; init; }

src/Exceptionless.Core/Models/SummaryData.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
public record SummaryData
44
{
5+
public required string Id { get; set; }
56
public required string TemplateKey { get; set; }
67
public required object Data { get; set; }
78
}

0 commit comments

Comments
 (0)