• Home
  • Raw
  • Download

Lines Matching +full:stable +full:- +full:branch

3 # Use of this source code is governed by a BSD-style license that can be
8 It supports updating on canary, stable, and beta branches.
28 # Folks who should be on the R-line of any CLs that get uploaded.
31 # Folks who should be on the CC-line of any CLs that get uploaded.
40 # the 'google-cloud-cli' package. Since we need depot_tools to even
52 def cwp_gs_location(self) -> str:
55 return "gs://chromeos-prebuilt/afdo-job/vetted/kernel/amd64"
57 return "gs://chromeos-prebuilt/afdo-job/vetted/kernel/arm"
58 assert False, f"Uncovered arch -> gs:// mapping for {self}"
72 def parse(cls, val: str) -> "KernelVersion":
90 # Ordered from closest-to-ToT to farthest-from-ToT
93 STABLE = "stable" variable in Channel
96 def parse(cls, val: str) -> "Channel":
123 "--debug",
128 "--upload",
133 "--fetch",
135 help="Run `git fetch` in toolchain-utils prior to running.",
138 "--max-age-days",
147 "--chromeos-tree",
151 unlocks extra convenience features on `--upload`. This script will try
170 """Represents a ChromeOS branch."""
177 def git_checkout(git_dir: Path, branch: GitBranch) -> None:
182 "--quiet",
183 f"{branch.remote}/{branch.branch_name}",
191 def git_fetch(git_dir: Path) -> None:
200 def git_rev_parse(git_dir: Path, ref_or_sha: str) -> str:
202 ["git", "rev-parse", ref_or_sha],
207 encoding="utf-8",
211 def autodetect_branches(toolchain_utils: Path) -> Dict[Channel, GitBranch]:
212 """Returns GitBranches for each branch type in toolchain_utils."""
216 "branch",
217 "-r",
223 encoding="utf-8",
226 # Match "${remote}/release-R${branch_number}-${build}.B"
227 branch_re = re.compile(r"([^/]+)/(release-R(\d+)-\d+\.B)")
241 stable = branches[-2]
242 beta = branches[-1]
251 Channel.STABLE: stable,
265 ) -> Dict[Arch, ArchUpdateConfig]:
268 # simple. These are read from branches, so we'd need cherry-picks to go
274 kv_re = re.compile(r'^([a-zA-Z_0-9]+)="([^"]*)"(?:\s*#.*)?', re.MULTILINE)
275 kvs = kv_re.findall(file_path.read_text(encoding="utf-8"))
288 # This is a space-separated list of kernel versions.
312 _FILE_NAME_PARSE_RE = re.compile(r"R(\d+)-(\d+\.\d+)-(\d+)(\..+\..+)")
317 f"R{self.release_number}-{self.chrome_build}-{self.cwp_timestamp}"
327 ) -> "KernelGsProfile":
341 def datetime_from_gs_time(timestamp_str: str) -> datetime.datetime:
344 timestamp_str, "%Y-%m-%dT%H:%M:%SZ"
355 def _parse_gs_stdout(stdout: str) -> List[KernelGsProfile]:
359 for line in stdout.splitlines()[:-1]:
373 def _fetch_impl(cls, gs_url: str) -> List[KernelGsProfile]:
377 "-l",
386 encoding="utf-8",
401 def fetch(self, gs_url: str) -> List[KernelGsProfile]:
420 ) -> Optional[KernelGsProfile]:
444 # choose what _should_ be a consistent tie-breaker.
451 def read_afdo_descriptor_file(path: Path) -> Dict[KernelVersion, str]:
458 with path.open(encoding="utf-8") as f:
465 # "chromeos-kernel-${major}_${minor}": {
469 key_re = re.compile(r"^chromeos-kernel-(\d)+_(\d+)$")
483 ) -> bool:
490 f"chromeos-kernel-{k.major}_{k.minor}": {"name": gs_name}
496 existing_contents = path.read_text(encoding="utf-8")
506 tmp_path.write_text(contents_json, encoding="utf-8")
529 branch: GitBranch,
531 ) -> Optional[Tuple[str, bool]]:
532 """Tries to update one AFDO profile on a branch.
540 fetcher, arch, kernel_version, branch.release_number
542 # Try an older branch if we're not on stable. We should fail harder if we
543 # only have old profiles on stable, though.
544 if newest_artifact is None and channel != Channel.STABLE:
546 fetcher, arch, kernel_version, branch.release_number - 1
554 branch.release_number,
563 branch.release_number,
565 age = selection_info.now - newest_artifact.gs_timestamp
583 branch: GitBranch,
585 ) -> UpdateResult:
587 git_checkout(toolchain_utils, branch)
593 to_skip = skipped_versions.get(branch.release_number)
604 branch.release_number,
613 branch,
634 branch.release_number,
640 branch.release_number,
651 """Runs `git commit -a` with an appropriate message."""
671 "Have PM pre-approval because this shouldn't break the release",
672 "branch.",
678 "TEST=Verified in kernel-release-afdo-verify-orchestrator",
686 "--quiet",
687 "-a",
688 "-m",
700 branch: GitBranch,
705 branch.remote,
706 branch.branch_name,
727 def find_chromeos_tree_root(a_dir: Path) -> Optional[Path]:
734 def main(argv: List[str]) -> None:
769 branch = branches[channel]
775 branch,
786 upload_head_to_gerrit(worktree, chromeos_tree, branch)
789 "--upload not specified. Leaving commit for %s at %s",