CodeCargo logo

Core Concepts

Building Blocks

Building Blocks is a library of your approved templates, connected to your CodeCargo organization. These templates serve as golden paths - that is, they are approved by your organization as the "right way" to get things done. Building Blocks originate from GitHub repositories and are editable by anyone with the proper GitHub permissions.

Currently Building Blocks supports the following:

  • GitHub Actions Reusable Workflows

In the future, Building Blocks will also support:

  • GitHub Actions
  • Infrastructure-as-Code
  • GenAI Prompts

What are Building Blocks?

Building Blocks help you:

  • Organize your approved templates in a single location
  • Visualize, edit, and extend them using an AI-powered editor
  • Link them to Projects to provide standardized automations and application stacks to your users

Building Blocks View

The main Building Blocks interface is a table showing key metadata:

Columns:

  • Name – A user-friendly alias for the Building Block
  • Location – The full GitHub repo path to the workflow file
  • Linked Self-Service Workflows – The number of Self-Service Workflow referencing this Building Block
Workflow Catalog

Importing a Workflow as a Building Block

Click "Add Workflow" to open a side-panel input form.

FieldDescription
RepositoryChoose from any repo connected via GitHub App
VersionSelect a branch, commit SHA, or tag
PathFilepath to the .yaml workflow definition
DescriptionHuman-readable summary of what the workflow does
IconChoose an emoji or icon to represent the workflow visually

Reusable Workflow

Workflows must follow the GitHub Actions Reusable Workflow specification and the repository that the workflow is defined in must have appropriate permissions. If you do not have appropriate repository permissions set, you will still be able to import the workflow as a Building Block and create Self-Service Workflows; however, they will not execute properly.

Editing a Building Block

GitHub Actions Workflows that you import as Building Blocks are directly managed by GitHub. This means you can edit them in 3 places:

  1. CodeCargo's GenAI Workflow Editor
  2. GitHub
  3. Your IDE of choice

To edit a workflow in our platform using our GenAI editor, click on any workflow on the page.

Workflow Editor

The Workflow Editor has a few key features:

  • Visualizer --> visual representation of a GitHub Actions Workflow including triggers, jobs, steps, and configuration
  • Code Editor --> syntax-highlighted editor with schema awareness
  • Preview --> view / accept changes
  • Files --> change which file is present in the Code editor
Workflow Editor

Visualizer

  • Toggleable via a tab switcher at the top
  • Presents the workflow as a block-style job and step layout
  • Click into any job or step to view inputs, conditions, or outputs

The visual layout helps non-YAML-native developers and reviewers understand workflow logic and structure.

Matrix Job Visualization

The visualizer automatically expands matrix jobs to show individual job variants:

  • Static matrices are expanded based on the matrix configuration in your workflow YAML
  • Dynamic matrices (using expressions like ${{ fromJSON(inputs.targets) }}) display as strategy nodes with expansion indicators
  • Each expanded job shows its specific matrix values in the job name
  • Dependencies are automatically rewritten to connect to all expanded variants

Strategy Nodes

For workflows with matrix strategies that cannot be statically analyzed, the visualizer shows strategy nodes that indicate job expansion will occur at runtime. These nodes display:

  • The original job name
  • An indicator showing the job will expand into multiple variants
  • Connections to dependent jobs

Expert Workflow Agent

On the right side of the screen is a context-aware AI agent. This AI agent is fine-tuned to be an expert GitHub Actions Workflow agent and is generally capable of the following:

  • Understands the structure and intent of the workflow
  • Can generate or refactor YAML
  • Applies updates to both the code and visualizer in sync
  • Accepts plain language prompts like:
    • “Add a step to cache dependencies”
    • “Change the Node version to 20.x”
    • “Make this reusable for multiple services”
  • The Building Block and the GitHub repository it is stored in is loaded into context

Advanced AI Assistant Use-Cases

Since the AI assistant is fine-tuned to be an expert GitHub Actions Workflow agent, it provides powerful tooling that can do the following:

  1. Enhance the security of a workflow
  2. Improve the runtime, efficiency, or cost of running a workflow
  3. Change the core function of a workflow
  4. Convert an Azure DevOps, Jenkins, or other pipeline into a GitHub Actions Workflow
  5. Identify potential errors, security vulnerabilities, or issues that may impact a GitHub Actions Workflow
  6. Perform the following for multiple workflows defined in a single Git repository

Linking Building Blocks to Projects

Once added, catalog Building Blocks can be referenced within Projects. As an example, from within a Project, you can create a Self-Service Workflow (using one of your Building Blocks) to provide your users to trigger workflows on-demand. This encourages:

  • Reuse of CI/CD best practices
  • Standardization across teams
  • Easier updates and governance

Building Block Sources Permissions

Access to building block sources requires specific permissions:

Sources Tab Visibility

The Sources tab appears only when you have:

  • Permission to list building block sources (canListBuildingBlockSources)
  • AND permission to update either workflows (canUpdateBuildingBlockWorkflow) or actions (canUpdateBuildingBlockAction)

Without update permissions for workflows or actions, the Sources tab is hidden since managing building blocks requires the ability to modify them.

Source Management Actions

Each source in the sources list has dropdown actions with specific permission requirements:

ActionPermission RequiredDescription
Manage Building BlockscanGetView and configure building blocks from this source
Edit SourcecanUpdateModify source configuration and settings
Remove SourcecanDeleteDelete the source from your building blocks

If you don't have any of these permissions, the dropdown menu is hidden entirely.

Permission Hierarchy

To effectively use building block sources, you need both source listing permissions and workflow/action update permissions. This ensures users can only access sources they can meaningfully work with.

Previous
Actions Insights