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

cam6_4_018: Update git-fleximod to 8.4 and add fleximod_test workflow #1107

Merged
merged 4 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/workflows/fleximod_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on: pull_request

jobs:
fleximod-test:
runs-on: ubuntu-latest
strategy:
matrix:
# oldest supported and latest supported
python-version: ["3.7", "3.x"]
steps:
- id: checkout-CESM
uses: actions/checkout@v4
- id: run-fleximod
run: |
$GITHUB_WORKSPACE/bin/git-fleximod update
$GITHUB_WORKSPACE/bin/git-fleximod test
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3


2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ path = components/cice
url = https://github.com/ESCOMP/CESM_CICE
fxtag = cesm_cice6_5_0_10
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NCAR/ParallelIO
fxDONOTUSEurl = https://github.com/ESCOMP/CESM_CICE

[submodule "clm"]
path = components/clm
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/git_fleximod/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import argparse
from git_fleximod import utils

__version__ = "0.8.2"
__version__ = "0.8.4"

def find_root_dir(filename=".gitmodules"):
""" finds the highest directory in tree
Expand Down
15 changes: 8 additions & 7 deletions .lib/git-fleximod/git_fleximod/git_fleximod.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,19 @@ def submodules_status(gitmodules, root_dir, toplevel=False, depth=0):
submod = init_submodule_from_gitmodules(gitmodules, name, root_dir, logger)

result,n,l,t = submod.status()
testfails += t
localmods += l
needsupdate += n
if toplevel or not submod.toplevel():
print(wrapper.fill(result))
subdir = os.path.join(root_dir, submod.path)
if os.path.exists(os.path.join(subdir, ".gitmodules")):
submod = GitModules(logger, confpath=subdir)
t,l,n = submodules_status(submod, subdir, depth=depth+1)
testfails += t
localmods += l
needsupdate += n
subdir = os.path.join(root_dir, submod.path)
if os.path.exists(os.path.join(subdir, ".gitmodules")):
gsubmod = GitModules(logger, confpath=subdir)
t,l,n = submodules_status(gsubmod, subdir, depth=depth+1)
if toplevel or not submod.toplevel():
testfails += t
localmods += l
needsupdate += n

return testfails, localmods, needsupdate

Expand Down
33 changes: 23 additions & 10 deletions .lib/git-fleximod/git_fleximod/submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def status(self):
needsupdate = True
else:
result = f"e {self.name:>20} has no fxtag defined in .gitmodules{optional}"
testfails = True
testfails = False
else:
with utils.pushd(smpath):
git = GitInterface(smpath, self.logger)
Expand All @@ -103,15 +103,23 @@ def status(self):
needsupdate = True
return result, needsupdate, localmods, testfails
rurl = git.git_operation("ls-remote","--get-url").rstrip()
line = git.git_operation("log", "--pretty=format:\"%h %d").partition('\n')[0]
line = git.git_operation("log", "--pretty=format:\"%h %d\"").partition('\n')[0]
parts = line.split()
ahash = parts[0][1:]
atag = None
if len(parts) > 3:
atag = parts[3][:-1]
else:
atag = None
idx = 0
while idx < len(parts)-1:
idx = idx+1
if parts[idx] == 'tag:':
atag = parts[idx+1]
while atag.endswith(')') or atag.endswith(',') or atag.endswith("\""):
atag = atag[:-1]
if atag == self.fxtag:
break


#print(f"line is {line} ahash is {ahash} atag is {atag}")
#print(f"line is {line} ahash is {ahash} atag is {atag} {parts}")
# atag = git.git_operation("describe", "--tags", "--always").rstrip()
# ahash = git.git_operation("rev-list", "HEAD").partition("\n")[0]

Expand All @@ -122,9 +130,11 @@ def status(self):
if self.fxtag and atag == self.fxtag:
result = f" {self.name:>20} at tag {self.fxtag}"
recurse = True
elif self.fxtag and ahash[: len(self.fxtag)] == self.fxtag:
testfails = False
elif self.fxtag and (ahash[: len(self.fxtag)] == self.fxtag or (self.fxtag.find(ahash)==0)):
result = f" {self.name:>20} at hash {ahash}"
recurse = True
testfails = False
elif atag == ahash:
result = f" {self.name:>20} at hash {ahash}"
recurse = True
Expand All @@ -133,14 +143,17 @@ def status(self):
testfails = True
needsupdate = True
else:
result = f"e {self.name:>20} has no fxtag defined in .gitmodules, module at {atag}"
testfails = True
if atag:
result = f"e {self.name:>20} has no fxtag defined in .gitmodules, module at {atag}"
else:
result = f"e {self.name:>20} has no fxtag defined in .gitmodules, module at {ahash}"
testfails = False

status = git.git_operation("status", "--ignore-submodules", "-uno")
if "nothing to commit" not in status:
localmods = True
result = "M" + textwrap.indent(status, " ")

# print(f"result {result} needsupdate {needsupdate} localmods {localmods} testfails {testfails}")
return result, needsupdate, localmods, testfails


Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "git-fleximod"
version = "0.8.2"
version = "0.8.4"
description = "Extended support for git-submodule and git-sparse-checkout"
authors = ["Jim Edwards <[email protected]>"]
maintainers = ["Jim Edwards <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
github_url = "https://github.com/jedwards4b/git-fleximod/"

[version]
current = "0.8.2"
current = "0.8.4"

# Example of a semver regexp.
# Make sure this matches current_version before
Expand Down
68 changes: 68 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,73 @@
===============================================================

Tag name: cam6_4_018
Originator(s): peverwhee, jedwards4b
Date: 30 July 2024
One-line Summary: Update git-fleximod to 8.4 and add fleximod_test workflow
Github PR URL: https://github.com/ESCOMP/CAM/pull/1107

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
- Issue #1113 - Add git-fleximod github CI workflow

Describe any changes made to build system: update git-fleximod

Describe any changes made to the namelist: none

List any changes to the defaults for the boundary datasets: none

Describe any substantial timing or memory changes: none

Code reviewed by: cacraigucar

List all files eliminated: none

List all files added and what they do:

A .github/workflows/fleximod_test.yaml
- add git-fleximod test github workflow

List all existing files that have been modified, and describe the changes:

M .gitmodules
- fix fxDONOTUSEurl for cice

M .lib/git-fleximod/git_fleximod/cli.py
M .lib/git-fleximod/git_fleximod/git_fleximod.py
M .lib/git-fleximod/git_fleximod/submodule.py
M .lib/git-fleximod/pyproject.toml
M .lib/git-fleximod/tbump.toml
- update git-fleximod to v8.4

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam:
ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
- pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856

SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: PEND) details:
SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: PEND) details:
- pre-existing failures -- need fix in CLM external

SMS_D_Ln9.T42_T42.FSCAM.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
- pre-existing failure -- need fix in CICE external

izumi/nag/aux_cam:

DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
- pre-existing failure - issue #670

izumi/gnu/aux_cam: All PASS

CAM tag used for the baseline comparison tests if different than previous
tag:

Summarize any changes to answers: BFB, as expected

===============================================================

Tag name: cam6_4_017
Originator(s): eaton
Date: 30 July 2024
Expand Down
Loading