Skip to content

Commit 856378d

Browse files
author
azure-pipelines-bot
committed
Revert util.js empty hash handling - hash files should always exist in production
- Remove graceful handling of missing hash directories in util.js - Hash files are generated by build process and should always be present - Missing hash files indicate build failure, not normal operation - Update README to clarify hash files are required for production - Keep mock hash file creation instructions for testing only
1 parent 322295e commit 856378d

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

release/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ npm audit fix --force
3131
#### A. Test `fillReleaseNotesTemplate.js`
3232

3333
```bash
34-
# Create mock hash files (scripts expect these)
34+
# Create mock hash files for testing (required - scripts expect these to exist)
35+
# Note: In production builds, these are generated automatically by the build process
3536
mkdir -p ../_hashes/hash
3637
echo "abcd1234567890abcd1234567890abcd1234567890abcd1234567890abcd1234" > ../_hashes/hash/vsts-agent-win-x64-3.999.999.zip.sha256
3738
echo "efgh1234567890efgh1234567890efgh1234567890efgh1234567890efgh1234" > ../_hashes/hash/vsts-agent-osx-x64-3.999.999.tar.gz.sha256
@@ -131,8 +132,9 @@ if (dryrun) {
131132
Some scripts expect certain directories/files to exist:
132133

133134
```bash
134-
# For hash-related scripts
135+
# For hash-related scripts (REQUIRED - scripts will fail without these)
135136
mkdir -p ../_hashes/hash
137+
# Create mock hash files for testing as shown in fillReleaseNotesTemplate.js section
136138

137139
# For integration file generation
138140
mkdir -p ../_layout/integrations
@@ -165,8 +167,9 @@ After testing locally, verify the pipeline still works by running a test build.
165167
### Common Error Messages
166168

167169
1. **"ENOENT: no such file or directory, scandir"**
168-
- Missing `_hashes` directory
169-
- Solution: Create mock hash files as shown above
170+
- Missing `_hashes` directory or hash files
171+
- **For testing**: Create mock hash files as shown above
172+
- **For production**: Hash files should be generated by the build process - this indicates a build failure
170173

171174
2. **"got.get is not a function"**
172175
- Package API changed

release/util.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,7 @@ exports.fillAgentParameters = function(template, destination, version)
8989
*/
9090
exports.getHashes = function() {
9191
const hashesDirPath = path.join(__dirname, '..', '_hashes', 'hash');
92-
93-
// Check if hash directory exists
94-
if (!fs.existsSync(hashesDirPath)) {
95-
console.log(`Warning: Hash directory ${hashesDirPath} does not exist. Using empty hashes.`);
96-
return {};
97-
}
98-
99-
let hashFiles;
100-
try {
101-
hashFiles = fs.readdirSync(hashesDirPath);
102-
} catch (error) {
103-
console.log(`Warning: Could not read hash directory ${hashesDirPath}: ${error.message}. Using empty hashes.`);
104-
return {};
105-
}
92+
const hashFiles = fs.readdirSync(hashesDirPath);
10693

10794
const hashes = {};
10895
for (const hashFileName of hashFiles) {

0 commit comments

Comments
 (0)