Skip to content

Commit 8e448b4

Browse files
ci(medium): Implement PR-aware checkout for bot-triggered workflows (#9510)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: arii <342438+arii@users.noreply.github.com>
1 parent 10f99d8 commit 8e448b4

8 files changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/gemini-coder.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ jobs:
9595
steps:
9696
- name: Checkout repository
9797
uses: actions/checkout@v4
98+
with:
99+
ref: ${{ (github.event.issue.pull_request || github.event.pull_request) && format('refs/pull/{0}/head', github.event.issue.number || github.event.pull_request.number) || github.sha }}
98100

99101
- name: Setup Python
100102
uses: actions/setup-python@v4

.github/workflows/gemini-triage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
runs-on: self-hosted
4343
steps:
4444
- uses: actions/checkout@v4
45+
with:
46+
ref: ${{ (github.event.issue.pull_request || github.event.pull_request) && format('refs/pull/{0}/head', inputs.issue_number || github.event.inputs.issue_number || github.event.issue.number || github.event.pull_request.number) || github.sha }}
4547
- uses: pnpm/action-setup@v4
4648

4749
- uses: actions/setup-node@v6

.github/workflows/jules-session-manager.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
- name: Checkout repository
2222
uses: actions/checkout@v4
2323
with:
24+
ref: ${{ github.event.issue.pull_request && format('refs/pull/{0}/head', github.event.issue.number) || github.sha }}
2425
fetch-depth: 0
2526

2627
- name: Setup Python

.github/workflows/reusable-create-review-issues.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
- name: Checkout Code
9696
uses: actions/checkout@v4
9797
with:
98+
ref: ${{ (github.event.pull_request || github.event.issue.pull_request) && format('refs/pull/{0}/head', inputs.pr_number || github.event.pull_request.number || github.event.issue.number) || github.sha }}
9899
fetch-depth: 0
99100

100101
- name: Setup Environment

.github/workflows/reusable-gemini-review.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
9292
- uses: actions/checkout@v4
9393
with:
94+
ref: ${{ (github.event.pull_request || github.event.issue.pull_request) && format('refs/pull/{0}/head', inputs.pr_number || github.event.pull_request.number || github.event.issue.number) || github.sha }}
9495
fetch-depth: 0
9596

9697
- name: Fetch PR SHAs
@@ -148,6 +149,7 @@ jobs:
148149
- name: Checkout repository
149150
uses: actions/checkout@v4
150151
with:
152+
ref: ${{ (github.event.pull_request || github.event.issue.pull_request) && format('refs/pull/{0}/head', inputs.pr_number || github.event.pull_request.number || github.event.issue.number) || github.sha }}
151153
fetch-depth: 0
152154

153155
- name: Setup Environment
@@ -461,6 +463,7 @@ jobs:
461463
- name: Checkout repository
462464
uses: actions/checkout@v4
463465
with:
466+
ref: ${{ (github.event.pull_request || github.event.issue.pull_request) && format('refs/pull/{0}/head', inputs.pr_number || github.event.pull_request.number || github.event.issue.number) || github.sha }}
464467
fetch-depth: 0
465468

466469
- name: Download review result

components/Footer.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export default function Footer() {
1313
sx={{
1414
mt: 'auto',
1515
height: 54,
16+
minHeight: 54,
17+
maxHeight: 54,
18+
p: 0,
19+
m: 0,
1620
flexShrink: 0,
1721
display: 'flex',
1822
alignItems: 'center',

components/SpotifyDeviceSelector.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ const SpotifyDeviceSelector = ({
4949
horizontal: 'right',
5050
}}
5151
data-testid="spotify-device-selector-menu"
52+
PaperProps={{
53+
'data-testid': 'spotify-device-selector-menu-paper',
54+
}}
5255
>
5356
{availableDevices.length > 0 ? (
5457
availableDevices.map((device) => (

tests/playwright/vrt-components.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ test.describe('Component-Specific VRT', () => {
3434
if (el) {
3535
el.style.opacity = '1'
3636
el.style.visibility = 'visible'
37+
// Force an opaque background to prevent pixel leakage from underlying content
38+
el.style.backgroundColor = 'rgb(0, 0, 0)'
3739
// Pause any CSS animations/transitions specifically on this element
3840
el.style.animationPlayState = 'paused'
3941
el.style.transition = 'none'
@@ -126,14 +128,14 @@ test.describe('Component-Specific VRT', () => {
126128
})
127129
await selectorButton.click()
128130

129-
const menu = dashboardPage.getByTestId('spotify-device-selector-menu')
131+
const menu = dashboardPage.getByTestId('spotify-device-selector-menu-paper')
130132
await expect(menu).toBeVisible()
131133

132134
// Perform manual accessibility check on the specific menu element to ensure context validity
133135
await checkAccessibility(menu)
134136

135137
await takeScreenshot(menu, 'spotify-device-selector-menu.png', {
136-
threshold: 0.3,
138+
threshold: 0.2, // Tighter threshold for the Paper element
137139
skipA11y: true, // Accessibility checked manually above
138140
})
139141
})

0 commit comments

Comments
 (0)