Block Inclusion and Exclusion in App Deployments

This guide demonstrates how to selectively include and exclude blocks when creating or updating app deployments. This feature provides greater flexibility in managing block compositions without modifying the original app spec.

Overview

Previously, when creating an app deployment, all blocks defined in the app spec were automatically included. The new block inclusion/exclusion feature allows you to:

  • Exclude specific blocks that are part of the app spec

  • Include additional blocks that are not part of the app spec

  • If you do not specify the releaseVersion in the inclusion or exclusion configuration, the latest releaseVersion will automatically be considered

  • Control block versions during deployment

Using Block Inclusion/Exclusion

1. Creating a New App Deployment

When creating a new app deployment, you can specify which blocks to include or exclude using the includes and excludes arrays in the spec section:

{
    "metadata": {
        "name": "example-app",
        "title": "Example App Deployment",
        "description": "Demonstrating block inclusion/exclusion"
    },
    "spec": {
        "id": "app-spec-id",
        "release": {
            "version": "1.0.0"
        },
        "includes": [
            {
                "id": "block-123",
                "releaseVersion": "1.0.0"
            },
            {
                "id": "block-456",
                "releaseVersion": "2.0.0"
            }
        ],
        "excludes": [
            {
                "id": "block-789",
                "releaseVersion": "2.0.0"
            }
        ]
    }
}

2. Creating a New Revision

When creating a new revision, you can modify the block configuration using the blocksConfig section:

{
    "release": {
        "version": "1.0.0"
    },
    "revision": {
        "notes": "Updated block configuration"
    },
    "blocksConfig": {
        "includes": [
            {
                "id": "block-123",
                "releaseVersion": "1.0.0"
            }
        ],
        "excludes": [
            {
                "id": "block-789",
                "releaseVersion": "2.0.0"
            }
        ]
    }
}

Block Configuration Rules

Include Rules

  • Each included block requires:

    • id: (Required) The block spec ID

    • releaseVersion: (Optional) Specific version to use

  • If releaseVersion is omitted, the latest available version is used

Exclude Rules

  • Each excluded block requires:

    • id: The block spec ID to exclude

    • releaseVersion: (Optional) Specific version to exclude

  • If releaseVersion is omitted, the latest available version is used

Parameter Handling

The system validates parameters for both included and excluded blocks:

{
    "appParameters": {
        "build": {
            "storage": "20Mb",
            "instance_type": 22
        }
    },
    "parameters": {
        "block-spec-name-a": {
            "build": {
                "storage": "10Mb",
                "instance_type": 21
            },
            "run": {
                "agg_type": "AVG"
            }
        }
    }
}
  • Parameters for excluded blocks are ignored

  • Parameters for included blocks must be valid

  • App-level parameters must be valid for at least one included block

Example Use Cases

  1. Testing New Block Versions

{
    "includes": [
        {
            "id": "block-123",
            "releaseVersion": "2.0.0" // Testing new version
        }
    ]
}
  1. Temporarily Excluding Problematic Blocks

{
    "excludes": [
        {
            "id": "block-789", // Excluding problematic block
            "releaseVersion": "2.0.0"
        }
    ]
}
  1. Custom Block Combinations

{
    "includes": [
        {
            "id": "block-123",
            "releaseVersion": "1.0.0"
        },
        {
            "id": "block-456",
            "releaseVersion": "2.0.0"
        }
    ],
    "excludes": [
        {
            "id": "block-789",
            "releaseVersion": "2.0.0"
        }
    ]
}