Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to tag 'cam6_4_033' #34

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
610e7a9
implement soil erod switch
fvitt Jan 27, 2023
5311341
implement soil erod switch for bulk model
fvitt Jan 31, 2023
872b60e
build script mods to allow se builds
jtruesdal May 3, 2023
3006e9c
se scam update
jtruesdal Sep 20, 2023
55ab657
bfb mods
jtruesdal Sep 24, 2023
da514d3
update to cam_development (cam6_3_128)
jtruesdal Sep 25, 2023
fd265ed
se scm updates to cmeps cdeps externals
jtruesdal Sep 29, 2023
f202756
scam updates
jtruesdal Nov 26, 2023
1e56c28
update to cam6_3_136 need to update externals yet
jtruesdal Nov 26, 2023
e4f97ea
external updates for scam_dev 6_3_136
jtruesdal Nov 26, 2023
64aa11e
missed cice external update for scam
jtruesdal Nov 26, 2023
b6ee97c
scam se update
jtruesdal Nov 26, 2023
5a9159a
scam se updates
jtruesdal Jan 3, 2024
b4ed83a
scam clean and updates for derecho
jtruesdal Jan 10, 2024
b567e51
bug fix for iopTimeIdx when iop step size is smaller than model timestep
jtruesdal Jan 21, 2024
e7d33d7
PR updates for Cheryl and Jim
jtruesdal Jan 22, 2024
aac8cf6
new default initialization using config_compset and config_component,…
jtruesdal Feb 20, 2024
6e9b777
check for error with mpi_bcast calls
jtruesdal Feb 26, 2024
91af07d
PR requested updates
jtruesdal Mar 5, 2024
53300de
compile catch/fix for se_single_column_mod
jtruesdal Mar 5, 2024
36e8f4b
shorten a few long lines >132
jtruesdal Mar 5, 2024
8851ffd
bugfix for new minloc replacement for loop with exit
jtruesdal Mar 6, 2024
5f7a485
update ice external tag
jtruesdal Mar 7, 2024
bcd2ea5
dont need these cdep mods
jtruesdal Mar 13, 2024
2e344b3
PR updates for Jesse
jtruesdal Apr 19, 2024
0407135
PR updates
jtruesdal Apr 19, 2024
551612d
PR updates
jtruesdal Apr 19, 2024
5d10dfd
dadadj ccpp updates
jtruesdal Apr 30, 2024
9eb07a1
Update Externals_CAM to point to my new atmos_phys branch - will need…
jtruesdal May 6, 2024
6f988cd
PR updates
jtruesdal May 15, 2024
f088d52
change dir name from dadadj to dry_adiabatic_adjust and make sure new…
jtruesdal May 30, 2024
b9003c2
PR update to err message for convergence failure
jtruesdal Jun 4, 2024
1698a76
initialize snapshot outfld fields to 0 in tphysac and tphysbc
jtruesdal Jun 20, 2024
cbc9ce5
update to cam6_3_162 w git-fleximod
jtruesdal Jun 21, 2024
0688d84
update to cam6_3_162 w git-fleximod
jtruesdal Jun 21, 2024
bfc7658
PR update for testing
jtruesdal Jun 25, 2024
66b6a24
merge up to cam6_4_006
jtruesdal Jul 8, 2024
6244ced
remove bfb line for testing
jtruesdal Jul 8, 2024
4bded6f
use conv_water calcs in COSP
brian-eaton Jul 9, 2024
353c2e6
generalized aerosol fluxes to surface with bulk dust rebin
fvitt Jul 10, 2024
b3c74ce
update cam to match atmos_phys changes in dadadj (return heating rate…
jtruesdal Jul 11, 2024
4b879d0
Use CAM4 BAM dust sizes; pass in aero_props from aero_model; misc cle…
fvitt Jul 18, 2024
fbca9ea
improve checks on number and mass fluxes to avoid divide by zero
fvitt Jul 18, 2024
e8bb669
add src/atmos_phys
jtruesdal Jul 19, 2024
ba79b2d
update to cam6_4_010
jtruesdal Jul 19, 2024
7a83d6b
dz fix in convproc
fvitt Jul 23, 2024
0322253
Merge remote-tracking branch 'origin/soil_erod_switch' into dust_emis…
fvitt Jul 24, 2024
92b6bac
use Erik's CTSM branch
fvitt Jul 24, 2024
bfb1886
use shr_dust_emis_mod inquiry functions
fvitt Jul 25, 2024
31e33fe
remove variable initialization, not necessary for bfb
jtruesdal Jul 25, 2024
91de96c
Merge remote-tracking branch 'ESCOMP/cam_development' into dadadj_ccpp
jtruesdal Jul 25, 2024
b0b79b2
update gitmodules for new atmospheric_physics tag
jtruesdal Jul 25, 2024
9cb0551
add checking for consistent settings; old atm/zender method b4b
fvitt Jul 25, 2024
f7b9e5d
define and set default namelist variables
fvitt Jul 25, 2024
b01294f
fix issue with aqua-planet
fvitt Jul 26, 2024
7faef52
implement AOA1MF age-of-air tracer
fvitt Jul 26, 2024
e0beb4e
remove ndep stream from aquaplanet and simple model runs
brian-eaton Aug 1, 2024
89b4f10
correct tendency calc
fvitt Aug 5, 2024
393d516
update to cam6_4_018
brian-eaton Aug 5, 2024
37fae81
use new ctsm tag
fvitt Aug 5, 2024
a972f69
merge up to cam6_4_018
jtruesdal Aug 5, 2024
2ae76b0
cycle forcings over appropriate year
fvitt Aug 5, 2024
dcc636d
PR updates: comments,typo, and replace hard coded length with shr_kin…
jtruesdal Aug 6, 2024
73d5ded
remove drydep_srf_file for aquap runs on unstructured grids
brian-eaton Aug 6, 2024
282501c
Merge remote-tracking branch 'ESCOMP/cam_development' into aerosol_de…
fvitt Aug 7, 2024
bbfc576
tweak a comment
fvitt Aug 8, 2024
e393c66
use Leung_2023 for cam7 phys
fvitt Aug 12, 2024
84be7fd
Merge remote-tracking branch 'ESCOMP/cam_development' into aeroconv_dz
fvitt Aug 13, 2024
14efd5b
Merge remote-tracking branch 'origin/waccm_forcings' into aeroconv_dz
fvitt Aug 13, 2024
44952cc
Add compiler name to derecho baseline directories
cacraigucar Aug 13, 2024
18aa3ef
Merge remote-tracking branch 'cacraigucar/fix_archive_baselines' into…
fvitt Aug 13, 2024
f675c40
ChangeLog draft
fvitt Aug 13, 2024
d434571
ChangeLog update
fvitt Aug 14, 2024
e23526f
Merge pull request #1111 from fvitt/aeroconv_dz
fvitt Aug 14, 2024
f5c1ab0
Remove 0.5*timestep logic from call to zm
cacraigucar Aug 14, 2024
0b68f22
Merge dadadj_ccpp up to cam6_4_020
jtruesdal Aug 15, 2024
06378c3
fix nans in psl
brian-eaton Aug 15, 2024
0a09ac0
Update atmos_phys tag
cacraigucar Aug 15, 2024
4cb6a52
Merge tag 'cam6_4_020' into zm_cleanup3a
cacraigucar Aug 15, 2024
e0efbee
update ChangeLog
brian-eaton Aug 16, 2024
cdf7228
Update atmos_phys tag
cacraigucar Aug 16, 2024
d36b4ed
update ChangeLog and add back # to first line of test_driver.sh
jtruesdal Aug 17, 2024
cf34bea
fix date of ChangeLog entry
jtruesdal Aug 17, 2024
782f134
Merge pull request #1026 from jtruesdal/dadadj_ccpp
jtruesdal Aug 17, 2024
a916ae6
Merge tag 'cam6_4_021' into zm_cleanup3a
cacraigucar Aug 19, 2024
e381582
Remove project checks from issue-closing script.
nusbaume Aug 19, 2024
2b900af
Fix comment to remove CAMDEN reference.
nusbaume Aug 19, 2024
a08e8c4
Merge pull request #1130 from nusbaume/issue_close_fix
nusbaume Aug 19, 2024
a642e33
Remove dt from call to ZM convtran
cacraigucar Aug 19, 2024
3335f4b
ChangeLog for cam6_4_022
cacraigucar Aug 19, 2024
fc29092
Merge pull request #1127 from cacraigucar/zm_cleanup3a
cacraigucar Aug 20, 2024
e004f55
Merge scam_dev_exp up to cam6_4_022
jtruesdal Aug 20, 2024
cb72d70
fix issue #1108, merge PR#1101
brian-eaton Aug 20, 2024
c5884d9
replace RuntimeError exception by log message in buildnml
brian-eaton Aug 21, 2024
e6a215e
update ChangeLog
brian-eaton Aug 21, 2024
04ceba6
remove smaw and turbtype from pbuf
brian-eaton Aug 22, 2024
712dead
Use Erik's CTSM hash; fix issues in build-namelist
fvitt Aug 22, 2024
54a0ba9
update cice and cdeps for regression failures,Changelog for PR,scam t…
jtruesdal Aug 22, 2024
a125750
fix logic in SE interpolate_vector routines
brian-eaton Aug 23, 2024
b88c67e
need scam_mandatory to set COLDSTART until CLM scam mods tagged
jtruesdal Aug 23, 2024
ba285ec
fix issue in build-namelist
fvitt Aug 23, 2024
282fcfc
remove cam3 from configure and namelist settings
brian-eaton Aug 23, 2024
e6d302c
fix bug in emis scaling when Leung is used
fvitt Aug 23, 2024
40f6c5c
update mpace regression test and ChangeLog
jtruesdal Aug 25, 2024
c50362c
update ChangeLog, pull hvcoord addition
jtruesdal Aug 26, 2024
6e32d03
Merge pull request #958 from jtruesdal/scam_dev_exp
jtruesdal Aug 26, 2024
eab5ffc
remove cam3 references from src code
brian-eaton Aug 26, 2024
d3df08c
update to cam6_4_023
brian-eaton Aug 26, 2024
1cec1c5
update ChangeLog
brian-eaton Aug 27, 2024
ccd5ff8
remove cam3 refs from src; remove fcrit2 from namelist
brian-eaton Aug 27, 2024
f7153a6
update ChangeLog
brian-eaton Aug 28, 2024
265425a
Merge pull request #1120 from brian-eaton/ndep-ddep
brian-eaton Aug 28, 2024
1c8c132
update ChangeLog
brian-eaton Aug 28, 2024
fa39af0
merge to cam6_4_024
brian-eaton Aug 28, 2024
536e7cb
add error checking and comments
fvitt Aug 28, 2024
eb03efe
Merge remote-tracking branch 'ESCOMP/cam_development' into aerosol_de…
fvitt Aug 28, 2024
e7f1ea1
ChangeLog draft
fvitt Aug 28, 2024
c9d17f1
ChangeLog update
fvitt Aug 28, 2024
7a63a3c
Neglected to remove the 0.5*timestep call from zm_convr_run - done now
cacraigucar Aug 28, 2024
1fad549
ChangeLog update
fvitt Aug 28, 2024
2f8ec4d
Merge pull request #1096 from fvitt/aerosol_deposition_fluxes
fvitt Aug 28, 2024
6020b86
Merge tag 'cam6_4_025' into zm_cleanup3a
cacraigucar Aug 28, 2024
eb6518a
Default Zender for all configs; use tag ctsm5.2.027
fvitt Aug 29, 2024
62b248c
Merge remote-tracking branch 'ESCOMP/cam_development' into dust_emiss…
fvitt Aug 29, 2024
95c159b
regression test Leung dust emis scheme
fvitt Aug 29, 2024
caa1bd3
correct typo in testlist_cam
fvitt Aug 29, 2024
3fcced6
Add ChangeLog for cam6_4_026
cacraigucar Aug 29, 2024
7decb60
Merge pull request #1137 from cacraigucar/zm_cleanup3a
cacraigucar Aug 29, 2024
ccc4d3d
remove old AOA tracers
fvitt Aug 29, 2024
fb7f2ac
Merge remote-tracking branch 'ESCOMP/cam_development' into age_of_air
fvitt Aug 29, 2024
cb36898
include a regression test for cam7 phys with age of air tracers
fvitt Aug 29, 2024
baec6e4
improve years calc
fvitt Aug 30, 2024
d45ac20
Merge branch 'age_of_air' of github.com:fvitt/CAM into age_of_air
fvitt Aug 30, 2024
aab7bc0
update ctsm tag to ctsm5.2.027
fvitt Aug 30, 2024
0f09026
fix initialization of vert
fvitt Aug 30, 2024
c87b956
ChangeLog draft
fvitt Aug 30, 2024
734501a
ChangeLog update
fvitt Sep 2, 2024
defecea
ChangeLog update
fvitt Sep 3, 2024
29f2795
Merge pull request #1140 from fvitt/ctsm_update
fvitt Sep 3, 2024
01c9a7a
Merge remote-tracking branch 'ESCOMP/cam_development' into dust_emiss…
fvitt Sep 3, 2024
6836220
remove obsolete AOA1 and AOA2 history fields from use cases
fvitt Sep 3, 2024
28e02f1
Increase time for HEMCO test
fvitt Sep 3, 2024
1ea1baa
Remove soil_erod setting when Leung is used in buld dust; ChangeLog d…
fvitt Sep 3, 2024
556f4f2
remove zero cflx settings
fvitt Sep 3, 2024
a950fae
change megan setting appease the atm lnd drv_flds_in compare
fvitt Sep 3, 2024
c424825
Override LND_SETS_DUST_EMIS_DRV_FLDS only for cam7/clm6
fvitt Sep 4, 2024
e7627ac
update ChangeLog
fvitt Sep 4, 2024
d125217
Merge pull request #1104 from fvitt/dust_emissions
fvitt Sep 4, 2024
7974fb6
Merge remote-tracking branch 'ESCOMP/cam_development' into age_of_air
fvitt Sep 4, 2024
bb461b4
ChangeLog draft
fvitt Sep 5, 2024
0551e65
Increase wall clock time for AOA test
fvitt Sep 5, 2024
b294063
Update UBC file for FLTHIST compset
fvitt Sep 5, 2024
cef4761
remove debug write statement
fvitt Sep 5, 2024
e4adee0
ChangeLog update
fvitt Sep 5, 2024
536a7b8
merge to head of cam_development
peverwhee Sep 5, 2024
9208a6e
bring submodules up to date
peverwhee Sep 5, 2024
0e2ae4a
ChangeLog update
fvitt Sep 6, 2024
665aae9
Merge pull request #1110 from fvitt/age_of_air
fvitt Sep 6, 2024
36fefbd
Merge tag 'cam6_4_029' into psl
cacraigucar Sep 6, 2024
688faa5
ChangeLog for cam6_4_030
cacraigucar Sep 6, 2024
06d91f7
Merge pull request #1128 from brian-eaton/psl
cacraigucar Sep 6, 2024
85df2b1
Make changes found during code review.
nusbaume Sep 8, 2024
4291cb0
Merge remote-tracking branch 'upstream/cam_development' into misc05
nusbaume Sep 8, 2024
a4608fd
Fix typo.
nusbaume Sep 9, 2024
1f213cc
Finalize ChangeLog.
nusbaume Sep 9, 2024
9f0cb73
Merge pull request #1131 from brian-eaton/misc05
nusbaume Sep 9, 2024
ae3a2b8
merge to head of cam_development; initial changelog
peverwhee Sep 9, 2024
6b00a9e
final changelog
peverwhee Sep 10, 2024
98c35fc
Merge pull request #1084 from brian-eaton/cosp-cwat2
peverwhee Sep 10, 2024
a0db53f
Merge tag 'cam6_4_030' into add_v8mpasfiles
gdicker1 Sep 11, 2024
8306f7f
Merge tag 'cam6_4_032' into add_v8mpasfiles
gdicker1 Sep 11, 2024
b36ac16
Use the correct name for the mpasa480 notopo file
gdicker1 Sep 12, 2024
123d0fc
Remove mpasa30 L58 and L93 ncdata files
gdicker1 Sep 13, 2024
3c63318
Update ChangeLog with Derecho and Izumi tests
gdicker1 Sep 13, 2024
fa94177
Merge pull request #1029 from gdicker1/add_v8mpasfiles
gdicker1 Sep 13, 2024
28ea31b
Merge tag cam6_4_033 from ESCOMP/CAM into 'ew-develop'
gdicker1 Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 31 additions & 223 deletions .github/scripts/branch_pr_issue_closer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

import re
import sys
import subprocess
import shlex
import argparse

from github import Github
Expand All @@ -31,42 +29,6 @@
#HELPER FUNCTIONS
#################

#+++++++++++++++++++++++++++++++++++++++++
#Curl command needed to move project cards
#+++++++++++++++++++++++++++++++++++++++++

def project_card_move(oa_token, column_id, card_id):

"""
Currently pyGithub doesn't contain the methods required
to move project cards from one column to another, so
the unix curl command must be called directly, which is
what this function does.
The specific command-line call made is:
curl -H "Authorization: token OA_token" -H \
"Accept: application/vnd.github.inertia-preview+json" \
-X POST -d '{"position":"top", "column_id":<column_id>}' \
https://api.github.com/projects/columns/cards/<card_id>/moves
"""

#create required argument strings from inputs:
github_oa_header = ''' "Authorization: token {0}" '''.format(oa_token)
github_url_str = '''https://api.github.com/projects/columns/cards/{0}/moves'''.format(card_id)
json_post_inputs = ''' '{{"position":"top", "column_id":{}}}' '''.format(column_id)

#Create curl command line string:
curl_cmdline = '''curl -H '''+github_oa_header+''' -H "Accept: application/vnd.github.inertia-preview+json" -X POST -d '''+\
json_post_inputs+''' '''+github_url_str

#Split command line string into argument list:
curl_arg_list = shlex.split(curl_cmdline)

#Run command using subprocess:
subprocess.run(curl_arg_list, check=True)

#++++++++++++++++++++++++++++++
#Input Argument parser function
#++++++++++++++++++++++++++++++
Expand Down Expand Up @@ -101,7 +63,7 @@ def end_script(msg):
"""
Prints message to screen, and then exits script.
"""
print("\n{}\n".format(msg))
print(f"\n{msg}\n")
print("Issue closing check has completed successfully.")
sys.exit(0)

Expand Down Expand Up @@ -137,11 +99,10 @@ def _main_prog():

ghub = Github(token)

#++++++++++++++++++++
#+++++++++++++++++++++
#Open ESCOMP/CAM repo
#++++++++++++++++++++
#+++++++++++++++++++++

#Official CAM repo:
cam_repo = ghub.get_repo("ESCOMP/CAM")

#+++++++++++++++++++++++++++++
Expand All @@ -162,6 +123,9 @@ def _main_prog():
#Search for merge text, starting at beginning of message:
commit_msg_match = pr_merge_pattern.match(commit_message)

#Initialize variables:
pr_num = 0

#Check if match exists:
if commit_msg_match is not None:
#If it does then pull out text immediately after message:
Expand All @@ -174,7 +138,7 @@ def _main_prog():
first_word = post_msg_word_list[0]

#Print merged pr number to screen:
print("Merged PR: {}".format(first_word))
print(f"Merged PR: {first_word}")

try:
#Try assuming the word is just a number:
Expand Down Expand Up @@ -251,27 +215,28 @@ def _main_prog():
pr_msg_lower = merged_pull.body.lower()

#search for at least one keyword:
word_matches = []
if keyword_pattern.search(pr_msg_lower) is not None:
#If at least one keyword is found, then determine location of every keyword instance:
word_matches = keyword_pattern.finditer(pr_msg_lower)
else:
endmsg = "Pull request was merged without using any of the keywords. Thus there are no issues to close."
end_script(endmsg)

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Extract issue and PR numbers associated with found keywords in merged PR message
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Extract issue and PR numbers associated with found keywords in merged PR message
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#create issue pattern ("the number symbol {#} + a number"),
#which ends with either a space, a comma, a period, or
#the end of the string itself:
issue_pattern = re.compile(r'#[0-9]+(\s|,|$)|.')

#Create new "close" issues list:
close_issues = list()
close_issues = []

#Create new "closed" PR list:
close_pulls = list()
close_pulls = []

#Search text right after keywords for possible issue numbers:
for match in word_matches:
Expand Down Expand Up @@ -299,13 +264,13 @@ def _main_prog():
#so set the issue number to one that will never be found:
issue_num = -9999

#Check that number is actually for an issue (as opposed to a PR):
if issue_num in open_issues:
#Add issue number to "close issues" list:
close_issues.append(issue_num)
elif issue_num in open_pulls:
#If in fact a PR, then add to PR list:
#Check if number is actually for a PR (as opposed to an issue):
if issue_num in open_pulls:
#Add PR number to "close pulls" list:
close_pulls.append(issue_num)
elif issue_num in open_issues:
#If in fact an issue, then add to "close issues" list:
close_issues.append(issue_num)

#If no issue numbers are present after any of the keywords, then exit script:
if not close_issues and not close_pulls:
Expand All @@ -322,183 +287,26 @@ def _main_prog():
print("PRs referenced by the merged PR: "+", ".join(\
str(pull) for pull in close_pulls))

#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Determine name of project associated with merged Pull Request
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#Pull-out all projects from repo:
projects = cam_repo.get_projects()

#Initalize modified project name:
proj_mod_name = None

#Loop over all repo projects:
for project in projects:
#Pull-out columns from each project:
proj_columns = project.get_columns()

#Loop over columns:
for column in proj_columns:

#check if column name is "Completed Tags"
if column.name == "Completed tags":
#If so, then extract cards:
cards = column.get_cards()

#Loop over cards:
for card in cards:
#Extract card content:
card_content = card.get_content()

#Next, check if card number exists and matches merged PR number:
if card_content is not None and card_content.number == pr_num:
#If so, and if Project name is None, then set string:
if proj_mod_name is None:
proj_mod_name = project.name
#Break out of card loop:
break

#If already set, then somehow merged PR is in two different projects,
#which is not what this script is expecting, so just exit:
endmsg = "Merged Pull Request found in two different projects, so script will do nothing."
end_script(endmsg)

#Print project name associated with merged PR:
print("merged PR project name: {}".format(proj_mod_name))

#++++++++++++++++++++++++++++++++++++++++
#Extract repo project "To do" card issues
#++++++++++++++++++++++++++++++++++++++++

#Initalize issue counting dictionary:
proj_issues_count = dict()

#Initalize issue id to project card id dictionary:
proj_issue_card_ids = dict()

#Initialize list for issues that have already been closed:
already_closed_issues = list()

#Loop over all repo projects:
for project in projects:

#Next, pull-out columns from each project:
proj_columns = project.get_columns()

#Loop over columns:
for column in proj_columns:
#Check if column name is "To do"
if column.name == "To do":
#If so, then extract cards:
cards = column.get_cards()

#Loop over cards:
for card in cards:
#Extract card content:
card_content = card.get_content()

#Next, check if card issue number matches any of the "close" issue numbers from the PR:
if card_content is not None and card_content.number in close_issues:

#If so, then check if issue number is already in proj_issues_count:
if card_content.number in proj_issues_count:
#Add one to project issue counter:
proj_issues_count[card_content.number] += 1

#Also add issue id and card id to id dictionary used for card move, if in relevant project:
if project.name == proj_mod_name:
proj_issue_card_ids[card_content.number] = card.id

else:
#If not, then append to project issues count dictionary:
proj_issues_count[card_content.number] = 1

#Also add issue id and card id to id dictionary used for card move, if in relevant project:
if project.name == proj_mod_name:
proj_issue_card_ids[card_content.number] = card.id

#Otherwise, check if column name matches "closed issues" column:
elif column.name == "closed issues" and project.name == proj_mod_name:
#Save column id:
column_target_id = column.id

#Extract cards:
closed_cards = column.get_cards()

#Loop over cards:
for closed_card in closed_cards:
#Extract card content:
closed_card_content = closed_card.get_content()

#Check if card issue number matches any of the "close" issue numbers from the PR:
if closed_card_content is not None and closed_card_content.number in close_issues:
#If issue number matches, then it likely means the same
#commit message or issue number reference was used in multiple
#pushes to the same repo (e.g., for a PR and then a tag). Thus
#the issue should be marked as "already closed":
already_closed_issues.append(closed_card_content.number)

#Remove all issues from issue dictionary that are "already closed":
for already_closed_issue_num in already_closed_issues:
if already_closed_issue_num in proj_issues_count:
proj_issues_count.pop(already_closed_issue_num)

#If no project cards are found that match the issue, then exit script:
if not proj_issues_count:
endmsg = "No project cards match the issue being closed, so the script will do nothing."
end_script(endmsg)
#++++++++++++++++++++++++++++++++++++++++++++++
#Attempt to close all referenced issues and PRs
#++++++++++++++++++++++++++++++++++++++++++++++

#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Check if the number of "To-do" project cards matches the total number
#of merged PRs for each 'close' issue.
#
#Then, close all issues for which project cards equals merged PRs
#
#If not, then simply move the project card to the relevant project's
#"closed issues" column.
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#Loop over project issues and counts that have been "closed" by merged PR:
for issue_num, issue_count in proj_issues_count.items():

#If issue count is just one, then close issue:
if issue_count == 1:
#Extract github issue object:
cam_issue = cam_repo.get_issue(number=issue_num)
#Close issue:
cam_issue.edit(state='closed')
print("Issue #{} has been closed.".format(issue_num))
else:
#Extract card id from id dictionary:
if issue_num in proj_issue_card_ids:
card_id = proj_issue_card_ids[issue_num]
else:
#If issue isn't in dictionary, then it means the issue
#number was never found in the "To do" column, which
#likely means the user either referenced the wrong
#issue number, or the issue was never assigned to the
#project. Warn user and then exit with a non-zero
#error so that the Action fails:
endmsg = 'Issue #{} was not found in the "To Do" Column of the "{}" project.\n' \
'Either the wrong issue number was referenced, or the issue was never ' \
'attached to the project.'.format(issue_num, proj_mod_name)
print(endmsg)
sys.exit(1)

#Then move the card on the relevant project page to the "closed issues" column:
project_card_move(token.strip(), column_target_id, card_id)

#++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Finally, close all Pull Requests in "close_pulls" list:
#++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Loop over referenced issues:
for issue_num in close_issues:
#Extract github issue object:
cam_issue = cam_repo.get_issue(number=issue_num)
#Close issue:
cam_issue.edit(state='closed')
print(f"Issue #{issue_num} has been closed.")

#Loop over referenced PRs:
for pull_num in close_pulls:
#Extract Pull request object:
cam_pull = cam_repo.get_pull(number=pull_num)

#Close Pull Request:
cam_pull.edit(state='closed')
print("Pull Request #{} has been closed.".format(pull_num))
print(f"Pull Request #{pull_num} has been closed.")

#++++++++++
#End script
Expand Down
9 changes: 4 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
[submodule "atmos_phys"]
path = src/atmos_phys
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = atmos_phys0_03_000
fxtag = atmos_phys0_04_001
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics

Expand Down Expand Up @@ -151,7 +151,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git
[submodule "cdeps"]
path = components/cdeps
url = https://github.com/ESCOMP/CDEPS.git
fxtag = cdeps1.0.45
fxtag = cdeps1.0.48
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git

Expand All @@ -172,14 +172,14 @@ fxDONOTUSEurl = https://github.com/NCAR/ParallelIO
[submodule "cice"]
path = components/cice
url = https://github.com/ESCOMP/CESM_CICE
fxtag = cesm_cice6_5_0_10
fxtag = cesm_cice6_5_0_12
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CESM_CICE

[submodule "clm"]
path = components/clm
url = https://github.com/ESCOMP/CTSM
fxtag = ctsm5.2.009
fxtag = ctsm5.2.027
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CTSM

Expand All @@ -189,4 +189,3 @@ url = https://github.com/ESCOMP/FMS_interface
fxtag = fi_240516
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/FMS_interface

Loading