Skip to content

Commit

Permalink
Merge ../AST-Merging-Evaluation-branch-master into ben-main
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed May 15, 2024
2 parents c1b0289 + 8ba56e9 commit 785dd3c
Show file tree
Hide file tree
Showing 5,102 changed files with 81,128 additions and 83,362 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[user]
email = [email protected]
name = Example Example
46 changes: 46 additions & 0 deletions .github/workflows/check-reproducibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Reproducibility Check
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
maven: [ '3.9.2' ]
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17.0.7
- run: echo "JAVA17_HOME=$JAVA_HOME" >> $GITHUB_ENV
- run: java -version
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.12
auto-update-conda: true
mamba-version: "*"
channels: conda-forge,defaults
activate-environment: AST
environment-file: environment.yml
- name: Clean caches & workspace
run: make clean
- run: echo "LOGURU_COLORIZE=NO" >> $GITHUB_ENV
- name: Build
run: cd src/scripts/merge_tools/merging && ./gradlew -q shadowJar
- name: make check-merges-reproducibility
run: |
python3 src/python/replay_merge.py --merges_csv results/combined/result.csv -delete_workdir --idx 38-192
head -n 151 results/combined/result.csv > temp.csv && mv temp.csv results/combined/result.csv
make check-merges-reproducibility
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
9 changes: 5 additions & 4 deletions .github/workflows/check-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3.0.3
uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.8
python-version: 3.12
auto-update-conda: true
mamba-version: "*"
channels: conda-forge,defaults
activate-environment: AST
environment-file: environment.yml
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/push-plots-to-paper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Update Overleaf with Plots

on:
push:
branches:
- main

jobs:
update-overleaf:
runs-on: ubuntu-latest

steps:
- uses: GuillaumeFalourd/[email protected]
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Git Config and Credentials
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub CI/CD Bot"
- name: Create directory for Overleaf Repository
run: mkdir -p ../AST-Merging-Evaluation-Paper

- name: Clone Overleaf Repository
env:
OVERLEAF_GIT_REPO: ${{ secrets.OVERLEAF_GIT_REPO }}
run: |
git clone ${OVERLEAF_GIT_REPO} ../AST-Merging-Evaluation-Paper
- name: Run make command to copy plots
run: make copy-paper

- name: Commit and Push to Overleaf
run: |
cd ../AST-Merging-Evaluation-Paper
git add .
git diff --staged --exit-code || (git commit -m "Automated plot updates by GitHub CI/CD Bot" && git push origin master)
33 changes: 18 additions & 15 deletions .github/workflows/small-test.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,65 @@
name: Run Small test
name: Small test
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
maven: [ '3.9.2']
maven: [ '3.9.2' ]
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 8
- run: echo "JAVA8_HOME=$JAVA_HOME" >> $GITHUB_ENV
- run: java -version
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
- run: echo "JAVA11_HOME=$JAVA_HOME" >> $GITHUB_ENV
- run: java -version
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- run: echo "JAVA17_HOME=$JAVA_HOME" >> $GITHUB_ENV
- run: echo "${GITHUB_WORKSPACE}/src/scripts/merge_tools" >> $GITHUB_PATH
- run: java -version
- uses: actions/checkout@v4
- name: Set up Python 3.8
with:
submodules: 'true'
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3.0.3
uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.8
python-version: 3.12
auto-update-conda: true
mamba-version: "*"
channels: conda-forge,defaults
activate-environment: AST
environment-file: environment.yml
- name: Install PdfLaTeX
run: sudo apt update && sudo apt install texlive-latex-extra -y
- name: Install maven
uses: s4u/setup-maven-action@v1.8.0
uses: s4u/setup-maven-action@v1.12.0
with:
java-version: 17
maven-version: ${{ matrix.maven }}
- name: Clean caches & workspace
run: make clean
- name: Build Java programs
run: ./gradlew build
- name: Install killall
run: sudo apt update && sudo apt install psmisc -y
- run: echo "LOGURU_COLORIZE=NO" >> $GITHUB_ENV
- name: Run small test
run: |
git config --global user.email "[email protected]"
git config --global user.name "Example Example"
git config --global merge.customMerge.name "Always incorrect custom merge driver"
git config --global merge.customMerge.driver 'fake-merge-driver %O %A %B %L %P'
make small-test
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cache*.tar
cache.tar
output.txt
replay_logs/
my.secrets

output/
merge_repo/
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "src/scripts/merge_tools/merging"]
path = src/scripts/merge_tools/merging
url = https://github.com/plume-lib/merging.git
ignore = dirty
30 changes: 28 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ SH_SCRIPTS = $(shell grep --exclude-dir=build --exclude-dir=repos --exclude-di
BASH_SCRIPTS = $(shell grep --exclude-dir=build --exclude-dir=repos --exclude-dir=cache -r -l '^\#! \?\(/bin/\|/usr/bin/env \)bash' * | grep -v /.git/ | grep -v '~$$' | grep -v '\.tar$$' | grep -v gradlew)
PYTHON_FILES = $(shell find . -name '*.py' ! -path './repos/*' -not -path "./.workdir/*" -not -path "./cache*/*" | grep -v '/__pycache__/' | grep -v '/.git/' | grep -v gradlew)

CSV_RESULTS_COMBINED = results/combined/result.csv
CSV_RESULTS_GREATEST_HITS = results/greatest_hits/result.csv
CSV_RESULTS_REAPER = results/reaper/result.csv
CSV_RESULTS = $(CSV_RESULTS_COMBINED)

NUM_PROCESSES = 0

shell-script-style:
shellcheck -e SC2153 -x -P SCRIPTDIR --format=gcc ${SH_SCRIPTS} ${BASH_SCRIPTS}
checkbashisms ${SH_SCRIPTS}
Expand All @@ -25,7 +32,7 @@ check-python-style:

# This target deletes files that are not committed to version control.
clean:
rm -rf .workdir
${MAKE} clean-workdir
rm -rf repos
rm -rf scratch
rm -rf results/small
Expand All @@ -38,6 +45,7 @@ clean-cache:
# This target deletes files in the test cache.
clean-test-cache:
rm -rf cache-small
rm -f cache-small.tar

# This target deletes files that are committed to version control.
clean-stored-hashes:
Expand Down Expand Up @@ -90,25 +98,43 @@ small-test:
./run_small.sh --include_trivial_merges --no_timing
${MAKE} small-test-diff

small-test-without-cleaning:
${MAKE} clean-test-cache
./run_small.sh --include_trivial_merges --no_timing
${MAKE} small-test-diff

update-figures:
./run_combined.sh -op
./run_greatest_hits.sh -op
./run_reaper.sh -op

run-all:
${MAKE} clean-workdir
${MAKE} small-test-without-cleaning
./run_combined.sh
./run_greatest_hits.sh
./run_reaper.sh


small-test-diff:
python3 test/check_equal_csv.py --actual_folder results/small/ --goal_folder test/small-goal-files/
@echo

gradle-assemble:
./gradlew -q assemble -g ../.gradle/

clean-workdir:
if [ -d .workdir ]; then chmod -R u+w .workdir; fi
rm -rf .workdir

clean-local:
rm -rf repos .workdir
${MAKE} clean-workdir
rm -rf repos

check-merges-reproducibility:
@echo "Running replay_merge for each idx in parallel using GNU Parallel..."
@set -e; \
tail -n +2 $(CSV_RESULTS) | awk -F, '{print $$1}' | parallel --halt now,fail=1 -j 50% python3 src/python/replay_merge.py --merges_csv $(CSV_RESULTS) -skip_build -delete_workdir --idx {}

protect-repos:
find repos -mindepth 1 -type d -exec chmod a-w {} +
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,11 @@ To run style checking run `make style`.
* results/small/ -> Contains all the results for the small analysis.

* jars/ -> Location for the IntelliMerge and Spork jars.


## Comparing merge algorithms

To investigate differences between two mergers:
* edit file `src/python/select_from_results.py` to reflect the differences you are interested in.
* run `src/python/select_from_results.py` to create a .csv database containing only the differences.
* run `src/python/replay_merge.py --merges_csv CSV_FILE --idx INDEX` (maybe add `-test`) for the index of the merge you are interested in.
23 changes: 11 additions & 12 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ dependencies:
- wheel
- xz
- zlib
- python=3.8
- python=3.12
- pip:
- fasteners==0.18
- matplotlib==3.6.3
- numpy==1.23.5
- pandas==2.0.2
- pylint==2.17.5
- GitPython==3.1.31
- prettytable==3.8.0
- seaborn==0.12.2
- fasteners==0.19
- matplotlib==3.8.4
- numpy==1.26.4
- pandas==2.2.2
- pylint==3.1.0
- GitPython==3.1.43
- prettytable==3.10.0
- seaborn==0.13.2
- rich==13.7.1
- black==23.3.0
- psutil==5.9.5
- black==24.4.2
- psutil==5.9.8
- termplotlib==0.3.9
- timeout-decorator==0.5.0
- loguru==0.7.2
28 changes: 28 additions & 0 deletions gitmerge_ort_imports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_imports.sh <clone_dir> <branch-1> <branch-2>

clone_dir=$1
branch1=$2
branch2=$3

export JAVA_HOME="$JAVA17_HOME"

cd "$clone_dir" || exit 1

git checkout "$branch1" --force

attributes_file=".git/info/attributes"
echo "*.java merge=merge-java" >> "$attributes_file"
git config --local merge.merge-java.name "Merge Java files"
git config --local merge.merge-java.driver 'java-merge-driver.sh "%A" "%O" "%B"'

git merge --no-edit "$branch2"
retVal=$?

# report conflicts
if [ "$retVal" -ne 0 ]; then
echo "Conflict"
fi

exit "$retVal"
4 changes: 2 additions & 2 deletions results/combined/all_repos_head_test_results.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12263,7 +12263,7 @@ idx,repository,head hash,head tree fingerprint,head test result
13017,guuuo/dubai,209abb098265c4ef19711d68617e16b7350f6a18,3092a210e730e4aa3236a71eb018ab3d5841d906851b4c0ad1e90dcb98339ff9,Tests_passed
13018,soarcn/coco-accessory,4abba9f09c4055ead412c86bd25e4404565dd5d4,d97031b0d82b873ff02eea9e8194b5244d61f89514624705cd931ee25d049f86,Tests_failed
13019,hoverruan/sae-spring-template,8e81017cc6b6e32ff8dbe15a34bcb8f9bf5aaa84,1cfd1d9c42e5fb43d658194421a3154882d1ef8b1f11ea1d02d49fb63f60b978,Tests_passed
13020,sonarcommunity/sonar-web,aee1b2c066bad507918b662973c602a728ef9491,ebf71ae6f83b183f55f268ddc48c16ecd0904dca02873b3543cb6348d1dde5fc,Tests_passed
13020,sonarcommunity/sonar-web,aee1b2c066bad507918b662973c602a728ef9491,f7934ed60c94334bfca1398c09f6580d902a1732ee362810a37410b1196579c7,Tests_passed
13021,slimroms/apktool,c1ab20ee4b03364d5120d7e71cf02dba346bfcd5,34128662c0608d553f6829488e38d8a822b2eee9df6da4770b507cb6bbc6aff1,Tests_failed
13022,ahiraz/pushnotificationdemo,2714e0c135608914dca0a3b07f2364eb580ee4ba,d55b62dc5e771438d67fbab71b624de7c573cf7a5918470ec3e40474a969cb0b,Tests_failed
13023,melin/dubbo-rpc-swift,32673ba8cf1c733a6b6672f345382e95809e73fb,44c8dbed2417e90c89907fe654cdc7d060e331fdf0426c491e1b70ae772e4b91,Tests_passed
Expand Down Expand Up @@ -15965,7 +15965,7 @@ idx,repository,head hash,head tree fingerprint,head test result
16925,chrislongo/download-hls,243722ecf156881c8cf42d6eb9fe8459bb6f5c55,89a624c18459772025110f492c3d5f631877d17ca27122c431d518d8c671b24c,Tests_passed
16926,carbonfive/hellod,01423b6118177dcc7a44388543775369780da6e7,4deb0d911c36a7b75bf44cfc893b96734450bb0fc29a3cb5972a08b7f93d41cc,Tests_failed
16927,shipilev/java-object-layout,d4b41c8a8bcb897aee3ae3ca91410738c4a2ef3d,a6e0064545d231464c0a688cf1a06a4987460ad5e6a211d65c445565723a75d7,Tests_failed
16928,deegree/deegree3,3088ebfab9e27898aa80577d27a9ca8b51ce5fbc,8e5119315831dda2ce955a960abb450132de37d9df0a7ed3305eb5b03063e952,Tests_passed
16928,deegree/deegree3,3088ebfab9e27898aa80577d27a9ca8b51ce5fbc,f28128951414277a486e5a3fc556b6d9677e76e6515bc5479fd060c6d6e0a4d6,Tests_failed
16929,sethm/symon,ecd4bbbd9a448f4f546eef9648149700b93c91ec,a1d3eeda91c9902d4a63a9d16ae5ad2317dc3e3dd418f8e764345aa1e9e38601,Tests_passed
16930,yannis666/coherence-jsr-107,b6d95fe625ad6369f7733be82092ecb4affe0102,b51a16742cb3ea0ce04992157aa2e6f6deeedfb1ccd84bbe84c367526cd20a82,Tests_failed
16931,geonode/geoserver-geonode-ext,c553cbf6d702e82f1febb8911b280fa7e1307c5a,d56d71dd8f0d4007db31c8d5960a14f68137809146773ebc49c16b0f9731ddb1,Tests_failed
Expand Down
Loading

0 comments on commit 785dd3c

Please sign in to comment.