Rudel
Features

Hooks

Rudel now treats its lifecycle hooks as a first-class extension contract. That means the important actions and filters are documented, grouped, and available programmatically instead of being an accidental side effect of implementation.

Inspect the catalog

From PHP:

use Rudel\Rudel;

$hooks = Rudel::hooks();

Or directly:

$hooks = \Rudel\HookCatalog::all();

Each entry includes the hook type and argument shape.

Main categories

The catalog covers:

  • environment create, update, destroy, promote, export, import, cleanup, push, and PR
  • app create, update, destroy, sandbox creation, backup, restore, deploy, rollback, and domain changes
  • recovery-point create, restore, and delete
  • automation cleanup, app backups, retention, and expiry reporting
  • failure hooks for the same lifecycle edges

Example: change deploy metadata

add_filter(
    'rudel_app_deploy_options',
    function ( array $options, \Rudel\Environment $app, \Rudel\Environment $sandbox ): array {
        if ( empty( $options['label'] ) ) {
            $options['label'] = 'Unlabeled deploy';
        }

        return $options;
    },
    10,
    3
);

Example: react to automation expiry output

add_action(
    'rudel_after_automation_expiring_environments',
    function ( array $result ): void {
        foreach ( $result['expiring'] as $environment ) {
            error_log( 'Expiring soon: ' . $environment['id'] );
        }
    }
);

Example: observe deploy failures

add_action(
    'rudel_app_deploy_failed',
    function ( array $context, \Throwable $error ): void {
        error_log( 'Deploy failed for app ' . $context['app']->id . ': ' . $error->getMessage() );
    },
    10,
    2
);

The important point is consistency: success hooks, failure hooks, and filters now live in one documented place, and Rudel::hooks() exposes that contract to code that wants to inspect it.

On this page