Skip to content

Commit

Permalink
chore: Add rules for automatic rebasing
Browse files Browse the repository at this point in the history
Signed-off-by: RomanNikitenko <rnikiten@redhat.com>
  • Loading branch information
RomanNikitenko committed Dec 30, 2024
1 parent bf85748 commit b3ce1db
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"workspaces": [
"packageMocks/keytar"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"keytar": "workspace:*"
}
}
27 changes: 27 additions & 0 deletions rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,29 @@ apply_code_extensions_package_lock_changes() {
git add code/extensions/package-lock.json > /dev/null 2>&1
}

# Apply changes on code/extensions/microsoft-authentication/package-lock.json file
apply_code_extensions_microsoft_authentication_package_lock_changes() {

echo " ⚙️ reworking code/extensions/microsoft-authentication/package-lock.json..."

conflicted_files=$(git diff --name-only --diff-filter=U)

# Check if code/extensions/microsoft-authentication/package.json is in the list
if echo "$conflicted_files" | grep -q "^code/extensions/microsoft-authentication/package.json$"; then
echo "Conflict for the code/extensions/microsoft-authentication/package.json should be fixed first!"
apply_package_changes_by_path "code/extensions/microsoft-authentication/package.json"
fi

# reset the file from what is upstream
git checkout --ours code/extensions/microsoft-authentication/package-lock.json > /dev/null 2>&1

# update package-lock.json
npm install --ignore-scripts --prefix code/extensions/microsoft-authentication

# resolve the change
git add code/extensions/microsoft-authentication/package-lock.json > /dev/null 2>&1
}

# Apply changes on code/remote/package-lock.json file
apply_code_remote_package_lock_changes() {

Expand Down Expand Up @@ -378,6 +401,10 @@ resolve_conflicts() {
apply_code_extensions_package_lock_changes
elif [[ "$conflictingFile" == "code/product.json" ]]; then
apply_code_product_changes
elif [[ "$conflictingFile" == "code/extensions/microsoft-authentication/package.json" ]]; then
apply_package_changes_by_path "$conflictingFile"
elif [[ "$conflictingFile" == "code/extensions/microsoft-authentication/package-lock.json" ]]; then
apply_code_extensions_microsoft_authentication_package_lock_changes
elif [[ "$conflictingFile" == "code/build/lib/mangle/index.js" ]]; then
apply_mangle_index_js_changes
elif [[ "$conflictingFile" == "code/build/lib/mangle/index.ts" ]]; then
Expand Down

0 comments on commit b3ce1db

Please sign in to comment.