Skip to content

Commit 1cba2b0

Browse files
Copilotmrjf
andauthored
Address code review feedback: improve path escaping, date parsing, and add inline comments for unicode escapes
Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/639174de-6b45-471f-878b-05ffaca3cdfa Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
1 parent e5e395b commit 1cba2b0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def _load_workflow_functions():
5656
def _call_js(func_name, *args):
5757
"""Call a JS function from the extracted workflow module and return the result."""
5858
args_json = json.dumps(list(args))
59-
escaped_path = _JS_MODULE_PATH.replace("\\", "\\\\")
59+
escaped_path = json.dumps(_JS_MODULE_PATH)
6060
script = (
61-
"const m = require('" + escaped_path + "');\n"
61+
"const m = require(" + escaped_path + ");\n"
6262
"const result = m." + func_name + "(..." + args_json + ");\n"
6363
"process.stdout.write(JSON.stringify(result === undefined ? null : result));\n"
6464
)

workflows/autoloop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ steps:
117117
const rawVal = row[2].trim();
118118
if (['field', '---', ':---', ':---:', '---:'].includes(rawKey.toLowerCase())) continue;
119119
const key = rawKey.toLowerCase().replace(/ /g, '_');
120-
const val = ['\u2014', '-', ''].includes(rawVal) ? null : rawVal;
120+
const val = ['\u2014', '-', ''].includes(rawVal) ? null : rawVal; // \u2014 = em dash
121121
state[key] = val;
122122
}
123123
// Coerce types
@@ -391,7 +391,7 @@ steps:
391391
const lr = state.last_run || null;
392392
if (lr) {
393393
try {
394-
const d = new Date(lr.endsWith('Z') ? lr : lr.replace('Z', '+00:00'));
394+
const d = new Date(lr);
395395
if (!isNaN(d.getTime())) lastRun = d;
396396
} catch (e) {
397397
// ignore invalid date

workflows/sync-branches.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ steps:
9999
git('checkout', defaultBranch);
100100
101101
if (failed.length > 0) {
102-
console.log('\n\u26a0\ufe0f Failed to sync ' + failed.length + ' branch(es): ' + JSON.stringify(failed));
102+
console.log('\n\u26a0\ufe0f Failed to sync ' + failed.length + " branch(es): " + JSON.stringify(failed)); // \u26a0\ufe0f = warning sign
103103
console.log('These branches may need manual conflict resolution.');
104104
// Don't fail the workflow -- log the issue but continue
105105
} else {
106-
console.log('\n\u2705 All ' + branches.length + ' branch(es) synced successfully.');
106+
console.log('\n\u2705 All ' + branches.length + " branch(es) synced successfully."); // \u2705 = checkmark
107107
}
108108
JSEOF
109109
---

0 commit comments

Comments
 (0)