Skip to content
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e370f21
feat: add automated dependency update workflow
jjuliano Dec 29, 2025
d656a91
docs: add workflow testing and quick start guides
jjuliano Dec 29, 2025
e069390
docs: add workflow testing and quick start guides
jjuliano Dec 29, 2025
8a41d7e
Merge branch 'auto-update-workflow' of https://github.com/kdeps/schem…
jjuliano Dec 29, 2025
a22129e
fix: correct asset copying logic in workflow
jjuliano Dec 29, 2025
51acbe2
Merge branch 'main' into auto-update-workflow-fix
jjuliano Dec 29, 2025
07713a3
fix: exclude case-insensitive filename conflicts
jjuliano Dec 30, 2025
1cf4a49
refactor: rename conflicting files instead of deleting
jjuliano Dec 30, 2025
0135e4c
feat: generic case-insensitive conflict resolution with auto-fixing
jjuliano Dec 30, 2025
74d3bf1
perf: optimize reference fixing in download_deps.sh
jjuliano Dec 30, 2025
81901cc
Merge branch 'main' into auto-update-workflow-fix
jjuliano Dec 30, 2025
3881c45
fix: simplify error handling in fix_references
jjuliano Dec 30, 2025
a7ec448
refactor: atomic conflict resolution - detect, rename, fix immediately
jjuliano Dec 30, 2025
e746706
feat: add final global reference check after conflict resolution
jjuliano Dec 30, 2025
e8b7aa2
Merge branch 'main' into auto-update-workflow-fix
jjuliano Dec 30, 2025
5b08be8
fix: preserve directory structure when updating references
jjuliano Dec 30, 2025
88d60d5
fix: prevent renamed files from creating new conflicts
jjuliano Dec 30, 2025
95ec93c
Merge branch 'main' into auto-update-workflow-fix
jjuliano Dec 31, 2025
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
46 changes: 32 additions & 14 deletions scripts/download_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ fi
fix_references_for_file() {
local base_dir="$1"
local old_name="$2"
local new_path="$3"
local new_name="$3"

# Extract just the new basename (not the full path)
local new_basename=$(basename "$new_name")

# Find files that reference the old filename
local files_with_refs
Expand All @@ -43,16 +46,16 @@ fix_references_for_file() {
return 0
fi

# Update references in each file
# Update references in each file - only replace the basename, preserve directory structure
echo "$files_with_refs" | while IFS= read -r pkl_file; do
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' "s|import \".*/${old_name}\"|import \"${new_path}\"|g" "$pkl_file"
sed -i '' "s|\".*/${old_name}\"|\"${new_path}\"|g" "$pkl_file"
# macOS - replace just the filename part, preserving the path
sed -i '' "s|/${old_name}\"|/${new_basename}\"|g" "$pkl_file"
sed -i '' "s|\"${old_name}\"|\"${new_basename}\"|g" "$pkl_file"
else
# Linux
sed -i "s|import \".*/${old_name}\"|import \"${new_path}\"|g" "$pkl_file"
sed -i "s|\".*/${old_name}\"|\"${new_path}\"|g" "$pkl_file"
# Linux - replace just the filename part, preserving the path
sed -i "s|/${old_name}\"|/${new_basename}\"|g" "$pkl_file"
sed -i "s|\"${old_name}\"|\"${new_basename}\"|g" "$pkl_file"
fi
echo " Updated references in: $(basename "$pkl_file")"
done
Expand Down Expand Up @@ -87,6 +90,16 @@ detect_and_resolve_conflicts() {
parent_dir=$(dirname "$rel_path")
parent_name=$(basename "$parent_dir")
new_name="${parent_name}_${filename}"
new_name_lower=$(echo "$new_name" | tr '[:upper:]' '[:lower:]')

# Check if the new name will also conflict
suffix=1
while grep -q "^${new_name_lower}:" "$seen_file" 2>/dev/null; do
# New name conflicts, add numeric suffix
suffix=$((suffix + 1))
new_name="${parent_name}_${filename%.pkl}_${suffix}.pkl"
new_name_lower=$(echo "$new_name" | tr '[:upper:]' '[:lower:]')
done

old_file="$file"
new_file="$(dirname "$file")/$new_name"
Expand All @@ -102,8 +115,8 @@ detect_and_resolve_conflicts() {
# Fix references immediately
fix_references_for_file "$dir" "$filename" "$new_rel_path"

# Record the new file (lowercase:fullpath) so it's not detected as conflict
echo "${filename_lower}:${new_rel_path}" >> "$seen_file"
# Record the NEW file's lowercase version (not the old one!)
echo "${new_name_lower}:${new_rel_path}" >> "$seen_file"

# Signal that conflicts were found
echo "1" > /tmp/conflicts_found.flag
Expand Down Expand Up @@ -205,6 +218,9 @@ if [ "$CONFLICTS_RESOLVED" = true ] && [ -f /tmp/all_renames.txt ]; then
echo "Running final global reference check..."

while IFS='|' read -r old_name new_path; do
# Extract just the new basename
local new_basename=$(basename "$new_path")

# Find any remaining references to old filename
remaining_refs=$(find "$DEPS_DIR" -name "*.pkl" -type f -print0 | \
xargs -0 grep -l "$old_name" 2>/dev/null) || true
Expand All @@ -213,11 +229,13 @@ if [ "$CONFLICTS_RESOLVED" = true ] && [ -f /tmp/all_renames.txt ]; then
echo " Fixing remaining references to: $old_name"
echo "$remaining_refs" | while IFS= read -r pkl_file; do
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s|import \".*/${old_name}\"|import \"${new_path}\"|g" "$pkl_file"
sed -i '' "s|\".*/${old_name}\"|\"${new_path}\"|g" "$pkl_file"
# Replace just the filename part, preserving the path
sed -i '' "s|/${old_name}\"|/${new_basename}\"|g" "$pkl_file"
sed -i '' "s|\"${old_name}\"|\"${new_basename}\"|g" "$pkl_file"
else
sed -i "s|import \".*/${old_name}\"|import \"${new_path}\"|g" "$pkl_file"
sed -i "s|\".*/${old_name}\"|\"${new_path}\"|g" "$pkl_file"
# Replace just the filename part, preserving the path
sed -i "s|/${old_name}\"|/${new_basename}\"|g" "$pkl_file"
sed -i "s|\"${old_name}\"|\"${new_basename}\"|g" "$pkl_file"
fi
echo " Updated: $(basename "$pkl_file")"
done
Expand Down