Provide an endpoint to identify that a push is starting and has stopped
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3582709. --> Reported by: [mglaman](https://www.drupal.org/user/2416470) Related to !844 >>> <h3>Overview</h3> <p>The CLI push command sends components, styling, and other data to a Drupal site. Canvas already has a notification system that displays messages in the editor UI, including a <code>processing</code> type that is shown prominently until resolved.</p> <p>If the server knows when a push is starting and when it has finished (or failed), it can:</p> <ul> <li>Show a <em>processing</em> notification in the editor UI during the push</li> <li>Resolve it to <em>success</em> or <em>error</em> when the push completes</li> <li>Allow other systems to check whether a sync is currently in progress</li> </ul> <h3>Proposed resolution</h3> <p>Add three endpoints the CLI calls around the push lifecycle:</p> <ul> <li><code>POST /canvas/api/push/start</code> &mdash; signals a push has begun</li> <li><code>POST /canvas/api/push/complete</code> &mdash; signals a push finished successfully</li> <li><code>POST /canvas/api/push/fail</code> &mdash; signals a push failed; accepts an optional error message in the request body</li> </ul> <p>Each endpoint should:</p> <ul> <li>Create or resolve a notification (<code>processing</code> on start, <code>success</code>/<code>error</code> on complete/fail) using the existing notification system with a well-known key (e.g. <code>cli-push</code>). The existing <code>KEY_REPLACE_TYPES</code> logic will automatically replace the <em>processing</em> notification when complete/fail is called.</li> <li><del>Set or clear a syncing flag using the <strong>expirable key-value store</strong> (<code>KeyValueExpirableStoreInterface</code>, collection <code>canvas</code>, key <code>is_syncing</code>) with a 30-minute TTL matching the existing processing timeout. This lets other systems check <code>isCanvasSyncing()</code> without querying notifications, and self-heals automatically if a push is interrupted without calling complete/fail.</del></li> <li>Dispatch a <code>PushEvent</code> with a <code>PushStatus</code> enum value (<code>Started</code>, <code>Completed</code>, <code>Failed</code>) for extensibility.</li> </ul> <p>Update the CLI <code>push</code> command to call <code>/push/start</code> before step 1 and either <code>/push/complete</code> or <code>/push/fail</code> at the end depending on outcome. These calls should be best-effort &mdash; a failure to reach the endpoint should not abort the push itself.</p> <p>I removed the expirable key-value. I thought it'd be useful. Maybe. But it felt awkward in the code. The flag it set and then there's one awkwardly named service to expose it? I figure we can add it if end-users need it.</p>
issue