Skip to content
Open
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
34 changes: 34 additions & 0 deletions .github/workflows/schedule_update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Schedule FrogPilot Update

on:
workflow_dispatch:
inputs:
scheduled_date:
description: "Enter the date to update the 'FrogPilot' branch at (YYYY-MM-DD)"
required: true

jobs:
schedule-update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create scheduled update file
run: |
echo "${{ github.event.inputs.scheduled_date }}" > .github/update_date

- name: Commit scheduled update file
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add .github/update_date
git commit -m "Schedule update for ${{ github.event.inputs.scheduled_date }} at noon Phoenix time"

- name: Squash scheduled update file commit
run: |
git reset --soft HEAD~1
git commit --amend --no-edit --reset-author
git push origin HEAD --force
99 changes: 68 additions & 31 deletions .github/workflows/update-pr-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,87 @@ env:
TARGET_BRANCH: MAKE-PRS-HERE

jobs:
squash-and-cherry-pick:
update_branch:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: Checkout FrogPilot-Staging Branch
uses: actions/checkout@v3
with:
ref: ${{ env.SOURCE_BRANCH }}
fetch-depth: 0

- name: Set Git user name and email
- name: Identify the 'Compile FrogPilot' commit
id: find_parent
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
set -e
COMMIT=$(git rev-list HEAD -n 1 --grep="Compile FrogPilot")
if [ -z "$COMMIT" ]; then
echo "Commit with message 'Compile FrogPilot' not found." >&2
exit 1
fi

PARENT=$(git rev-list --parents -n 1 "$COMMIT" | awk '{print $2}')
if [ -z "$PARENT" ]; then
echo "Parent commit not found." >&2
exit 1
fi

- name: Get the second to last commit hash and create a temporary branch
echo "Compile commit: $COMMIT"
echo "Parent commit: $PARENT"
echo "parent_commit=$PARENT" >> "$GITHUB_OUTPUT"
echo "compile_commit=$COMMIT" >> "$GITHUB_OUTPUT"

- name: Checkout MAKE-PRS-HERE Branch
run: |
commit_hash=$(git rev-parse HEAD~1)
git checkout -b temp-branch $commit_hash
set -e
git fetch origin ${{ env.TARGET_BRANCH }}
git checkout ${{ env.TARGET_BRANCH }}

- name: Squash all commits into one with today's date in Phoenix time zone
- name: Clean MAKE-PRS-HERE and Update Files
run: |
day=$(TZ='America/Phoenix' date '+%-d')
suffix="th"
case $day in
1|21|31) suffix="st" ;;
2|22) suffix="nd" ;;
3|23) suffix="rd" ;;
esac
commit_message="$(TZ='America/Phoenix' date '+%B ')$day$suffix, $(TZ='America/Phoenix' date '+%Y') Update"
git reset --soft $(git rev-list --max-parents=0 HEAD)
git commit -m "$commit_message"
set -e
git rm -r --ignore-unmatch .
git clean -fdx

PARENT_COMMIT=${{ steps.find_parent.outputs.parent_commit }}
git checkout $PARENT_COMMIT -- .

- name: Cherry-pick the squashed commit to target branch and push
COMPILE_COMMIT=${{ steps.find_parent.outputs.compile_commit }}
SOURCE_HEAD=$(git rev-parse origin/${{ env.SOURCE_BRANCH }})
if [ "$COMPILE_COMMIT" != "$SOURCE_HEAD" ]; then
echo "Applying changes from commits after the compile commit..."
git cherry-pick --no-commit ${COMPILE_COMMIT}..$SOURCE_HEAD
fi
git add --all

- name: Set Git Username and Email
run: |
git fetch origin
git checkout ${{ env.TARGET_BRANCH }}
git cherry-pick temp-branch -X theirs || {
if git status | grep -q "nothing to commit, working tree clean"; then
echo "Empty commit detected, skipping cherry-pick."
git cherry-pick --skip
else
echo "Continuing with cherry-pick."
git cherry-pick --continue
fi
}
set -e
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"

- name: Commit and Push Changes
run: |
set -e
TZ_VALUE="America/Phoenix"
current_day=$(TZ="$TZ_VALUE" date +"%-d")
month=$(TZ="$TZ_VALUE" date +"%B")
year=$(TZ="$TZ_VALUE" date +"%Y")

if [ "$current_day" -eq 11 ] || [ "$current_day" -eq 12 ] || [ "$current_day" -eq 13 ]; then
suffix="th"
else
case $(($current_day % 10)) in
1) suffix="st" ;;
2) suffix="nd" ;;
3) suffix="rd" ;;
*) suffix="th" ;;
esac
fi

commit_message="${month} ${current_day}${suffix}, ${year} Update"
echo "Commit message: $commit_message"

git commit -m "$commit_message"
git push origin ${{ env.TARGET_BRANCH }}
120 changes: 110 additions & 10 deletions .github/workflows/update-release-branch.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,127 @@
name: Update FrogPilot Branch

on:
workflow_dispatch:
schedule:
- cron: "0 19 * * *"

env:
TZ: America/Phoenix

UPDATE_FILE: .github/update_date

BRANCH_FROGPILOT: FrogPilot
BRANCH_PREVIOUS: FrogPilot-Previous
BRANCH_STAGING: FrogPilot-Staging

jobs:
update-branch:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Reset "FrogPilot-Previous" branch to match "FrogPilot"
- name: Check if Update is Due
id: check_update
run: |
set -e
if [ ! -f "${{ env.UPDATE_FILE }}" ]; then
echo "No update_date file found. Skipping update."
echo "update_due=false" >> "$GITHUB_OUTPUT"
exit 0
fi

SCHEDULED_DATE=$(cat "${{ env.UPDATE_FILE }}")
CURRENT_DATE=$(TZ="${{ env.TZ }}" date +%F)

echo "Scheduled Date: $SCHEDULED_DATE"
echo "Current Date: $CURRENT_DATE"

if [ "$SCHEDULED_DATE" != "$CURRENT_DATE" ]; then
echo "Not the scheduled date. Exiting."
echo "update_due=false" >> "$GITHUB_OUTPUT"
exit 0
fi

echo "update_due=true" >> "$GITHUB_OUTPUT"
echo "scheduled_date=$SCHEDULED_DATE" >> "$GITHUB_OUTPUT"

- name: Set Git Username and Email
if: steps.check_update.outputs.update_due == 'true'
run: |
set -e
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"

- name: Reset FrogPilot-Previous to match FrogPilot
if: steps.check_update.outputs.update_due == 'true'
run: |
set -e
git fetch origin
git checkout FrogPilot-Previous || git checkout -b FrogPilot-Previous
git reset --hard origin/FrogPilot
git push origin FrogPilot-Previous --force
git checkout ${{ env.BRANCH_PREVIOUS }} || git checkout -b ${{ env.BRANCH_PREVIOUS }}
git reset --hard origin/${{ env.BRANCH_FROGPILOT }}
git push origin ${{ env.BRANCH_PREVIOUS }} --force

- name: Reset "FrogPilot" branch to match "FrogPilot-Staging"
- name: Reset FrogPilot to match FrogPilot-Staging
if: steps.check_update.outputs.update_due == 'true'
run: |
set -e
git fetch origin
git checkout FrogPilot || git checkout -b FrogPilot
git reset --hard origin/FrogPilot-Staging
git push origin FrogPilot --force
git checkout ${{ env.BRANCH_FROGPILOT }} || git checkout -b ${{ env.BRANCH_FROGPILOT }}
git reset --hard origin/${{ env.BRANCH_STAGING }}
git push origin ${{ env.BRANCH_FROGPILOT }} --force

- name: Rewrite Commit Dates to Noon Phoenix Time
if: steps.check_update.outputs.update_due == 'true'
run: |
set -e
COMMIT_DATETIME="${{ steps.check_update.outputs.scheduled_date }} 12:00"
COMMIT_PHX=$(TZ="${{ env.TZ }}" date -d "$COMMIT_DATETIME" +"%Y-%m-%dT%H:%M:%S %z")

git filter-branch --env-filter "
export GIT_AUTHOR_DATE=\"$COMMIT_PHX\"
export GIT_COMMITTER_DATE=\"$COMMIT_PHX\"
" -- --all

git push origin ${{ env.BRANCH_FROGPILOT }} --force

- name: Update README Last Updated Date
if: steps.check_update.outputs.update_due == 'true'
run: |
set -e
DAY=$(TZ="${{ env.TZ }}" date +'%d' | sed 's/^0//')
case "$DAY" in
1|21|31) SUFFIX="st" ;;
2|22) SUFFIX="nd" ;;
3|23) SUFFIX="rd" ;;
*) SUFFIX="th" ;;
esac

MONTH=$(TZ="${{ env.TZ }}" date +'%B')
YEAR=$(TZ="${{ env.TZ }}" date +'%Y')
NEW_DATE="**${MONTH} ${DAY}${SUFFIX}, ${YEAR}**"
echo "Updating README date to ${NEW_DATE}"

sed -i '/FrogPilot was last updated on:/ { N; N; s/\(\n\)\n.*$/\1\n'"${NEW_DATE}"'/; }' README.md

git add README.md
git commit -m "Update README last updated date to ${NEW_DATE}"
git push origin HEAD

- name: Remove Update Trigger File
if: steps.check_update.outputs.update_due == 'true'
run: |
set -e
git rm -f "${{ env.UPDATE_FILE }}"
git commit -m "Remove update_date file after execution"
git push origin HEAD

- name: Squash Last 3 Commits
if: steps.check_update.outputs.update_due == 'true'
run: |
set -e
git reset --soft HEAD~2
git commit --amend --no-edit --reset-author
git push origin HEAD --force
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ FrogPilot is a fully open-sourced fork of openpilot, featuring clear and concise
------
FrogPilot was last updated on:

**January 18th, 2025**
**February 14th, 2025**

Features
------
Expand Down
1 change: 1 addition & 0 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ struct CarParams {
volkswagenMqbEvo @29;
chryslerCusw @30;
psa @31;
volvo @32;
}

enum SteerControlType {
Expand Down
Loading