Skip to content

Commit 0b4aaa6

Browse files
committed
Revert "Add a dashboard of build/test status to the nightly build page. (#1340)"
This breaks the integration test script - oops! This reverts commit 69779cf.
1 parent 69779cf commit 0b4aaa6

File tree

4 files changed

+21
-741
lines changed

4 files changed

+21
-741
lines changed

.github/workflows/build-report.yml

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Generate Test Report Table
1+
name: Generate Weekly Test Report
22

33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: "0 15 * * *" # 3pm UTC = 7am PST / 8am PDT, 6 hours after testapps run
6+
- cron: "0 16 * * *" # 4pm UTC = 8am PST / 9am PDT, 7 hours after testapps run
77

88
env:
99
GITHUB_TOKEN: ${{ github.token }}
@@ -14,56 +14,6 @@ jobs:
1414
generate-report:
1515
runs-on: ubuntu-20.04
1616
steps:
17-
- name: Setup python
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: 3.9
21-
- uses: actions/checkout@v3
22-
with:
23-
fetch-depth: 0
24-
- name: Install Desktop SDK prerequisites
25-
uses: nick-invision/retry@v2
26-
with:
27-
timeout_minutes: 15
28-
max_attempts: 3
29-
command: |
30-
python3 scripts/gha/install_prereqs_desktop.py --gha_build
31-
python3 -m pip install requests python-dateutil progress attrs
3217
- name: Fetch GitHub jobs
3318
run: |
34-
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --write_cache build_status_short.cache
35-
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --write_cache build_status.cache
36-
- name: Generate report files
37-
run: |
38-
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --output_markdown --read_cache build_status_short.cache > report_short.md
39-
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --output_markdown --read_cache build_status.cache > report_extended.md
40-
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --nooutput_header --read_cache build_status_short.cache > report.txt
41-
- name: Generate comment string
42-
run: |
43-
echo -n > comment.md
44-
cat >> comment.md <<EOF
45-
46-
***
47-
48-
EOF
49-
cat report_short.md >> comment.md
50-
cat >> comment.md <<EOF
51-
52-
<details><summary>View extended history</summary>
53-
54-
EOF
55-
cat report_extended.md >> comment.md
56-
cat >> comment.md <<EOF
57-
</details>
58-
<details><summary>📄</summary><pre>
59-
EOF
60-
cat report.txt >> comment.md
61-
cat >> comment.md <<EOF
62-
</pre></details>
63-
EOF
64-
- name: Show comment string
65-
run: |
66-
cat comment.md
67-
- name: Update GitHub issue
68-
run: |
69-
python3 scripts/gha/update_issue_comment.py --token ${{ github.token }} --issue_title '[C++] Nightly Integration Testing Report' --start_tag build-dashboard-comment-start --end_tag build-dashboard-comment-end < comment.md
19+
true

scripts/gha/it_workflow.py

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"""A utility for integration test workflow.
1616
17-
This script helps to update PR/Issue comments and labels during testing process.
17+
This script helps to update PR/Issue comments and labels during testing process.
1818
1919
For PR comment, this script will update (create if not exist) the "Test Result" in comment.
2020
stage value: [start, progress, end]
@@ -27,7 +27,7 @@
2727
--run_id ${{github.run_id}} \
2828
[--new_token ${{steps.generate-token.outputs.token}}]
2929
30-
For Daily Report, this script will update (create if not exist) the "Test Result" in Issue
30+
For Daily Report, this script will update (create if not exist) the "Test Result" in Issue
3131
with title "Nightly Integration Testing Report" and label "nightly-testing".
3232
stage value: [report]
3333
USAGE:
@@ -61,8 +61,8 @@
6161
_LABEL_SUCCEED = "tests: succeeded"
6262

6363
_COMMENT_TITLE_PROGESS = "### ⏳&nbsp; Integration test in progress...\n"
64-
_COMMENT_TITLE_PROGESS_FLAKY = "### Integration test with FLAKINESS (but still ⏳&nbsp; in progress)\n"
65-
_COMMENT_TITLE_PROGESS_FAIL = "### ❌&nbsp; Integration test FAILED (but still ⏳&nbsp; in progress)\n"
64+
_COMMENT_TITLE_PROGESS_FLAKY = "### Integration test with FLAKINESS (but still ⏳&nbsp; in progress)\n"
65+
_COMMENT_TITLE_PROGESS_FAIL = "### ❌&nbsp; Integration test FAILED (but still ⏳&nbsp; in progress)\n"
6666
_COMMENT_TITLE_FLAKY = "### Integration test with FLAKINESS (succeeded after retry)\n"
6767
_COMMENT_TITLE_FAIL = "### ❌&nbsp; Integration test FAILED\n"
6868
_COMMENT_TITLE_SUCCEED = "### ✅&nbsp; Integration test succeeded!\n"
@@ -81,10 +81,6 @@
8181
_COMMENT_IDENTIFIER = "integration-test-status-comment"
8282
_COMMENT_HIDDEN_DIVIDER = f'\r\n<hidden value="{_COMMENT_IDENTIFIER}"></hidden>\r\n'
8383

84-
_COMMENT_IDENTIFIER_DASHBOARD = "build-dashboard-comment"
85-
_COMMENT_DASHBOARD_START = f'\r\n<hidden value="{_COMMENT_IDENTIFIER_DASHBOARD}"-start></hidden>\r\n'
86-
_COMMENT_DASHBOARD_END = f'\r\n<hidden value="{_COMMENT_IDENTIFIER_DASHBOARD}"-end></hidden>\r\n'
87-
8884
_LOG_ARTIFACT_NAME = "log-artifact"
8985
_LOG_OUTPUT_DIR = "test_results"
9086

@@ -109,7 +105,7 @@
109105
"Different stage while running the workflow. Valid values in _BUILD_STAGES.")
110106

111107
flags.DEFINE_string(
112-
"token", None,
108+
"token", None,
113109
"github.token: A token to authenticate on your repository.")
114110

115111
flags.DEFINE_string(
@@ -131,7 +127,7 @@
131127
"new_token", None,
132128
"Only used with --stage end"
133129
"Use a different token to remove the \"in-progress\" label,"
134-
"to allow the removal to trigger the \"Check Labels\" workflow.")
130+
"to allow the removal to trigger the \"Check Labels\" workflow.")
135131

136132
flags.DEFINE_string(
137133
"build_against", None,
@@ -155,7 +151,7 @@ def test_start(token, issue_number, actor, commit, run_id):
155151

156152

157153
def test_progress(token, issue_number, actor, commit, run_id):
158-
"""In PR, when some test failed, update failure info and
154+
"""In PR, when some test failed, update failure info and
159155
add label \"tests: failed\""""
160156
success_or_only_flakiness, log_summary = _get_summary_table(token, run_id)
161157
if success_or_only_flakiness and not log_summary:
@@ -178,7 +174,7 @@ def test_progress(token, issue_number, actor, commit, run_id):
178174

179175

180176
def test_end(token, issue_number, actor, commit, run_id, new_token):
181-
"""In PR, when some test end, update Test Result Report and
177+
"""In PR, when some test end, update Test Result Report and
182178
update label: add \"tests: failed\" if test failed, add label
183179
\"tests: succeeded\" if test succeed"""
184180
success_or_only_flakiness, log_summary = _get_summary_table(token, run_id)
@@ -209,14 +205,11 @@ def test_end(token, issue_number, actor, commit, run_id, new_token):
209205

210206

211207
def test_report(token, actor, commit, run_id, build_against, build_apis):
212-
"""Update (create if not exist) a Daily/Nightly Report in Issue.
208+
"""Update (create if not exist) a Daily/Nightly Report in Issue.
213209
The Issue with title _REPORT_TITLE and label _REPORT_LABEL:
214210
https://github.com/firebase/firebase-cpp-sdk/issues?q=is%3Aissue+label%3Anightly-testing
215211
The report is with the format below:
216212
PREFIX
217-
HIDDEN DASHBOARD START - optional
218-
BUILD DASHBOARD - optional
219-
HIDDEN DASHBOARD END - optional
220213
HIDDEN DIVIDER
221214
REPORT (TEST AGAINST REPO)
222215
HIDDEN DIVIDER
@@ -229,24 +222,16 @@ def test_report(token, actor, commit, run_id, build_against, build_apis):
229222
report_title = _REPORT_TITLE
230223
firestore_issue_number = _get_issue_number(token, _REPORT_TITLE_FIRESTORE, _REPORT_LABEL)
231224
firestore_issue_url = "https://github.com/firebase/firebase-cpp-sdk/issues/%s" % firestore_issue_number
232-
prefix = "Note: This report excludes Firestore. Please also check **[the report for Firestore](%s).**\n***\n" % firestore_issue_url
225+
prefix = "Note: This report excludes firestore. Please also check **[the report for firestore](%s)**\n***\n" % firestore_issue_url
233226

234227
issue_number = _get_issue_number(token, report_title, _REPORT_LABEL)
235228
previous_comment = github.get_issue_body(token, issue_number)
236-
[previous_prefix, previous_comment_repo, previous_comment_sdk,
237-
previous_comment_tip] = previous_comment.split(_COMMENT_HIDDEN_DIVIDER)
238-
# If there is a build dashboard, preserve it.
239-
if (_COMMENT_DASHBOARD_START in previous_prefix and
240-
_COMMENT_DASHBOARD_END in previous_prefix):
241-
[_, previous_dashboard_plus_the_rest] = previous_prefix.split(_COMMENT_DASHBOARD_START)
242-
[previous_dashboard, _] = previous_dashboard_plus_the_rest.split(_COMMENT_DASHBOARD_END)
243-
prefix = prefix + _COMMENT_DASHBOARD_START + previous_dashboard + _COMMENT_DASHBOARD_END
244-
229+
[_, previous_comment_repo, previous_comment_sdk, previous_comment_tip] = previous_comment.split(_COMMENT_HIDDEN_DIVIDER)
245230
success_or_only_flakiness, log_summary = _get_summary_table(token, run_id)
246231
if success_or_only_flakiness and not log_summary:
247232
# succeeded (without flakiness)
248233
if build_against==_BUILD_AGAINST_REPO:
249-
title = _COMMENT_TITLE_SUCCEED_REPO
234+
title = _COMMENT_TITLE_SUCCEED_REPO
250235
elif build_against==_BUILD_AGAINST_SDK:
251236
title = _COMMENT_TITLE_SUCCEED_SDK
252237
else:
@@ -256,21 +241,21 @@ def test_report(token, actor, commit, run_id, build_against, build_apis):
256241
if success_or_only_flakiness:
257242
# all failures/errors are due to flakiness (succeeded after retry)
258243
if build_against==_BUILD_AGAINST_REPO:
259-
title = _COMMENT_TITLE_FLAKY_REPO
244+
title = _COMMENT_TITLE_FLAKY_REPO
260245
elif build_against==_BUILD_AGAINST_SDK:
261246
title = _COMMENT_TITLE_FLAKY_SDK
262247
else:
263248
title = _COMMENT_TITLE_FLAKY_TIP
264249
else:
265250
# failures/errors still exist after retry
266251
if build_against==_BUILD_AGAINST_REPO:
267-
title = _COMMENT_TITLE_FAIL_REPO
252+
title = _COMMENT_TITLE_FAIL_REPO
268253
elif build_against==_BUILD_AGAINST_SDK:
269254
title = _COMMENT_TITLE_FAIL_SDK
270255
else:
271256
title = _COMMENT_TITLE_FAIL_TIP
272257
comment = title + _get_description(actor, commit, run_id) + log_summary + _COMMENT_FLAKY_TRACKER
273-
258+
274259
if build_against==_BUILD_AGAINST_REPO:
275260
comment = prefix + _COMMENT_HIDDEN_DIVIDER + comment + _COMMENT_HIDDEN_DIVIDER + previous_comment_sdk + _COMMENT_HIDDEN_DIVIDER + previous_comment_tip
276261
elif build_against==_BUILD_AGAINST_SDK:
@@ -282,7 +267,7 @@ def test_report(token, actor, commit, run_id, build_against, build_apis):
282267
github.close_issue(token, issue_number)
283268
else:
284269
github.open_issue(token, issue_number)
285-
270+
286271
github.update_issue_comment(token, issue_number, comment)
287272

288273

@@ -291,13 +276,7 @@ def _get_issue_number(token, title, label):
291276
for issue in issues:
292277
if issue["title"] == title:
293278
return issue["number"]
294-
empty_comment = (" " +
295-
_COMMENT_DASHBOARD_START + " " +
296-
_COMMENT_DASHBOARD_END + " " +
297-
_COMMENT_HIDDEN_DIVIDER + " " +
298-
_COMMENT_HIDDEN_DIVIDER + " " +
299-
_COMMENT_HIDDEN_DIVIDER + " "
300-
)
279+
empty_comment = _COMMENT_HIDDEN_DIVIDER + " " + _COMMENT_HIDDEN_DIVIDER + " " + _COMMENT_HIDDEN_DIVIDER
301280
return github.create_issue(token, title, label, empty_comment)["number"]
302281

303282

@@ -308,7 +287,7 @@ def _update_comment(token, issue_number, comment):
308287
else:
309288
github.update_comment(token, comment_id, comment)
310289

311-
290+
312291
def _get_comment_id(token, issue_number, comment_identifier):
313292
comments = github.list_comments(token, issue_number)
314293
for comment in comments:

0 commit comments

Comments
 (0)