(data)
| 14804 | |
| 14805 | function ensureReleaseGateAcknowledged() { |
| 14806 | if (!releaseGateState.enabled) { |
| 14807 | return Promise.resolve(true); |
| 14808 | } |
| 14809 | |
| 14810 | if (releaseGatePendingPromise) { |
| 14811 | showReleaseGateModal(); |
| 14812 | return releaseGatePendingPromise; |
| 14813 | } |
| 14814 | |
| 14815 | releaseGatePendingPromise = new Promise(resolve => { |
| 14816 | releaseGateResolver = resolve; |
| 14817 | showReleaseGateModal(); |
| 14818 | }); |
| 14819 | return releaseGatePendingPromise; |
| 14820 | } |
| 14821 | |
| 14822 | function handleReleaseGateDecision(allowUpdate) { |
| 14823 | hideReleaseGateModal(); |
| 14824 | if (releaseGateResolver) { |
| 14825 | const resolver = releaseGateResolver; |
| 14826 | releaseGateResolver = null; |
| 14827 | releaseGatePendingPromise = null; |
| 14828 | resolver(Boolean(allowUpdate)); |
| 14829 | } |
| 14830 | } |
| 14831 | |
| 14832 | // The update card. Its one job when something goes wrong is to say what went |
| 14833 | // wrong: the backend classifies every git failure and returns a `code` plus a |
| 14834 | // `hint` sentence, and all of it is shown here rather than collapsing into |
| 14835 | // "Update failed. Fix issues and retry." |
| 14836 | function reportUpdateProblem(prefix, payload) { |
| 14837 | const message = (payload && (payload.error || payload.message)) || 'Unknown error'; |
| 14838 | addConsoleMessage(`${prefix}: ${message}`, 'error'); |
| 14839 | if (payload && payload.hint) { |
| 14840 | addConsoleMessage(payload.hint, 'warning'); |
| 14841 | } |
| 14842 | if (payload && Array.isArray(payload.warnings)) { |
| 14843 | payload.warnings.forEach(w => addConsoleMessage(w, 'warning')); |
| 14844 | } |
no test coverage detected