Skip to content

Commit 576baac

Browse files
committed
fix(migration): inject root gitignore negative overrides for nested java env packages
1 parent b28142b commit 576baac

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

monorepo-migration/migrate.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,26 @@ if [ -d "$SOURCE_REPO_NAME/.github/workflows" ]; then
382382
COMMIT_COUNT=$((COMMIT_COUNT + 1))
383383
fi
384384

385+
# 7.5c Inject root .gitignore negative overrides to protect Java package folders from env/ string collisions
386+
if [ -f ".gitignore" ]; then
387+
echo "Injecting negative override allow rules into root .gitignore to protect Java env/ package namespaces..."
388+
cat <<EOF >> ".gitignore"
389+
390+
# Protect Java package folders from Python virtualenv env/ and ENV/ blanket collisions
391+
!**/src/main/java/**/env/
392+
!**/src/test/java/**/env/
393+
!**/src/main/proto/**/env/
394+
!**/src/test/proto/**/env/
395+
!**/src/main/java/**/ENV/
396+
!**/src/test/java/**/ENV/
397+
EOF
398+
399+
echo "Committing root .gitignore negative overrides..."
400+
git add .gitignore
401+
git commit -n --no-gpg-sign -m "chore($SOURCE_REPO_NAME): inject gitignore negative overrides to shield java env packages"
402+
COMMIT_COUNT=$((COMMIT_COUNT + 1))
403+
fi
404+
385405
# 7.6 Update generation_config.yaml
386406
echo "Updating generation_config.yaml..."
387407
SOURCE_CONFIG="$SOURCE_REPO_NAME/generation_config.yaml"

0 commit comments

Comments
 (0)