Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jfrog-fastci/fastci

Repository files navigation

FastCI

FastCI CLI in action

A drop-in agent for GitHub Actions that automatically identifies CI bottlenecks and generates fixes. FastCI analyzes your workflows in real-time, flags performance issues as GitHub Issues, and can automatically create pull requests to resolve them.

Why FastCI?

CI maintenance is often neglected until it becomes a critical bottleneck. FastCI prevents technical debt accumulation by continuously monitoring and optimizing your CI pipeline, turning maintenance from reactive to proactive.


Installation

1. Install FastCI (CI Monitoring & Detection)

Option 1: Install FastCI with AI

Install with Cursor Install with GitHub Copilot

Option 2: View manual installation instructions

IMPORTANT: If you have a previous FastCI installation, ignore those instructions and use these updated steps.

Step 1: Add the configuration file

Create a fastci.config.json file in your repository root:

{
  "accept_terms": "yes"
}

Step 2: Add FastCI to your workflows

FastCI must be the very first step in each job - it should run before any other steps, including actions/checkout.

Required Permission: This workflow requires issues: write permission at the workflow level to create issues.

- uses: jfrog-fastci/fastci@v0

Complete Example

permissions:
  contents: read
  issues: write  # Required for FastCI

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: jfrog-fastci/fastci@v0
      - uses: actions/checkout@v4
      # ... rest of your build steps

Example with Container

If your job runs in a container, add the volume mount:

permissions:
  contents: read
  issues: write

jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: node:18
      volumes:
        - /home/runner:/tmp/fastci/mounts/home/runner
    steps:
      - uses: jfrog-fastci/fastci@v0
      - uses: actions/checkout@v4
      # ... rest of your build steps

2. Agentic Remediation (Automated Fixes)

Step 2.1: Add the FastCI Agent Workflow

Set up with Cursor Set up with GitHub Copilot

To automatically fix issues flagged by FastCI, create the following workflow file at .github/workflows/fastci-agent.yaml:

name: FastCI Agent ⚡

on:
  issues:
    types: [opened, reopened]

permissions:
  contents: write
  pull-requests: write
  issues: write

jobs:
  attempt-fix:
    if: contains(github.event.issue.labels.*.name, 'fastci-insight') || startsWith(github.event.issue.title, '[FastCI]')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup
        id: setup
        env:
          ISSUE_BODY: ${{ github.event.issue.body }}
          ISSUE_TITLE: ${{ github.event.issue.title }}
          ISSUE_NUMBER: ${{ github.event.issue.number }}
        run: |
          curl https://cursor.com/install -fsS | bash
          echo "$HOME/.cursor/bin" >> $GITHUB_PATH
          git config user.name "Cursor Agent"
          git config user.email "[email protected]"
          
          # Extract AI prompt from "For AI Agents" section or use full body
          AI_PROMPT=$(echo "$ISSUE_BODY" | sed -n '/## For AI Agents/,/```$/p' | sed -n '/```/,/```/p' | sed '1d;$d')
          [ -z "$AI_PROMPT" ] && AI_PROMPT="$ISSUE_BODY"
          echo "$AI_PROMPT" > /tmp/ai_prompt.txt
          
          # Generate branch name
          CLEAN_TITLE=$(echo "$ISSUE_TITLE" | sed 's/^\[FastCI\] //' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-' | cut -c1-40)
          echo "branch=${ISSUE_NUMBER}-bugfix/${CLEAN_TITLE}" >> $GITHUB_OUTPUT

      - name: Fix FastCI insight
        env:
          CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
          GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
          BRANCH: ${{ steps.setup.outputs.branch }}
          ISSUE_NUM: ${{ github.event.issue.number }}
          REPO: ${{ github.repository }}
        run: |
          agent -p "Fix CI issue in $REPO. GitHub CLI (\`gh\`) is authenticated.

          Issue #$ISSUE_NUM: ${{ github.event.issue.title }}
          Task: $(cat /tmp/ai_prompt.txt)

          Steps:
          1. Create branch: $BRANCH
          2. Implement the fix with minimal, targeted changes
          3. Commit with message: 'Fix #$ISSUE_NUM: <description>'
          4. Push and create PR with body containing 'Fixes #$ISSUE_NUM'
          5. Comment on issue #$ISSUE_NUM with PR link

          If fix cannot be automated, comment on the issue explaining why.
          " --force --model composer-1 --output-format=text
Step 2.2: Configure the Required Secrets

For the FastCI Agent workflow to function, configure these secrets in your repository:

Secret Description
CURSOR_API_KEY API key for the Cursor AI agent
GH_ACCESS_TOKEN Personal Access Token with repo and issues permissions (needed for PR creation)

3. Beta Agreement & Requirements

Beta Agreement

FastCI is currently in beta. By using this action, you agree to the FastCI Beta Agreement. To use FastCI, non-JFrog organizations must explicitly accept the beta terms by setting "accept_terms": "yes" in fastci.config.json.

Requirements

  • Configuration: Add a fastci.config.json file to your repository root with "accept_terms": "yes"
  • Permissions: Ensure the issues: write permission is set at the workflow level
  • Beta Agreement: Accept the Beta Agreement via the config file (required for non-JFrog organizations)

How It Works

  1. FastCI analyzes your CI runs and identifies performance bottlenecks
  2. Issues are automatically created with the fastci-insight label or [FastCI] prefix
  3. The FastCI Agent workflow triggers on new issues matching these criteria
  4. An AI agent implements the fix and creates a pull request
  5. Merging the PR auto-closes the issue via GitHub's linking feature

Quick Start Checklist

  • Add fastci.config.json to your repository root
  • Add the FastCI step to all jobs in your workflows
  • Create the fastci-agent.yaml workflow
  • Configure CURSOR_API_KEY and GH_ACCESS_TOKEN secrets
  • Run your CI pipeline and watch for FastCI insights!

Support

If you encounter any issues, please reach out to the FastCI team or file an issue in this repository.

About

A drop-in agent for GitHub Actions that automatically identifies CI bottlenecks and generates fixes. FastCI analyzes your workflows in real-time, flags performance issues as GitHub Issues, and can automatically create pull requests to resolve them.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors