Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo-reasoner functionality #413

Merged
merged 3 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ REPOS =
# Single repository name to use (mostly for testing purposes).
REPO =

# Api key for GigaChat.
GIGACHAT_KEY =

# LLM model to be applied
GIGACHAT_MODEL =

# Where all files are kept
LOCAL := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ chardet==5.2.0
mypy==1.12.1
cffconvert==2.0.0
samples-filter==0.5.1
repo-reasoner==0.0.31
25 changes: 25 additions & 0 deletions steps/discover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,31 @@ elif [ -z "${REPOS}" ] || [ ! -e "${REPOS}" ]; then
samples-filter filter "${fargs[@]}"
rm "${csv}"
mv "${nosamples}" "${csv}"

if [ -n "${GIGACHAT_KEY}" ] && [ -n "${GIGACHAT_MODEL}" ]; then
maintained=${TARGET}/maintained.csv
declare -a margs=( \
"--repositories=${csv}" \
"--output=${maintained}" \
"--key=${GIGACHAT_KEY}" \
"--model=${GIGACHAT_MODEL}"
)
repo-reasoner filter-unmaintained "${margs[@]}"
cp "${csv}" "${csv}.old"
head -n 1 "${csv}.old" > "${csv}"
while IFS=, read -r full_name default_branch created_at open_issues_count description topics stars forks size; do
if [[ "${full_name}" == "full_name" ]]; then
continue
fi
maintained_status=$(grep -m 1 "^${full_name}," "${maintained}" | cut -d ',' -f2)
if [[ "${maintained_status,,}" == "yes" ]]; then
echo "${full_name},${default_branch},${created_at},${open_issues_count},${description},${topics},${stars},${forks},${size}" >> "${csv}"
fi
done < "${csv}.old"
else
echo "GIGACHAT_API and/or GIGACHAT_MODEL are not defined. Skipping repo-reasoner."
fi

else
echo "Using the list of repositories from the '${REPOS}' file (defined by the REPOS environment variable)..."
cat "${REPOS}" > "${csv}"
Expand Down
Empty file modified tests/metrics/test-raf.sh
100755 → 100644
Empty file.
Loading