Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-9150

Generate Pipeline for Git Repo

XMLWordPrintable

    • Icon: Feature Feature
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • AI
    • False
    • Hide

      None

      Show
      None
    • False

      Goals

      Accelerate the onboarding of new projects into the delivery workflow by automatically analyzing their Git repositories to generate and propose a complete Tekton pipeline via an automated pull request, enabling DevOps engineers to be more effective and ensuring a standardized delivery process.

       

      Information Leverage previous efforts on automating the PipelineRun generation https://github.com/openshift-pipelines/tkn-autogenerate

      Background & Strategy

      Generating a valid and secure PipelineRun using a Large Language Model (LLM) requires substantial, high-quality context. Simply providing an LLM with a repository and asking for "a pipelinerun" is unreliable. This approach can lead to outputs that appear correct on the surface but may contain subtle bugs, security vulnerabilities, or non-idiomatic practices.

      This feature proposes a foundational, context-aware approach to AI-driven pipeline generation. The strategy is built on carefully managing the three core components of an LLM interaction to ensure high-quality, secure, and relevant results.

      1. Controlled Prompt Engineering

      The quality of the output is directly controlled by the quality of the prompt.

      • Initial Scope: The initial implementation will guide the LLM by providing "few-shot" examples of basic, well-structured PipelineRuns. This ensures the generated output adheres to a desired sequence of Steps and overall structure, preventing the model from making a "total guess."
      • Future Enhancement: This can be extended to allow customers to provide their own standardized pipeline templates. These templates would then be used as the few-shot examples, aligning the generated pipelines with their organization's internal best practices.

      2. Repository-Level Context (Non-trained Data)

      The LLM must be given the "what" to build for.

      • Initial Scope: The full content of the target repository will be provided as context to the model. The implementation must explicitly plan for handling repository variations and edge cases, such as empty projects, multi-module repositories, different programming languages, and the presence (or absence) of Dockerfiles or other build artifacts.

      3. Long-Term Context (Past Interactions)

      This represents the future goal of creating a truly intelligent system.

      • Future Enhancement: The long-term vision is for OCP (OpenShift Container Platform) to store contextual data across the entire SDLC. This data can be tapped into to refine the model over time, allowing it to learn from past interactions and understand what constitutes a "good" and "successful" pipeline within a specific user's environment.

      Strategic Rationale: AI Foundation for Pipeline as Code

      Pipeline as Code is a primary interface for customers using OSP (OpenShift Pipelines). This feature is strategically designed to be the "spinning wheel" that introduces infused AI directly into this critical workflow, rather than being a simple, "trivial" generator.

      It serves as the essential feature foundation for a more sophisticated, iterative authoring system.

      This approach allows us to:

      1. Build and Demo: Create a tangible, base version of the feature that can be demonstrated to customers and stakeholders.
      1. Iterate: Gather user feedback on the "basic" generated pipelines to improve the underlying logic and prompts.
      1. Enable the Next Logical Step: This feature provides the perfect starting point for Conversational Pipeline Authoring. A user can accept the initial, auto-generated PipelineRun and then use a conversational (chatbot) interface to iteratively refine, expand, and customize it to their specific needs.

      Requirements

      Requirements Notes IS MVP
      • Given a Git repository for an application that does not contain a .tekton/ directory.
      • When the automated "pipeline-generation" workflow is triggered against that repository, e.g. webhook subscription in the SCM.
      • Clone the specified repository.
      • Create a new, designated branch (e.g., feat/add-tekton-pipeline).
      • Analyze the repository's source code to detect its language and project structure (e.g., presence of a Dockerfile, package.json, or pom.xml).
      • Generate a complete Tekton PipelineRun definition within a .tekton/ directory, populated with standard tasks for building, testing, and security scanning (like buildah,  or language-specific linters) based on the analysis.
      • Automatically open a pull request (PR) against the repository's main branch, containing the generated pipeline and a descriptive title (e.g., "feat: Add Tekton CI/CD pipeline").
         

      Out of scope

      • Fine-Tuned LLM model
      • Provide domain-specific docs for a RAG (Retrieval Augmented Generation) system for pipeline analysis.
      • Future enhacements outlined in the Background & Strategy section

      Dependencies

      • OpenShift LightSpeed
      • OpenShift Webconsole UX Design.
      • Tekton MCP Server (if case OLS cannot produce high quality OSP Yaml snippets)

      Assumptions

      Customer Considerations

      • Pipelines-as-Code is used
      • LLM capable to produce OpenShift Pipelines YAML snippets
      • OpenShift LightSpeed enabled with a connection to a LLM

      Done Checklist

      • Requirements are met
      • Non-functional properties of the Feature have been validated (such as performance, resource, UX, security or privacy aspects)
      • User Journey automation is delivered
      • Support and SRE teams are provided with enough skills to support the feature in production environment

       

              Unassigned Unassigned
              rh-ee-csalinas Carlos Salinas Gancedo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: