fix: close release preflight gaps
CI and Deploy / test (pull_request) Failing after 1m22s
CI and Deploy / deploy (pull_request) Has been skipped

Route public health checks to the API, backfill and synchronize job opportunities, stabilize SPA smoke tests, and document operator-only production steps.
This commit is contained in:
cesnimda
2026-07-31 20:18:30 +02:00
parent ce76046a29
commit 955182b7c2
18 changed files with 350 additions and 52 deletions
@@ -816,6 +816,10 @@ public sealed class GmailControllerTests
Assert.Equal(1, created.Imported);
Assert.Equal("thread-suggested", created.ThreadId);
Assert.Equal(1, await db.JobApplications.CountAsync());
var linkedOpportunity = await db.JobApplications.Include(application => application.Job).SingleAsync();
Assert.NotNull(linkedOpportunity.JobId);
Assert.Equal("Platform Engineer", linkedOpportunity.Job!.JobTitle);
Assert.Equal("gmail", linkedOpportunity.Job.Source);
Assert.Equal(1, await db.Correspondences.CountAsync());
}
@@ -0,0 +1,38 @@
using JobTrackerApi.Models;
using JobTrackerApi.Services;
using JobTrackerApi.Tests.TestSupport;
using Microsoft.EntityFrameworkCore;
using Xunit;
namespace JobTrackerApi.Tests;
public sealed class JobOpportunitySyncTests
{
[Fact]
public async Task Backfill_links_each_legacy_application_once()
{
await using var db = TestHostFactory.CreateInMemoryDb();
var company = new Company { OwnerUserId = "user-1", Name = "Acme" };
db.Companies.Add(company);
await db.SaveChangesAsync();
db.JobApplications.Add(new JobApplication
{
OwnerUserId = "user-1",
CompanyId = company.Id,
JobTitle = "Platform Engineer",
Location = "Oslo",
SavedAt = new DateTime(2026, 7, 1, 10, 0, 0, DateTimeKind.Utc),
});
await db.SaveChangesAsync();
Assert.Equal(1, await JobOpportunitySync.BackfillLegacyAsync(db));
Assert.Equal(0, await JobOpportunitySync.BackfillLegacyAsync(db));
var application = await db.JobApplications.IgnoreQueryFilters().Include(item => item.Job).SingleAsync();
Assert.NotNull(application.JobId);
Assert.Equal("Platform Engineer", application.Job!.JobTitle);
Assert.Equal("Oslo", application.Job.Location);
Assert.Equal("legacy", application.Job.Source);
Assert.Equal(1, await db.Jobs.IgnoreQueryFilters().CountAsync());
}
}