Include pages with images in the CLI push/pull commands
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3578452. --> Reported by: [effulgentsia](https://www.drupal.org/user/78040) Related to !883 >>> <h3 id="overview">Overview</h3> <p>In <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3573996" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3573996</a></span>, we added conversion between how Drupal stores a component tree and the <a href="https://json-render.dev/">json-render</a> format for local development, including AI-assisted development. The json-render format works with <code>props</code> (i.e., <code>inputs_resolved</code> from <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3577654" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3577654</a></span>), but we also need to work with <code>inputs</code> itself. For example, for an image prop, <code>inputs</code> contains the media entity ID while <code>inputs_resolved</code> contains src, alt, width, and height. The latter is what you need for local development but when you want to push that back to the Drupal site, you need the former.</p> <h3 id="proposed-resolution">Proposed resolution</h3> <ul> <li>Within the json-render files, add another element property <code>_provenance</code> as a sibling to <code>props</code>. We can pick a different name for this, but I <em>think</em> "provenance" is the correct terminology for the concept we're trying to capture here, and the leading underscore is to indicate that this is a custom property not defined by the json-render schema. The provenance section would be for storing <code>inputs</code> for prop types where that's not trivially determinable from <code>props</code>.</li> <li>When running the CLI push command, check if any pages have elements with image props whose src value is an external URL. If so, abort the push command with an error indicating that image reconciliation needs to be run.</li> <li>Add a new CLI command to reconcile images, which would be to take all external image src values and create media entities from them using the API in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3578449" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3578449</a></span>. This command should then store the corresponding media entity ID in the element's <code>_provenance</code> section and update the <code>props</code> to the new <code>inputs_resolved</code> of the target media entity.</li> </ul> <h3 id="ui-changes">User interface changes</h3> > Related issue: [Issue #3575872](https://www.drupal.org/node/3575872)
issue