https://github.com/chains-project/bacardi

fix breaking dependency updates 🛠️

https://github.com/chains-project/bacardi

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 3 committers (66.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

fix breaking dependency updates 🛠️

Basic Info
  • Host: GitHub
  • Owner: chains-project
  • License: mit
  • Language: Java
  • Default Branch: main
  • Homepage:
  • Size: 78.5 MB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • Open Issues: 6
  • Releases: 0
Created almost 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

Bacardi: Fixing Breaking Dependency updates with Large Language Models

Fix breaking dependency updates

Tool Architecture Overview

Bacardi automates the repair of breaking dependency updates through a three-step pipeline: 1. Extract Failed Build Information 2. Use LLM to Generate Updated Code 3. Validate Updated Code

The following diagram and module breakdown illustrate how the components interact across the system.


Architectural Diagram

The diagram shows how build failures and API diffs flow through the system, how LLMs are invoked with prompt templates, and how fixes are validated in Docker builds.


Module Structure

Step 1 Extract Failed Build Information

  • git-manager:
    • Manages repositories and creates new branches for each failure category.
  • extractor:
    • Extracts contextual information from the clients repository and API diffs.
  • breaking-classifier:
    • Classifies dependency-related failures and parses build logs.

Step 2 Use LLM to Generate Updated Code

  • llm:

    • Connects to LLM providers (OpenAI, Google, Anthropic, OpenRouter), resolved from .env (LLM, LLM_TYPE).

    Example ```env LLM=openai LLM_TYPE=gpt-4o-mini

  • prompts:

    • Stores reusable prompt templates tailored to different failure scenarios.

Step 3 Validate Updated Code

  • docker-build:
    • Builds reproducible Docker environments to test and validate proposed fixes.
  • core:
    • Manage the full workflow, manages configurations, and outputs logs and results to results/.

Setup and Installation

To replicate the experiments, you need to set up the environment and build the project. Follow these steps:

  1. Clone the repository: bash git clone git@github.com:chains-project/bacardi.git cd bacardi
  2. Build the project: bash mvn clean install
  3. Setup environment variable: bash cp .env.example .env

Usage

Run the application using the following command: bash java -jar ./core/target/Bump.jar

To execute a single breaking dependency update:

BACARDI can target and fix one breaking dependency update at a time. Each case in the BUMP dataset is represented by a JSON record containing, among other fields, a breaking_commit hash. To repair just that one update:

  1. Open the .env file.
  2. Add/replace the line below, replacing <breaking_commit_hash> with the exact value from the datasets JSON entry: bash SPECIFIC_FILE=<breaking_commit_hash> You can find thebreakingcommithashin the corresponding [api-diff.txt`](results/api-diff.txt) file.

  3. Run the application using the following command: bash java -jar ./core/target/Bump.jar Only the specified commit will be processed.


LLM configuration and selection

Bacardi is designed to work flexibly with multiple Large Language Models (LLMs). It does not run on all LLMs by default.

How to Select an LLM

You can control which LLM is used via these environment variables in your .env file:

| Variable | Description | Example | |-----------------------------------------------------|--------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------| | LLM | Name of the model to use | gpt-4o-mini, gemini-2.0-flash-001, o3-mini-2025-01-31, deepseek-deepseek-chat, qwen-qwen2.5-32b-instruct | | LLM_TYPE | Type of inference provider | openai, openrouter, google, | | OPENROUTER_PROVIDER (optional) | If using OpenRouter, specify the provider | open-inference/bf16, chutes/fp8 | | API_KEY / GOOGLE_API_KEY / OPENROUTER_API_KEY | API keys for selected providers | your-api-key-here |

Bacardi currently supports these five models, each running with their respective inference providers:

  • gpt-4o-mini (OpenAI)
  • o3-mini-2025-01-31 (OpenAI)
  • gemini-2.0-flash-001 (Google)
  • deepseek-deepseek-chat (via OpenRouter)
  • qwen-qwen2.5-32b-instruct (via OpenRouter)

Important:

Bacardi does not automatically run on all models. You must configure the desired one before execution.

Only the configured LLM will be used when running the repair pipeline.


Results

The results of the experiments are stored in the results directory. Each experiment is organized into subdirectories, containing the following files: - results_<prompt_name>: Contains the results of the experiment for a specific prompt. - <model_n>: Contains the results for a specific model. results results_<prompt_name> each prompt results <model_n> model results ----- <model_n> model results


License

This project is licensed under the MIT License.


Thank you for using Bacardi! If you encounter any issues or have feedback, feel free to create an issue.

Owner

  • Name: CHAINS research project at KTH Royal Institute of Technology
  • Login: chains-project
  • Kind: organization

"Consistent Hardening and Analysis of Software Supply Chains" at KTH, funded by SSF

GitHub Events

Total
  • Delete event: 1
  • Push event: 13
  • Pull request event: 1
  • Fork event: 2
  • Create event: 1
Last Year
  • Delete event: 1
  • Push event: 13
  • Pull request event: 1
  • Fork event: 2
  • Create event: 1

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 236
  • Total Committers: 3
  • Avg Commits per committer: 78.667
  • Development Distribution Score (DDS): 0.186
Past Year
  • Commits: 236
  • Committers: 3
  • Avg Commits per committer: 78.667
  • Development Distribution Score (DDS): 0.186
Top Committers
Name Email Commits
Frank Reyes f****g@k****e 192
Leonard Husmann l****n@t****e 32
May Mahmoud 1****4 12
Committer Domains (Top 20 + Academic)
tum.de: 1 kth.se: 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 17
  • Total pull requests: 29
  • Average time to close issues: 12 days
  • Average time to close pull requests: about 9 hours
  • Total issue authors: 3
  • Total pull request authors: 3
  • Average comments per issue: 0.76
  • Average comments per pull request: 0.07
  • Merged pull requests: 28
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 17
  • Pull requests: 29
  • Average time to close issues: 12 days
  • Average time to close pull requests: about 9 hours
  • Issue authors: 3
  • Pull request authors: 3
  • Average comments per issue: 0.76
  • Average comments per pull request: 0.07
  • Merged pull requests: 28
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • maymahmoud84 (12)
  • leonardhusmann (2)
  • frankreyesgarcia (1)
Pull Request Authors
  • frankreyesgarcia (17)
  • maymahmoud84 (6)
  • leonardhusmann (3)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/test.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-java v3 composite
breaking-classifier/pom.xml maven
core/pom.xml maven
  • org.apache.maven:maven-api-impl 4.0.0-beta-4 compile
  • info.picocli:picocli-codegen 4.7.6
  • io.github.cdimascio:java-dotenv 5.2.2
  • se.kth:breaking-classifier 1.0-SNAPSHOT
  • se.kth:docker-build 1.0-SNAPSHOT
  • se.kth:extractor 1.0-SNAPSHOT
  • se.kth:git-manager 1.0-SNAPSHOT
docker-build/pom.xml maven
  • com.github.docker-java:docker-java 3.4.0
  • com.github.docker-java:docker-java-transport-okhttp 3.3.3
  • se.kth:breaking-classifier 1.0-SNAPSHOT
extractor/pom.xml maven
  • com.github.siom79.japicmp:japicmp 0.23.0
  • fr.inria.gforge.spoon:spoon-core 11.1.0
  • se.kth:breaking-classifier 1.0-SNAPSHOT
git-manager/pom.xml maven
  • org.eclipse.jgit:org.eclipse.jgit
pom.xml maven
  • ch.qos.logback:logback-classic 1.5.6
  • org.projectlombok:lombok 1.18.34
  • org.slf4j:slf4j-api 2.0.16
  • org.yaml:snakeyaml 2.0