Skip to content

Add extension options for specific workflow templates in the PTB #730

@ArBridgeman

Description

@ArBridgeman

Summary

Projects using the PTB workflow templates often try to extend the following workflows:

  • merge-gate.yml -> often additional 'slow' tests
  • checks.yml -> additional fast tests
  • cd.yml -> additional build objects that we do not want coupled with the existing ones

To accommodate these, the plan is to allow these PTB workflows to be extended:

  • slow-checks.yml
  • checks.yml
  • cd.yml

To do this, we would:

  1. Create a new Pydantic model which has individual fields for each of these workflow extensions to be turned on/off
  • An instance of this model, where all of them are turned off, will be provided as a default value as an attribute
    to the BaseConfig. This allows users to easily substitute it as needed.
  1. Add Jinja blocks in these workflow templates that if the extensions is enabled that the rendered template includes it. If it is not enabled, then the block will not be shown.

  2. Users would need to move additions to be called in these workflow extensions. The PTB would not check or maintain these. (Maybe in the future we would allow them to be templates themselves & render Jinja variables, but that's out of scope for this effort.)

Example

In the slow-checks.yml template, after the run-integration-tests job, we'd have something like:

{% if enabled_slow_checks_extension %}
    slow-checks-extension:
    name: Extend Slow Checks
    uses: ./.github/workflows/slow-checks-extension.yml
    permissions:
      contents: read
{% endif %}

Clarification

  • Do we want to hard-code the names of the workflow extensions or should users be able to override it?
  • Proposed names:
    • slow-checks-extension.yml
    • checks-extension.yml
    • cd-extension.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureProduct feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions