Skip to content

Commit 73fd82f

Browse files
authored
fix(scaling-dive): use sed-append for scalingDiveMetrics (settings.json is JSONC) (#101)
1 parent 9f224f7 commit 73fd82f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/scaling-dive.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ jobs:
100100
' settings.json.template > settings.json
101101
102102
# Enable the scaling-dive metrics added in ether/etherpad#7762.
103-
# The key isn't in settings.json.template yet (defaults to false in
104-
# Settings.ts), so we inject it. Use node so JSON manipulation
105-
# stays valid regardless of key ordering / whitespace.
106-
node -e "const fs=require('fs'); const s=JSON.parse(fs.readFileSync('settings.json','utf8')); s.scalingDiveMetrics=true; fs.writeFileSync('settings.json', JSON.stringify(s, null, 2));"
107-
echo 'enabled: scalingDiveMetrics = true'
103+
# settings.json.template doesn't ship the key yet (defaults to false
104+
# in Settings.ts), so we sed-append it after the loadTest line.
105+
# Can't use JSON.parse because the file keeps its JSONC comments.
106+
sed -i '/"loadTest": true,/a\ "scalingDiveMetrics": true,' settings.json
107+
grep scalingDiveMetrics settings.json || { echo "failed to enable scalingDiveMetrics"; exit 1; }
108108
109109
case "${{ matrix.lever }}" in
110110
baseline)

0 commit comments

Comments
 (0)