@jonit-dev/night-watch-cli 1.7.67 → 1.7.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,6 +51,23 @@ PROJECT_RUNTIME_KEY=$(project_runtime_key "${PROJECT_DIR}")
51
51
  LOCK_FILE="/tmp/night-watch-${PROJECT_RUNTIME_KEY}.lock"
52
52
  SCRIPT_TYPE="executor"
53
53
 
54
+ emit_result() {
55
+ local status="${1:?status required}"
56
+ local details="${2:-}"
57
+ if [ "${RATE_LIMIT_FALLBACK_TRIGGERED:-0}" = "1" ]; then
58
+ if [ -n "${details}" ]; then
59
+ details="${details}|rate_limit_fallback=1"
60
+ else
61
+ details="rate_limit_fallback=1"
62
+ fi
63
+ fi
64
+ if [ -n "${details}" ]; then
65
+ echo "NIGHT_WATCH_RESULT:${status}|${details}"
66
+ else
67
+ echo "NIGHT_WATCH_RESULT:${status}"
68
+ fi
69
+ }
70
+
54
71
  # ── Global Job Queue Gate ────────────────────────────────────────────────────
55
72
  # Acquire global gate before per-project lock to serialize jobs across projects.
56
73
  # When gate is busy, enqueue the job and exit cleanly.
@@ -74,23 +91,6 @@ if [ "${NW_QUEUE_ENABLED:-0}" = "1" ]; then
74
91
  fi
75
92
  # ──────────────────────────────────────────────────────────────────────────────
76
93
 
77
- emit_result() {
78
- local status="${1:?status required}"
79
- local details="${2:-}"
80
- if [ "${RATE_LIMIT_FALLBACK_TRIGGERED:-0}" = "1" ]; then
81
- if [ -n "${details}" ]; then
82
- details="${details}|rate_limit_fallback=1"
83
- else
84
- details="rate_limit_fallback=1"
85
- fi
86
- fi
87
- if [ -n "${details}" ]; then
88
- echo "NIGHT_WATCH_RESULT:${status}|${details}"
89
- else
90
- echo "NIGHT_WATCH_RESULT:${status}"
91
- fi
92
- }
93
-
94
94
  # Validate provider
95
95
  if ! validate_provider "${PROVIDER_CMD}"; then
96
96
  echo "ERROR: Unknown provider: ${PROVIDER_CMD}" >&2
@@ -80,6 +80,20 @@ fi
80
80
  # Acquire global gate before per-project lock to serialize jobs across projects.
81
81
  # When gate is busy, enqueue the job and exit cleanly.
82
82
  SCRIPT_TYPE="reviewer"
83
+
84
+ emit_result() {
85
+ local status="${1:?status required}"
86
+ local details="${2:-}"
87
+ if [ -n "${details}" ]; then
88
+ echo "NIGHT_WATCH_RESULT:${status}|${details}"
89
+ else
90
+ echo "NIGHT_WATCH_RESULT:${status}"
91
+ fi
92
+ }
93
+
94
+ # ── Global Job Queue Gate ────────────────────────────────────────────────────
95
+ # Acquire global gate before per-project lock to serialize jobs across projects.
96
+ # When gate is busy, enqueue the job and exit cleanly.
83
97
  if [ "${NW_QUEUE_ENABLED:-0}" = "1" ]; then
84
98
  if [ "${NW_QUEUE_DISPATCHED:-0}" = "1" ]; then
85
99
  arm_global_queue_cleanup
@@ -100,16 +114,6 @@ if [ "${NW_QUEUE_ENABLED:-0}" = "1" ]; then
100
114
  fi
101
115
  # ──────────────────────────────────────────────────────────────────────────────
102
116
 
103
- emit_result() {
104
- local status="${1:?status required}"
105
- local details="${2:-}"
106
- if [ -n "${details}" ]; then
107
- echo "NIGHT_WATCH_RESULT:${status}|${details}"
108
- else
109
- echo "NIGHT_WATCH_RESULT:${status}"
110
- fi
111
- }
112
-
113
117
  emit_final_status() {
114
118
  local exit_code="${1:?exit code required}"
115
119
  local prs_csv="${2:-}"
@@ -46,6 +46,16 @@ PROJECT_RUNTIME_KEY=$(project_runtime_key "${PROJECT_DIR}")
46
46
  LOCK_FILE="/tmp/night-watch-qa-${PROJECT_RUNTIME_KEY}.lock"
47
47
  SCRIPT_TYPE="qa"
48
48
 
49
+ emit_result() {
50
+ local status="${1:?status required}"
51
+ local details="${2:-}"
52
+ if [ -n "${details}" ]; then
53
+ echo "NIGHT_WATCH_RESULT:${status}|${details}"
54
+ else
55
+ echo "NIGHT_WATCH_RESULT:${status}"
56
+ fi
57
+ }
58
+
49
59
  # ── Global Job Queue Gate ────────────────────────────────────────────────────
50
60
  # Acquire global gate before per-project lock to serialize jobs across projects.
51
61
  # When gate is busy, enqueue the job and exit cleanly.
@@ -68,15 +78,6 @@ if [ "${NW_QUEUE_ENABLED:-0}" = "1" ]; then
68
78
  fi
69
79
  fi
70
80
  # ──────────────────────────────────────────────────────────────────────────────
71
- emit_result() {
72
- local status="${1:?status required}"
73
- local details="${2:-}"
74
- if [ -n "${details}" ]; then
75
- echo "NIGHT_WATCH_RESULT:${status}|${details}"
76
- else
77
- echo "NIGHT_WATCH_RESULT:${status}"
78
- fi
79
- }
80
81
 
81
82
  decode_base64_value() {
82
83
  local value="${1:-}"