Skip to content

Commit ea2f403

Browse files
authored
Fix docs pointer on size gates error. (#54542)
### What does this PR do? Fixes the docs pointer in the error messages from size gate failures Co-authored-by: tony.aiuto <tony.aiuto@datadoghq.com>
1 parent 83cc8f6 commit ea2f403

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

tasks/static_quality_gates/pr_comment.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,8 @@ def display_pr_comment(
224224
if with_blocking_error:
225225
body_error_footer += (
226226
"\n</details>\n\n"
227-
"Static quality gates prevent the PR to merge!\n"
228-
"You can check the static quality gates [confluence page](https://datadoghq.atlassian.net/wiki/spaces/agent/pages/4805854687/Static+Quality+Gates) for guidance. "
229-
"We also have a [toolbox page](https://datadoghq.atlassian.net/wiki/spaces/agent/pages/4887448722/Static+Quality+Gates+Toolbox) available to list tools useful to debug the size increase.\n"
227+
"Static quality gate failures prevent this PR from merging!\n"
228+
"You can check the static quality gates [runbooks page](https://datadoghq.atlassian.net/wiki/spaces/ABLD/pages/6034456675/Static+Quality+Gates+runbooks) for guidance and tools. "
230229
"Please either fix the size violation or [request an exception](https://datadoghq.atlassian.net/wiki/spaces/ABLD/pages/6034456675/Static+Quality+Gates+runbooks#Exception-process).\n"
231230
)
232231
final_error_body = body_error + body_error_footer

tasks/unit_tests/static_quality_gates/pr_comment_tests.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,12 @@ def test_no_info(self, pr_commenter_mock):
384384
body = call_args[1]['body']
385385
self.assertIn('### Error', body)
386386
self.assertIn('Change', body)
387-
self.assertIn('Size (prev', body)
387+
self.assertIn('Size (prev', body) # ) to make vim indent happy
388388
self.assertIn('gateA', body)
389389
self.assertIn('gateB', body)
390390
self.assertIn('Gate failure full details', body)
391-
self.assertIn('Static quality gates prevent the PR to merge!', body)
391+
# Make sure we have a link to a docs page.
392+
self.assertIn('https://datadoghq.atlassian.net/wiki', body)
392393
# Check dashboard link is present
393394
self.assertIn('Static Quality Gates Dashboard', body)
394395

@@ -563,8 +564,6 @@ def test_blocking_failure_shows_error_indicator(self, pr_commenter_mock):
563564
body = call_args[1]['body']
564565
# Should show error indicator for blocking failure
565566
self.assertIn('❌', body)
566-
# Should contain the blocking failure message
567-
self.assertIn('prevent the PR to merge', body)
568567

569568
@patch.dict(
570569
'os.environ',
@@ -612,7 +611,7 @@ def test_mixed_blocking_and_non_blocking(self, pr_commenter_mock):
612611
self.assertIn('❌', body)
613612
self.assertIn('⚠️', body)
614613
# Should contain the blocking failure message (since there's a blocking failure)
615-
self.assertIn('prevent the PR to merge', body)
614+
self.assertIn('prevent', body)
616615

617616

618617
class TestExceptionBanner(unittest.TestCase):

0 commit comments

Comments
 (0)