Skip to content

[No QA] Don't skip tests for manual CPs #56392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 6, 2025
Merged
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
50 changes: 29 additions & 21 deletions .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,34 +107,42 @@ jobs:
if: fromJSON(steps.cherryPick.outputs.HAS_CONFLICTS)
id: createPullRequest
run: |
gh pr create \
--title "🍒 Cherry pick PR #${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒" \
--body \
"🍒 Cherry pick https://github.com/Expensify/App/pull/${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒
This PR had conflicts when we tried to cherry-pick it to staging. You'll need to manually perform the cherry-pick, using the following steps:
AUTHOR_CHECKLIST=$(sed -n '/### PR Author Checklist/,$p' .github/PULL_REQUEST_TEMPLATE.md)

PR_DESCRIPTION=$(cat <<EOF
🍒 Cherry pick https://github.com/Expensify/App/pull/56382 to staging 🍒

This PR had conflicts when we tried to cherry-pick it to staging. You'll need to manually perform the cherry-pick, using the following steps:

\`\`\`bash
git fetch
git checkout roryabraham-cherry-pick-staging-56382-1
git cherry-pick -S -x --mainline 1 6486b1d1961d4c6de85154905d57af5118b33ff9
\`\`\`

\`\`\`bash
git fetch
git checkout ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}
git cherry-pick -S -x --mainline 1 ${{ steps.getCPMergeCommit.outputs.MERGE_COMMIT_SHA }}
\`\`\`
Then manually resolve conflicts, and commit the change with \`git cherry-pick --continue\`. Lastly, please run:

Then manually resolve conflicts, and commit the change with \`git cherry-pick --continue\`. Lastly, please run:
\`\`\`bash
git commit --amend -m "\$(git log -1 --pretty=%B)" -m "(CP triggered by roryabraham)"
\`\`\`

\`\`\`bash
git commit --amend -m \"$(git log -1 --pretty=%B)\" -m \"(CP triggered by ${{ github.actor }})\"
\`\`\`
That will help us keep track of who triggered this CP. Once all that's done, push your changes with \`git push origin roryabraham-cherry-pick-staging-6486b1d1961d4c6de85154905d57af5118b33ff9-1\`, and then open this PR for review.

That will help us keep track of who triggered this CP. Once all that's done, push your changes with \`git push origin ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}\`, and then open this PR for review.

Note that you **must** test this PR, and both the author and reviewer checklist should be completed, just as if you were merging the PR to main." \
Note that you **must** test this PR, and both the author and reviewer checklist should be completed, just as if you were merging the PR to main.

_Pro-tip:_ If this PR appears to have conflicts against the _staging_ base, it means that the version on staging has been updated. The easiest thing to do if you see this is to close the PR and re-run the CP.

$AUTHOR_CHECKLIST
EOF
)

# Create PR
gh pr create \
--title "🍒 Cherry pick PR #${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒" \
--body "$PR_DESCRIPTION" \
--label "Engineering,Hourly" \
--base "staging"
sleep 5
gh pr comment --body \
"This pull request has merge conflicts and can not be automatically merged. :disappointed:
Please manually resolve the conflicts, push your changes, and then request another reviewer to review and merge.
**Important:** There may be conflicts that GitHub is not able to detect, so please _carefully_ review this pull request before approving."
ORIGINAL_PR_AUTHOR="$(gh pr view ${{ github.event.inputs.PULL_REQUEST_NUMBER }} --json author --jq .author.login)"
gh pr edit --add-assignee "${{ github.actor }},${{ steps.getCPMergeCommit.outputs.MERGE_ACTOR }},$ORIGINAL_PR_AUTHOR"
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
lint:
name: ESLint check
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
if: ${{ github.event.head_commit.author.name != 'OSBotify' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

jobs:
jest:
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
if: ${{ github.event.head_commit.author.name != 'OSBotify' && github.event.head_commit.author.name != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
env:
CI: true
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
run: NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" npx jest --silent --shard=${{ fromJSON(matrix.chunk) }}/${{ strategy.job-total }} --max-workers ${{ steps.cpu-cores.outputs.count }}

storybookTests:
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
if: ${{ github.event.head_commit.author.name != 'OSBotify' && github.event.head_commit.author.name != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
name: Storybook tests
steps:
Expand Down
Loading