Skip to content

Commit

Permalink
devops: re-use firefox checkout for firefox-stable (#6410)
Browse files Browse the repository at this point in the history
Every patch to Firefox should also go to firefox-stable. This patch
starts re-using Firefox-beta checkout for firefox-stable, making
possible to easily rebaseline work atop of firefox-stable.

With this patch, working on a patch in Firefox is a 2-step
process:
1. work on a patch against Firefox-Beta
2. rebaseline your work atop of Firefox-Stable

Working on Firefox-Beta is as usual:
- setup an up-to-date firefox checkout:
  ```sh
  $ ./browser_patches/prepare_checkout.sh firefox
  ```
- create a new branch for your firefox work off `playwright-build`:
  ```sh
  $ cd ./browser_patches/firefox/checkout
  $ git checkout -b my-feature
  ```
- once work is done, export your branch:
  ```sh
  $ ./browser_patches/export.sh firefox
  ```

Rebaselining your work for Firefox-Stable takes advantage of a single
checkout:
- prepare a firefox-stable checkout:
  ```sh
  $ ./browser_patches/prepare_checkout.sh ff-stable
  ```
- rebaseline your feature branch atop of stable:
  ```sh
  $ cd ./browser_patches/firefox/checkout
  $ git checkout my-feature
  $ git rebase -i playwright-build
  ```
- make sure firefox-stable compiles:
  ```sh
  $ ./browser_patches/firefox-stable/build.sh
  ```
- export firefox-stable:
  ```sh
  $ ./browser_patches/export.sh ff-stable
  ```
  • Loading branch information
aslushnikov authored May 5, 2021
1 parent 5c51961 commit 77c1020
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
8 changes: 5 additions & 3 deletions browser_patches/export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ if [[ ("$1" == "firefox") || ("$1" == "firefox/") || ("$1" == "ff") ]]; then
CHECKOUT_PATH="${FF_CHECKOUT_PATH}"
FRIENDLY_CHECKOUT_PATH="<FF_CHECKOUT_PATH>"
fi
elif [[ ("$1" == "firefox-stable") ]]; then
FRIENDLY_CHECKOUT_PATH="//browser_patches/firefox-stable/checkout";
CHECKOUT_PATH="$PWD/firefox-stable/checkout"
elif [[ ("$1" == "firefox-stable") || ("$1" == "ff-stable") ]]; then
# NOTE: firefox-stable re-uses firefox checkout.
FRIENDLY_CHECKOUT_PATH="//browser_patches/firefox/checkout";
CHECKOUT_PATH="$PWD/firefox/checkout"

EXTRA_FOLDER_PW_PATH="$PWD/firefox-stable/juggler"
EXTRA_FOLDER_CHECKOUT_RELPATH="juggler"
EXPORT_PATH="$PWD/firefox-stable"
Expand Down
2 changes: 1 addition & 1 deletion browser_patches/firefox-stable/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [[ ! -z "${FF_CHECKOUT_PATH}" ]]; then
cd "${FF_CHECKOUT_PATH}"
echo "WARNING: checkout path from FF_CHECKOUT_PATH env: ${FF_CHECKOUT_PATH}"
else
cd "checkout"
cd "../firefox/checkout"
fi

OBJ_FOLDER="obj-build-playwright"
Expand Down
2 changes: 1 addition & 1 deletion browser_patches/firefox-stable/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [[ ! -z "${FF_CHECKOUT_PATH}" ]]; then
cd "${FF_CHECKOUT_PATH}"
echo "WARNING: checkout path from FF_CHECKOUT_PATH env: ${FF_CHECKOUT_PATH}"
else
cd "checkout"
cd "../firefox/checkout"
fi

rm -rf .mozconfig
Expand Down
2 changes: 1 addition & 1 deletion browser_patches/firefox-stable/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [[ ! -z "${FF_CHECKOUT_PATH}" ]]; then
echo "WARNING: checkout path from FF_CHECKOUT_PATH env: ${FF_CHECKOUT_PATH}"
else
cd "$(dirname $0)"
cd "checkout"
cd "../firefox/checkout"
fi

OBJ_FOLDER="obj-build-playwright"
Expand Down
10 changes: 6 additions & 4 deletions browser_patches/prepare_checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ elif [[ ("$1" == "firefox") || ("$1" == "firefox/") || ("$1" == "ff") ]]; then
CHECKOUT_PATH="${FF_CHECKOUT_PATH}"
FRIENDLY_CHECKOUT_PATH="<FF_CHECKOUT_PATH>"
fi
elif [[ ("$1" == "firefox-stable") ]]; then
FRIENDLY_CHECKOUT_PATH="//browser_patches/firefox-stable/checkout";
CHECKOUT_PATH="$PWD/firefox-stable/checkout"
elif [[ ("$1" == "firefox-stable") || ("$1" == "ff-stable") ]]; then
# NOTE: firefox-stable re-uses firefox checkout.
FRIENDLY_CHECKOUT_PATH="//browser_patches/firefox/checkout";
CHECKOUT_PATH="$PWD/firefox/checkout"

PATCHES_PATH="$PWD/firefox-stable/patches"
FIREFOX_EXTRA_FOLDER_PATH="$PWD/firefox-stable/juggler"
BUILD_NUMBER=$(head -1 "$PWD/firefox-stable/BUILD_NUMBER")
Expand Down Expand Up @@ -236,7 +238,7 @@ elif [[ ! -z "${FIREFOX_EXTRA_FOLDER_PATH}" ]]; then
git add $EMBEDDER_DIR
fi

git commit -a --author="playwright-devops <devops@playwright.dev>" -m "chore: bootstrap build #$BUILD_NUMBER"
git commit -a --author="playwright-devops <devops@playwright.dev>" -m "chore($1): bootstrap build #$BUILD_NUMBER"

echo
echo
Expand Down

0 comments on commit 77c1020

Please sign in to comment.