3 from logging
import Logger
4 from os
import environ, path
5 from pathlib
import Path
6 from typing
import List
10 """Get release setup."""
12 logger.info(
"No release information is available when a release is not set-up.\n")
15 current_nightly = environ[
"AtlasBuildStamp"]
16 release_base = environ[
"AtlasBuildBranch"]
17 release_head = environ[
"AtlasVersion"]
18 platform = environ[
"LCG_PLATFORM"]
19 project = environ[
"AtlasProject"]
20 builds_dir_search_str = f
"/cvmfs/atlas-nightlies.cern.ch/repo/sw/{release_base}_{project}_{platform}/[!latest_]*/{project}/{release_head}"
23 sorted_list =
sorted(glob(builds_dir_search_str), key=path.getmtime)
25 for folder
in reversed(sorted_list):
26 if not glob(f
"{folder}/../../{release_base}__{project}*-opt*.log"):
28 latest_nightly = folder.split(
"/")[-3]
31 if current_nightly != latest_nightly:
32 logger.info(f
"Please be aware that you are not testing your tags in the latest available nightly, which is {latest_nightly}")
34 setup =
"%s,%s,%s,Athena" % (release_base, platform.replace(
"-",
","), current_nightly)
36 logger.info(f
"Your tags will be tested in environment {setup}")
42 """List packages that have changed."""
44 logger.info(
"The list of changed packages is not available when the relase is not set-up.\n")
47 if "WorkDir_DIR" in environ:
48 logger.info(
"Changed packages in your build to be tested:\n")
49 file_path = Path(environ[
"WorkDir_DIR"])
50 fname = file_path /
"packages.txt"
51 with fname.open()
as fp:
52 lines = fp.readlines()
53 last_line = lines[-1].strip()
if lines
else None
58 logger.info(f
"{line}\n")
62 logger.warning(
"A release area with locally installed packages has not been setup.")
63 logger.warning(
"quit by executing <CONTROL-C> if this is not your intention, and")
64 logger.warning(
"source <YOUR_CMake_BUILD_AREA>/setup.sh")
65 logger.warning(
"to pickup locally built packages in your environment.\n")
70 """Run a WARNING helper function."""
72 with file_name.open()
as file:
74 if "WARNING" in line
and "| WARNING |" not in line: