Commit abb4b58
authored
183602 Fix an issue with updating proper job attempt numbers on re-run (#4988)
### 1. Refactored Pull Request Retrieval
- **Updated Handlers:** The logic in `rerun_all_failed_jobs.dart` and `rerun_failed_job.dart` has been updated to consistently use `PrCheckRuns.findPullRequestFor` to resolve the pull request via the commit SHA (`guard.commitSha`), rather than querying by PR number.
- **Fixed Re-run Workflows:** Ensured that the handlers fetch the correct active pull request during re-runs and store the proper retry number/attempt information when invoking `reScheduleTryBuilds`.
### 2. Removed `pull_request_num` Field and Cache
- **Model Cleanups:** The `pull_request_num` field was entirely removed from the `PrCheckRuns` Firestore model, including its related mappings and integration test matchers (`_pr_check_run.dart`).
- **Removed Methods:** Deleted the obsolete `findPullRequestCachedForPullRequestNum` lookup method from both `PrCheckRuns` and the `Scheduler` service. Additionally, removed its related caching tests.
### 3. Service/Dependencies Cleanup
- **Removed Unused Services:** Dropped the previously injected but unused `_githubService` from `scheduler.dart`.
- **Code Formatting:** Ran standard Dart formatting rules (`dart format`) to ensure code uniformity in edited files.
### 4. Test Suite Adjustments
- **Updated Mocks & Setup:** `rerun_all_failed_jobs_test.dart` and `rerun_failed_job_test.dart` were updated to properly seed data using `PrCheckRuns.initializeDocument(...)` mirroring production behavior.
- **Updated Assertions:** Test assertions were updated to verify correct PR handling, most notably checking that `reScheduleTryBuilds` receives accurate target configurations (e.g., proper attempt increments like `containsPair(targetA, 2)`).
- **Removed Deprecated Mocks:** Scrubbed generated files like `mocks.mocks.dart` and testing `data_seeder.dart` to remove references to the deleted fields and getters.
fix: flutter/flutter#1836021 parent e48778e commit abb4b58
12 files changed
Lines changed: 103 additions & 215 deletions
File tree
- app_dart
- lib/src
- model/firestore
- request_handlers
- service
- test
- model/firestore
- request_handlers
- service
- conductor/archive/rerun_failed_jobs_api_20260227
- dashboard/lib/service
- packages/cocoon_integration_test/lib/src
- model
- utilities
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 80 | | |
90 | 81 | | |
91 | 82 | | |
| |||
98 | 89 | | |
99 | 90 | | |
100 | 91 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 92 | + | |
105 | 93 | | |
106 | 94 | | |
107 | 95 | | |
| |||
126 | 114 | | |
127 | 115 | | |
128 | 116 | | |
129 | | - | |
130 | 117 | | |
131 | 118 | | |
132 | 119 | | |
| |||
202 | 189 | | |
203 | 190 | | |
204 | 191 | | |
205 | | - | |
206 | 192 | | |
207 | 193 | | |
208 | 194 | | |
| |||
215 | 201 | | |
216 | 202 | | |
217 | 203 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 204 | | |
Lines changed: 27 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
89 | 103 | | |
90 | | - | |
91 | | - | |
| 104 | + | |
| 105 | + | |
92 | 106 | | |
93 | 107 | | |
94 | 108 | | |
95 | 109 | | |
96 | 110 | | |
97 | 111 | | |
98 | 112 | | |
99 | | - | |
| 113 | + | |
100 | 114 | | |
101 | 115 | | |
102 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
98 | | - | |
99 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
| |||
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | | - | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
| |||
1720 | 1718 | | |
1721 | 1719 | | |
1722 | 1720 | | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
1730 | | - | |
1731 | | - | |
1732 | | - | |
1733 | | - | |
1734 | | - | |
1735 | | - | |
1736 | | - | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
1757 | 1721 | | |
1758 | 1722 | | |
1759 | 1723 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 86 | + | |
114 | 87 | | |
115 | 88 | | |
116 | 89 | | |
| |||
127 | 100 | | |
128 | 101 | | |
129 | 102 | | |
130 | | - | |
| 103 | + | |
131 | 104 | | |
132 | | - | |
| 105 | + | |
133 | 106 | | |
134 | 107 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 108 | | |
142 | 109 | | |
143 | 110 | | |
| |||
Lines changed: 28 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| |||
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
87 | | - | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| |||
103 | 110 | | |
104 | 111 | | |
105 | 112 | | |
106 | | - | |
107 | | - | |
| 113 | + | |
| 114 | + | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
| |||
127 | 134 | | |
128 | 135 | | |
129 | 136 | | |
130 | | - | |
| 137 | + | |
131 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
132 | 146 | | |
133 | 147 | | |
134 | 148 | | |
| |||
148 | 162 | | |
149 | 163 | | |
150 | 164 | | |
151 | | - | |
| 165 | + | |
152 | 166 | | |
153 | 167 | | |
154 | 168 | | |
| |||
171 | 185 | | |
172 | 186 | | |
173 | 187 | | |
174 | | - | |
| 188 | + | |
175 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
176 | 197 | | |
177 | 198 | | |
178 | 199 | | |
| |||
205 | 226 | | |
206 | 227 | | |
207 | 228 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | 229 | | |
215 | 230 | | |
216 | 231 | | |
| |||
0 commit comments