Skip to content

Commit 55d0aaa

Browse files
bsheedy-workDawn LUCI CQ
authored andcommitted
Add roll command line to roll CLs
Adds the command line used to generate Chromium -> Dawn rolls to the CL description of generated CLs. The added lines differ slightly between manual and autoroll runs since manual runs do not guarantee that test specs are regenerated. Bug: 452840620 Change-Id: I13db52c44f87b5acb298355475c2f4984fc98e37 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/280959 Reviewed-by: Jonathan Lee <jonathanjlee@google.com> Auto-Submit: Brian Sheedy <bsheedy@google.com> Commit-Queue: Brian Sheedy <bsheedy@google.com>
1 parent 16e6a53 commit 55d0aaa

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

scripts/roll_chromium_deps.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import logging
3636
import pathlib
3737
import posixpath
38+
import shlex
3839
import subprocess
3940
import sys
4041
from typing import Any, Self, Type
@@ -771,6 +772,8 @@ def _generate_commit_message(changed_entries: list[ChangedDepsEntry],
771772
commit_message_lines.extend(
772773
_generate_chromium_section(chromium_revision_range, autoroll))
773774
commit_message_lines.append('')
775+
commit_message_lines.extend(_generate_command_section(autoroll))
776+
commit_message_lines.append('')
774777
commit_message_lines.extend(_generate_repo_section(changed_entries))
775778
commit_message_lines.append('')
776779
commit_message_lines.extend(_generate_cipd_section(changed_entries))
@@ -810,6 +813,38 @@ def _generate_chromium_section(chromium_revision_range: ChangedRepo,
810813
return chromium_lines
811814

812815

816+
def _generate_command_section(autoroll: bool) -> list[str]:
817+
"""Generates the commit message section for the script command.
818+
819+
Args:
820+
autoroll: Whether this roll is being done by the autoroller.
821+
822+
Returns:
823+
A list of strings containing lines to append to the commit message.
824+
"""
825+
command_lines = [
826+
'DEPS and submodule changes generated by running:',
827+
]
828+
script = pathlib.Path(__file__).resolve()
829+
script = script.relative_to(DAWN_ROOT)
830+
relative_command = [str(script)] + sys.argv[1:]
831+
command_lines.append(f' {shlex.join(relative_command)}')
832+
833+
test_spec_script = 'infra/specs/generate_test_spec_json.py'
834+
if autoroll:
835+
command_lines.extend([
836+
'Test specs were then regenerated by syncing and running:',
837+
f' {test_spec_script}',
838+
])
839+
else:
840+
command_lines.extend([
841+
'Test specs may have been regenerated by syncing and running:',
842+
f' {test_spec_script}',
843+
'This step is manual and may have been missed by the author.'
844+
])
845+
return command_lines
846+
847+
813848
def _generate_section_for_entry_type(entry_type: Type[ChangedDepsEntry],
814849
changed_entries: list[ChangedDepsEntry],
815850
empty_message: str,

0 commit comments

Comments
 (0)