Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

fix: resolve diff file path before ending stream, add environment temp directory, and fix error when enabling diff package map #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ DISABLE_MANAGEMENT=false # Disable management routes
ENABLE_ACCOUNT_REGISTRATION=true # Enable account registration
UPLOAD_SIZE_LIMIT_MB=200 # Max file upload size (in MB)
ENABLE_PACKAGE_DIFFING=false # Enable generating diffs for releases
TMPDIR=./tmp # Temporary directory for server diff package generation

# ==============================
# Azure KeyVault Configuration (Optional)
Expand Down
2 changes: 1 addition & 1 deletion api/script/routes/management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ export function getManagementRouter(config: ManagementConfig): Router {
}

function processDiff(accountId: string, appId: string, deploymentId: string, appPackage: storageTypes.Package): q.Promise<void> {
if (!appPackage.manifestBlobUrl || process.env.ENABLE_PACKAGE_DIFFING) {
if (!appPackage.manifestBlobUrl || !process.env.ENABLE_PACKAGE_DIFFING) {
// No need to process diff because either:
// 1. The release just contains a single file.
// 2. Diffing disabled.
Expand Down
4 changes: 2 additions & 2 deletions api/script/utils/package-diffing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class PackageDiffer {
readStreamCounter--;
if (readStreamCounter === 0 && !readStreamError) {
// All read streams have completed successfully
resolve();
resolve(diffFilePath);
}
});

Expand All @@ -185,8 +185,8 @@ export class PackageDiffer {
if (readStreamError) {
reject(readStreamError);
} else {
resolve(diffFilePath);
diffFile.end();
resolve();
}
}
});
Expand Down