mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-21 17:51:13 +00:00
[AZ-372] Apply dotnet format whitespace cleanup; archive batch 22
Pure whitespace-only cleanup uncovered by the new format gate from the previous commit. Verified via `git diff -w --stat`: only 4 files differ when whitespace is ignored, and those differ only by the BOM byte. Cleanup kinds applied across 22 source files: - BOM removal (MapConfig.cs, SatTile.cs, GeoUtils.cs, IntegrationTests/Program.cs) - CRLF -> LF (IntegrationTests/Program.cs) - Trailing whitespace on blank lines (Common, Api, DataAccess, IntegrationTests, Services.RegionProcessing, Services.TileDownloader) - Final newline added (RoutePoint.cs, GeoPoint.cs, others) After this commit `dotnet format whitespace SatelliteProvider.sln --verify-no-changes` exits 0; AC-1 is enforceable from `scripts/ run-tests.sh` going forward. Also lands the batch 22 report, code-review report (PASS_WITH_WARNINGS, 2 Low findings — both deferred per spec), dependency-table status update (AZ-372 -> Done (In Testing)), task archive (todo/ -> done/), and autodev state update. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -24,7 +24,7 @@ public class RegionService : IRegionService
|
||||
private readonly ILogger<RegionService> _logger;
|
||||
|
||||
public RegionService(
|
||||
IRegionRepository regionRepository,
|
||||
IRegionRepository regionRepository,
|
||||
IRegionRequestQueue queue,
|
||||
ITileService tileService,
|
||||
IOptions<StorageConfig> storageConfig,
|
||||
@@ -117,11 +117,11 @@ public class RegionService : IRegionService
|
||||
try
|
||||
{
|
||||
var processingStartTime = DateTime.UtcNow;
|
||||
|
||||
|
||||
var tilesBeforeDownload = await _tileService.GetTilesByRegionAsync(
|
||||
region.Latitude,
|
||||
region.Longitude,
|
||||
region.SizeMeters,
|
||||
region.Latitude,
|
||||
region.Longitude,
|
||||
region.SizeMeters,
|
||||
region.ZoomLevel);
|
||||
var existingTileIds = new HashSet<Guid>(tilesBeforeDownload.Select(t => t.Id));
|
||||
|
||||
@@ -143,13 +143,13 @@ public class RegionService : IRegionService
|
||||
string? stitchedImagePath = null;
|
||||
|
||||
await GenerateCsvFileAsync(csvPath, tiles, linkedCts.Token);
|
||||
|
||||
|
||||
if (region.StitchTiles)
|
||||
{
|
||||
stitchedImagePath = Path.Combine(readyDir, $"region_{id}_stitched.jpg");
|
||||
await StitchTilesAsync(tiles, region.Latitude, region.Longitude, region.ZoomLevel, stitchedImagePath, linkedCts.Token);
|
||||
}
|
||||
|
||||
|
||||
await GenerateSummaryFileAsync(summaryPath, id, region, tiles, tilesDownloaded, tilesReused, stitchedImagePath, processingStartTime, linkedCts.Token, errorMessage);
|
||||
|
||||
region.Status = RegionStatus.Completed;
|
||||
@@ -175,8 +175,8 @@ public class RegionService : IRegionService
|
||||
}
|
||||
|
||||
private async Task HandleProcessingFailureAsync(
|
||||
Guid id,
|
||||
RegionEntity region,
|
||||
Guid id,
|
||||
RegionEntity region,
|
||||
DateTime startTime,
|
||||
List<TileMetadata>? tiles,
|
||||
int tilesDownloaded,
|
||||
@@ -185,7 +185,7 @@ public class RegionService : IRegionService
|
||||
{
|
||||
region.Status = RegionStatus.Failed;
|
||||
region.UpdatedAt = DateTime.UtcNow;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var readyDir = _storageConfig.ReadyDirectory;
|
||||
@@ -195,14 +195,14 @@ public class RegionService : IRegionService
|
||||
region.SummaryFilePath = summaryPath;
|
||||
|
||||
await GenerateSummaryFileAsync(
|
||||
summaryPath,
|
||||
id,
|
||||
region,
|
||||
tiles ?? new List<TileMetadata>(),
|
||||
tilesDownloaded,
|
||||
tilesReused,
|
||||
summaryPath,
|
||||
id,
|
||||
region,
|
||||
tiles ?? new List<TileMetadata>(),
|
||||
tilesDownloaded,
|
||||
tilesReused,
|
||||
null,
|
||||
startTime,
|
||||
startTime,
|
||||
CancellationToken.None,
|
||||
errorMessage);
|
||||
}
|
||||
@@ -215,9 +215,9 @@ public class RegionService : IRegionService
|
||||
}
|
||||
|
||||
private async Task<string> StitchTilesAsync(
|
||||
List<TileMetadata> tiles,
|
||||
double centerLatitude,
|
||||
double centerLongitude,
|
||||
List<TileMetadata> tiles,
|
||||
double centerLatitude,
|
||||
double centerLongitude,
|
||||
int zoomLevel,
|
||||
string outputPath,
|
||||
CancellationToken cancellationToken)
|
||||
@@ -291,8 +291,8 @@ public class RegionService : IRegionService
|
||||
}
|
||||
|
||||
private async Task GenerateSummaryFileAsync(
|
||||
string filePath,
|
||||
Guid regionId,
|
||||
string filePath,
|
||||
Guid regionId,
|
||||
RegionEntity region,
|
||||
List<TileMetadata> tiles,
|
||||
int tilesDownloaded,
|
||||
@@ -314,21 +314,21 @@ public class RegionService : IRegionService
|
||||
summary.AppendLine($"Zoom Level: {region.ZoomLevel}");
|
||||
summary.AppendLine($"Status: {region.Status.ToString().ToLowerInvariant()}");
|
||||
summary.AppendLine();
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(errorMessage))
|
||||
{
|
||||
summary.AppendLine("ERROR:");
|
||||
summary.AppendLine(errorMessage);
|
||||
summary.AppendLine();
|
||||
}
|
||||
|
||||
|
||||
summary.AppendLine("Processing Statistics:");
|
||||
summary.AppendLine($"- Tiles Downloaded: {tilesDownloaded}");
|
||||
summary.AppendLine($"- Tiles Reused from Cache: {tilesReused}");
|
||||
summary.AppendLine($"- Total Tiles: {tiles.Count}");
|
||||
summary.AppendLine($"- Processing Time: {processingTime:F2} seconds");
|
||||
summary.AppendLine($"- Started: {startTime:yyyy-MM-dd HH:mm:ss} UTC");
|
||||
|
||||
|
||||
if (region.Status == RegionStatus.Completed)
|
||||
{
|
||||
summary.AppendLine($"- Completed: {endTime:yyyy-MM-dd HH:mm:ss} UTC");
|
||||
@@ -337,21 +337,21 @@ public class RegionService : IRegionService
|
||||
{
|
||||
summary.AppendLine($"- Failed: {endTime:yyyy-MM-dd HH:mm:ss} UTC");
|
||||
}
|
||||
|
||||
|
||||
summary.AppendLine();
|
||||
summary.AppendLine("Files Created:");
|
||||
|
||||
|
||||
if (tiles.Count > 0)
|
||||
{
|
||||
summary.AppendLine($"- CSV: {Path.GetFileName(filePath).Replace("_summary.txt", "_ready.csv")}");
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(stitchedImagePath))
|
||||
{
|
||||
summary.AppendLine($"- Stitched Image: {Path.GetFileName(stitchedImagePath)}");
|
||||
summary.AppendLine($"- Stitched Image Path: {stitchedImagePath}");
|
||||
}
|
||||
|
||||
|
||||
summary.AppendLine($"- Summary: {Path.GetFileName(filePath)}");
|
||||
|
||||
await File.WriteAllTextAsync(filePath, summary.ToString(), cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user