From 1e16a416d5a63a2afdd10c68cef6bd430aed44ce Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 17 Apr 2023 17:30:09 -0500 Subject: [PATCH 1/2] Add a way to skip PRs in updating E3SM submodules This is necessary if an E3SM PR has broken the build process as opposed to "just" tests. --- utils/e3sm_update/example.cfg | 2 ++ utils/e3sm_update/test_e3sm_changes.py | 46 ++++++++++++++------------ 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/utils/e3sm_update/example.cfg b/utils/e3sm_update/example.cfg index 6d31ce2160..94e3808a22 100644 --- a/utils/e3sm_update/example.cfg +++ b/utils/e3sm_update/example.cfg @@ -30,3 +30,5 @@ setup_command = compass suite -s -c ocean -t pr # the absolute or relative path to the load script use to activate the # compass environment load_script = load_compass_e3sm__update_chrysalis_intel_openmpi.sh +# a list of pull request numbers to skip +skip_prs = diff --git a/utils/e3sm_update/test_e3sm_changes.py b/utils/e3sm_update/test_e3sm_changes.py index 5bc4200b66..f3556bd22d 100755 --- a/utils/e3sm_update/test_e3sm_changes.py +++ b/utils/e3sm_update/test_e3sm_changes.py @@ -8,7 +8,7 @@ def submit_e3sm_tests(submodule, repo_url, ocean_strings, landice_strings, framework_strings, current, new, work_base, mpas_subdir, - make_command, setup_command, load_script): + make_command, setup_command, load_script, skip_prs): """ The driver function for calling ``git bisect`` to find the first "bad" commit between a known "good" and "bad" E3SM commit. @@ -49,23 +49,23 @@ def submit_e3sm_tests(submodule, repo_url, ocean_strings, landice_strings, compass environment """ print('\n') - print(72*'-') + print(72 * '-') print(f'Testing to update {submodule} submodule') - print(72*'-') + print(72 * '-') load_script = os.path.abspath(load_script) - commands = f'git submodule update --init' + commands = 'git submodule update --init' print_and_run(commands) current_submodule = f'{submodule}-current' new_submodule = f'{submodule}-new' - print(f'Setting up current submodule\n') + print('Setting up current submodule\n') setup_worktree(submodule, worktree=current_submodule, hash=current) - print(f'\nSetting up new submodule\n') + print('\nSetting up new submodule\n') setup_worktree(submodule, worktree=new_submodule, hash=new) @@ -90,12 +90,13 @@ def submit_e3sm_tests(submodule, repo_url, ocean_strings, landice_strings, hash = line.split(' ')[0] end = line.split('#')[-1].replace('(', ' ').replace(')', ' ') pull_request = end.split()[0] - index = len(pull_requests) - worktree = f'{index + 1:02d}_{pull_request}' - pull_requests.append({'hash': hash, - 'component': component, - 'pull_request': pull_request, - 'worktree': worktree}) + if pull_request not in skip_prs: + index = len(pull_requests) + worktree = f'{index + 1:02d}_{pull_request}' + pull_requests.append({'hash': hash, + 'component': component, + 'pull_request': pull_request, + 'worktree': worktree}) else: print(f'Warning: skipping commit with no "#" for PR:\n{line}') @@ -109,14 +110,14 @@ def submit_e3sm_tests(submodule, repo_url, ocean_strings, landice_strings, print(f'{len(pull_requests)+1:02d}: {new} {new_submodule} (new)') print('\n') - print(f'Setting up worktrees of all commits of interest\n') + print('Setting up worktrees of all commits of interest\n') for index, data in enumerate(pull_requests): hash = data['hash'] worktree = data['worktree'] setup_worktree(submodule, worktree=worktree, hash=hash) - print(f'Building each worktree and submitting comparison tests\n') + print('Building each worktree and submitting comparison tests\n') print('00: current\n') baseline = f'{work_base}/00_current' @@ -178,11 +179,11 @@ def setup_and_submit(load_script, setup_command, worktree, mpas_subdir, if ' -t ' in setup_command: split = setup_command.split() index = split.index('-t') - suite = split[index+1] + suite = split[index + 1] elif '--test_suite' in setup_command: split = setup_command.split() index = split.index('--test_suite') - suite = split[index+1] + suite = split[index + 1] else: suite = 'custom' @@ -215,9 +216,9 @@ def print_and_run(commands, get_output=False): def print_pr_description(submodule, repo_url, current, new, pull_requests): print('') - print(72*'-') - print(f'Pull Request Description Text') - print(72*'-') + print(72 * '-') + print('Pull Request Description Text') + print(72 * '-') print('') print(f'This merge updates the {submodule} submodule from ' @@ -241,8 +242,8 @@ def string_to_list(string): def main(): parser = argparse.ArgumentParser( - description='Test changes in E3SM before an update to the E3SM-Project ' - 'submodule') + description='Test changes in E3SM before an update to the ' + 'E3SM-Project submodule') parser.add_argument("-f", "--config_file", dest="config_file", required=True, help="Configuration file", @@ -265,7 +266,8 @@ def main(): work_base=section['work_base'], mpas_subdir=section['mpas_subdir'], make_command=section['make_command'], setup_command=section['setup_command'], - load_script=section['load_script']) + load_script=section['load_script'], + skip_prs=string_to_list(section['skip_prs'])) if __name__ == '__main__': From 23d228ae42874aebcfb706fc81235143a97eb715 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Tue, 18 Apr 2023 03:52:40 -0500 Subject: [PATCH 2/2] Update E3SM-Project submodule This merge updates the E3SM-Project submodule from [c292bec000](https://github.com/E3SM-Project/E3SM/tree/c292bec000) to [4b3e611fee](https://github.com/E3SM-Project/E3SM/tree/4b3e611fee). This update includes the following MPAS-Ocean and MPAS-Frameworks PRs (check mark indicates bit-for-bit with previous PR in the list): - [ ] (ocn) https://github.com/E3SM-Project/E3SM/pull/5418 - [ ] (ocn) https://github.com/E3SM-Project/E3SM/pull/5447 - [ ] (ocn) https://github.com/E3SM-Project/E3SM/pull/5568 - [ ] (ocn) https://github.com/E3SM-Project/E3SM/pull/5583 - [ ] (ocn) https://github.com/E3SM-Project/E3SM/pull/5575 - [ ] (ocn) https://github.com/E3SM-Project/E3SM/pull/5600 --- E3SM-Project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/E3SM-Project b/E3SM-Project index c292bec000..4b3e611fee 160000 --- a/E3SM-Project +++ b/E3SM-Project @@ -1 +1 @@ -Subproject commit c292bec000f10a1a8935f8c7ab3b54f0717ba0f8 +Subproject commit 4b3e611fee1e06b31c2d93c487d13debc094324a