aboutsummaryrefslogtreecommitdiff
path: root/rust_tools/rust_watch.py
diff options
context:
space:
mode:
Diffstat (limited to 'rust_tools/rust_watch.py')
-rwxr-xr-xrust_tools/rust_watch.py67
1 files changed, 44 insertions, 23 deletions
diff --git a/rust_tools/rust_watch.py b/rust_tools/rust_watch.py
index dff239f3..ba760e78 100755
--- a/rust_tools/rust_watch.py
+++ b/rust_tools/rust_watch.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -94,7 +93,7 @@ class State(NamedTuple):
def parse_release_tags(lines: Iterable[str]) -> Iterable[RustReleaseVersion]:
- """Parses `git ls-remote --tags` output into Rust stable release versions."""
+ """Parses `git ls-remote --tags` output into Rust stable versions."""
refs_tags = "refs/tags/"
for line in lines:
_sha, tag = line.split(None, 1)
@@ -236,14 +235,24 @@ def atomically_write_state(state_file: pathlib.Path, state: State) -> None:
def file_bug(title: str, body: str) -> None:
- """Files a bug against gbiv@ with the given title/body."""
- bugs.CreateNewBug(
- bugs.WellKnownComponents.CrOSToolchainPublic,
- title,
- body,
- # To either take or reassign depending on the rotation.
- assignee="gbiv@google.com",
+ """Files update bugs with the given title/body."""
+ # (component, optional_assignee)
+ targets = (
+ (bugs.WellKnownComponents.CrOSToolchainPublic, "gbiv@google.com"),
+ # b/269170429: Some Android folks said they wanted this before, and
+ # figuring out the correct way to apply permissions has been a pain. No
+ # one seems to be missing these notifications & the Android Rust folks
+ # are keeping on top of their toolchain, so ignore this for now.
+ # (bugs.WellKnownComponents.AndroidRustToolchain, None),
)
+ for component, assignee in targets:
+ bugs.CreateNewBug(
+ component,
+ title,
+ body,
+ assignee,
+ parent_bug=bugs.RUST_MAINTENANCE_METABUG,
+ )
def maybe_compose_bug(
@@ -256,8 +265,20 @@ def maybe_compose_bug(
title = f"[Rust] Update to {newest_release}"
body = (
- "A new release has been detected; we should probably roll to it. "
- "Please see go/crostc-rust-rotation for who's turn it is."
+ "A new Rust stable release has been detected; we should probably roll "
+ "to it.\n"
+ "\n"
+ "The regression-from-stable-to-stable tag might be interesting to "
+ "keep an eye on: https://github.com/rust-lang/rust/labels/"
+ "regression-from-stable-to-stable\n"
+ "\n"
+ "If you notice any bugs or issues you'd like to share, please "
+ "also note them on go/shared-rust-update-notes.\n"
+ "\n"
+ "See go/crostc-rust-rotation for the current rotation schedule.\n"
+ "\n"
+ "For questions about this bot, please contact chromeos-toolchain@ and "
+ "CC gbiv@."
)
return title, body
@@ -270,7 +291,7 @@ def maybe_compose_email(
return None
subject_pieces = []
- body_pieces = []
+ body_pieces: List[tiny_render.Piece] = []
# Separate the sections a bit for prettier output.
if body_pieces:
@@ -344,8 +365,8 @@ def main(argv: List[str]) -> None:
last_gentoo_sha=most_recent_gentoo_commit,
),
)
- # Running through this _should_ be a nop, but do it anyway. Should make any
- # bugs more obvious on the first run of the script.
+ # Running through this _should_ be a nop, but do it anyway. Should make
+ # any bugs more obvious on the first run of the script.
prior_state = read_state(state_file)
logging.info("Last state was %r", prior_state)
@@ -366,30 +387,30 @@ def main(argv: List[str]) -> None:
if maybe_bug is None:
logging.info("No bug to file")
else:
- title, body = maybe_bug
+ bug_title, bug_body = maybe_bug
if opts.skip_side_effects:
logging.info(
"Skipping sending bug with title %r and contents\n%s",
- title,
- body,
+ bug_title,
+ bug_body,
)
else:
logging.info("Writing new bug")
- file_bug(title, body)
+ file_bug(bug_title, bug_body)
if maybe_email is None:
logging.info("No email to send")
else:
- title, body = maybe_email
+ email_title, email_body = maybe_email
if opts.skip_side_effects:
logging.info(
"Skipping sending email with title %r and contents\n%s",
- title,
- tiny_render.render_html_pieces(body),
+ email_title,
+ tiny_render.render_html_pieces(email_body),
)
else:
logging.info("Sending email")
- send_email(title, body)
+ send_email(email_title, email_body)
if opts.skip_state_update:
logging.info("Skipping state update, as requested")
@@ -408,4 +429,4 @@ def main(argv: List[str]) -> None:
if __name__ == "__main__":
- sys.exit(main(sys.argv[1:]))
+ main(sys.argv[1:])