Skip to content

Workflow Manager

osa_tool.scheduler.workflow_manager

GitHubWorkflowManager

Bases: WorkflowManager

Workflow manager implementation for GitHub platform.

Uses .github/workflows directory for workflows storage and generation.

GitLabWorkflowManager

Bases: WorkflowManager

Workflow manager implementation for GitLab platform.

Uses .gitlab-ci.yml file at the repository root.

GitverseWorkflowManager

Bases: WorkflowManager

Workflow manager implementation for Gitverse platform.

Tries to use .gitverse/workflows directory for workflows, falling back to .github/workflows.

WorkflowManager

Bases: ABC

Abstract manager for CI/CD configurations handling different platforms (GitHub, GitLab, Gitverse).

Parameters:

Name Type Description Default
repo_url str

Repository URL.

required
metadata RepositoryMetadata

Metadata object of the repository.

required
args Any

Parsed arguments object containing CI/CD related settings.

required

Raises:

Type Description
NotImplementedError

If abstract methods are not implemented in subclasses.

apply_workflow_settings(config_manager, settings) staticmethod

Apply workflow settings directly from a dict, bypassing the legacy Plan. Used by the agentic pipeline.

Parameters:

Name Type Description Default
config_manager ConfigManager

Configuration manager to update.

required
settings dict

Dict of workflow settings keys and values.

required

build_actual_plan(sourcerank)

Build the workflow generation plan based on the initial plan, Python presence, existing jobs, and platform-specific logic.

Parameters:

Name Type Description Default
sourcerank SourceRank

Analyzer object to detect test presence.

required

Returns:

Type Description
dict

Dictionary representing the final workflow plan.

generate_workflow(config_manager)

Generate CI/CD files according to the updated configuration settings.

Parameters:

Name Type Description Default
config_manager ConfigManager

A unified configuration manager that provides task-specific LLM settings, repository information, and workflow preferences.

required
Note

Logs error on failure but does not raise.

has_python_code()

Checks whether the repository contains Python code.

First checks the repository metadata language field. If that is absent or does not mention Python, falls back to counting .py files on disk.

Returns:

Type Description
bool

True if Python code is present, False otherwise.

update_workflow_config(config_manager, plan)

Update workflow configuration settings in the config loader based on the given plan.

Parameters:

Name Type Description Default
config_manager ConfigManager

A unified configuration manager that provides task-specific LLM settings, repository information, and workflow preferences.

required
plan Plan

Final workflow plan.

required