Skip to main content

A tool that builds bug-fix benchmarks by leveraging GitHub Actions.

Project description

GitBug-Actions

GitBug-Actions is a tool that builds bug-fix benchmarks by leveraging GitHub Actions. The tool mines GitHub repositories and navigates through their commits, locally executing GitHub Actions using act in each commit considered. Finally, the tool checks if a bug-fix pattern was found by looking at the test results parsed from the GitHub Actions runs. If a bug-fix is found, GitBug-Actions is able to export a Docker image with the reproducible environment for the bug-fix. The reproducible environment will preserve all the dependencies required to run the tests for the bug-fix, avoiding the degradation of the benchmark due to dependencies that become unavailable.

Requirements

Act

It is required to have act installed and functional. At the moment, GitBug-Actions only works correctly with the modified version of act available here. Other versions will work but some issues may arise.

To install this version:

git clone https://github.com/gitbugactions/act
cd act
make build

A binary file dist/local/act will be created. This binary file should be made available in the $PATH of the system:

export PATH="<REPLACE_WITH_PATH_TO_ACT>:$PATH"

Python dependencies

GitBug-Actions runs on Python3.10 and above.

Ensure Poetry is installed.

Then, to install the Python dependencies run:

poetry shell
poetry install

How to run

Ensure the commands are executed inside the Poetry shell:

poetry shell

Use the --help command to obtain the list of options required to run each script.

python collect_repos.py --help
python collect_bugs.py --help
python export_bugs.py --help
python filter_bugs.py --help

Overview of GitBug-Actions

The figure above provides an overview of the pipeline of GitBug-Actions.

The scripts above should be executed in the same order shown on the figure. collect_bugs will use the repositories found by collect_repos as input. export_bugs uses the bug-fixes found by collect_bugs as input. Finally, filter_bugs uses the bug-fixes found by collect_bugs and the containers exported by export_bugs as input. The output of filter_bugs is a file with a list of non-flaky bug-fixes able to be reproduced in the exported containers.

Tests

To run the tests:

pytest test -s

Practical Challenges

While developing GitBug-Actions, we found some challenges of running CI builds at a large scale. Here we enumerate these challenges and explain how we mitigate them and, in cases that was not possible, how the user should handle them.

Handling Commits without GitHub Actions

One challenge in collecting bug-fix commit pairs by reproducing GitHub Actions is that GitHub Actions were only released in late 2019. Moreover, albeit being the most popular as of 2023, its adoption was not immediate. As a result the majority of commits found on GitHub do not have any associated workflows.

To increase the number of supported commits by GitBug-Actions, it identifies the oldest locally reproducible GitHub Action for each project. Then, for commits not associated with GitHub Actions, GitBug-Actions uses these as an approximation of the intended configuration.

Disk Space Management

Build execution has the potential to exhaust available disk space. To mitigate this, we restrict each build's allocation to a maximum of 3GiB. This restriction is handled by our version of act. However, users are advised to check disk usage frequently and remove dangling docker containers/images in case they occur.

Concurrent File Access

CI builds may initiate concurrent file access operations, a situation that can escalate to the point of surpassing the user-level open-file limit set by Linux. This is exarcebated when running multiple builds in parallel. To overcome this, we recommend setting the open-file limit for your user profile to a higher threshold than the default.

To check the current limit for your user run ulimit -Sn.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitbugactions-1.0.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

gitbugactions-1.0.0-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file gitbugactions-1.0.0.tar.gz.

File metadata

  • Download URL: gitbugactions-1.0.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.1.11-76060111-generic

File hashes

Hashes for gitbugactions-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3db243fff5f0ed31b72db6d7f3c3ee58e76992dd0c81814acb9cd2871bf85a93
MD5 6ff01e6bfa8917637fb2a2854b07582b
BLAKE2b-256 9eb7b5f3cbdfcba7182259b1a5d632885b20f3f1d3a96d2d04493ffad3846658

See more details on using hashes here.

Provenance

File details

Details for the file gitbugactions-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gitbugactions-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.1.11-76060111-generic

File hashes

Hashes for gitbugactions-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab2f2ac26900905a3148ba305b9c05f6d23fc64deb6dc43e78f75d8a7e7b662f
MD5 9ffc5afef69ac918b390f0e3627c6ed1
BLAKE2b-256 abf44fc203807a2d0282a1080dde655ca7f45e52ca481010a1d9161aed11c06b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page