Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data-machine.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function () {
// Load and instantiate all handlers - they self-register via constructors
datamachine_load_handlers();
\DataMachine\Engine\Bundle\AuthRefHandlerConfig::register();
\DataMachine\Core\Database\BundleArtifacts\InstalledBundleArtifacts::register();

// Initialize FetchHandler to register skip_item tool for all fetch-type handlers
\DataMachine\Core\Steps\Fetch\Handlers\FetchHandler::init();
Expand Down
15 changes: 14 additions & 1 deletion inc/Cli/Commands/AgentBundleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,20 @@ public function upgrade( array $args, array $assoc_args ): void {
}

$owner_id = isset( $assoc_args['owner'] ) ? $this->resolve_user_id( $assoc_args['owner'] ) : 0;
$result = $this->bundler()->import( $bundle, '' !== $slug ? $slug : null, $owner_id, false, array( 'reconcile_runtime' => $reconcile_runtime ) );
$result = $this->bundler()->import(
$bundle,
'' !== $slug ? $slug : null,
$owner_id,
false,
array(
'reconcile_runtime' => $reconcile_runtime,
// Mark this as an upgrade so the importer treats an existing agent row as the upgrade
// target instead of returning "Agent slug already exists" when local pipelines/flows
// have been edited (#1801). Local-modified artifacts come back in `result.conflicts`
// and get staged as PendingActions below.
'is_upgrade' => true,
)
);
if ( empty( $result['success'] ) ) {
WP_CLI::error( (string) ( $result['error'] ?? 'Bundle upgrade failed.' ) );
return;
Expand Down
Loading
Loading