microsoft/rushstack

[rush] "deploy --create-archive" ignores "folderToCopy" in ^5.98.0

mikeharder opened this issue · 1 comments

Summary

Starting with version 5.98.0, the command rush deploy --create-archive ignores the folderToCopy specified in deploy.json.

If a deploy.json specifies folderToCopy, the content of the folder is correctly copied to common/deploy. However, the content of the folder is not added to the generated archive.

Repro steps

  1. Create a deploy.json with a folderToCopy.
  2. Set rushVersion to 5.97.1
  3. Run rush deploy --create-archive
  4. The contents of folderToCopy should be under common/deploy, and in the zipfile.
  5. Upgrade to rush@5.98.0.
  6. Re-run rush deploy --create-archive
  7. The contents of folderToCopy will be under common/deploy, but not in the zipfile.

Details

I believe the issue is here:

if (addditionalFolderToCopy) {
const sourceFolderPath: string = path.resolve(sourceRootFolder, addditionalFolderToCopy);
await FileSystem.copyFilesAsync({
sourcePath: sourceFolderPath,
destinationPath: targetRootFolder,
alreadyExistsBehavior: AlreadyExistsBehavior.Error
});
}

The folder is copied, but the files are not added to the ArchiveManager, so they are not added to the generated zipfile.

Files copied from projects (rather than from folderToCopy) are added to the ArchiveManager here:

if (archiver) {
const archivePath: string = path.relative(targetRootFolder, copyDestinationPath);
await archiver.addToArchiveAsync({
filePath: copySourcePath,
archivePath,
stats: copySourcePathNode.linkStats
});
}

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.102.0
rushVersion from rush.json? 5.98.0
useWorkspaces from rush.json? false
Operating system? Linux
Would you consider contributing a PR? No
Node.js version (node -v)? 16.20.2