Skip to content

Commit fe10e71

Browse files
Minor fixes for missing config owner (#218)
1 parent 288ed88 commit fe10e71

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

github_scripts/get_git_sources.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@
1919
logger = logging.getLogger(__name__)
2020

2121

22+
class SubprocessRunError(Exception):
23+
def __init__(self, command, returncode, stdout, stderr):
24+
self.command = command
25+
self.returncode = returncode
26+
self.stdout = stdout
27+
self.stderr = stderr
28+
self.message = (
29+
f"Errorcode {returncode} raised when running command '{command}\n\n"
30+
f"stdout:\n{stdout}\n\nstderr:\n{stderr}"
31+
)
32+
super().__init__(self.message)
33+
34+
2235
def run_command(
2336
command: str, check: bool = True, capture: bool = True, timeout: int = 600
2437
) -> Optional[subprocess.CompletedProcess]:
@@ -44,8 +57,8 @@ def run_command(
4457
if check and result.returncode != 0:
4558
err_msg = (result.stderr or "").strip()
4659
logger.error(f"[FAIL] Command failed: {command}\nError: {err_msg}")
47-
raise subprocess.CalledProcessError(
48-
result.returncode, args, output=result.stdout, stderr=result.stderr
60+
raise SubprocessRunError(
61+
result.returncode, command, result.stdout, result.stderr
4962
)
5063
return result
5164

@@ -198,14 +211,14 @@ def merge_source(
198211

199212
run_command(f"git -C {dest} fetch local {fetch}")
200213

201-
command = f"git -C {dest} merge --no-gpg-sign FETCH_HEAD"
214+
command = f"git -C {dest} merge --no-gpg-sign --no-edit FETCH_HEAD"
202215
result = run_command(command, check=False)
203216
if result.returncode:
204217
unmerged_files = get_unmerged(dest)
205218
if unmerged_files:
206219
handle_merge_conflicts(source, ref, dest, dest.name)
207220
else:
208-
raise subprocess.CalledProcessError(
221+
raise SubprocessRunError(
209222
result.returncode, command, result.stdout, result.stderr
210223
)
211224

github_scripts/merge_sources.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def parse_args():
3232
parser.add_argument(
3333
"-p",
3434
"--path",
35+
type=Path,
3536
default=None,
3637
help="The path to extract the sources to. If part of a cylc suite, it will "
3738
"default to $CYLC_WORKFLOW_SHARE_DIR/source, otherwise __file__/source",

github_scripts/suite_report_git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def create_um_config_owner_table(self, owners: Dict) -> None:
238238
# Create a dict with owners as the key
239239
table_dict = defaultdict(list)
240240
for config in failed_configs:
241-
owner, others = owners[config]
241+
owner, others = owners.get(config, "UNKNOWN")
242242
if others != "--":
243243
config = f"{config} ({others})"
244244
table_dict[owner].append(config)

0 commit comments

Comments
 (0)