Skip to content

Commit

Permalink
Merge pull request #250 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: Merge Develop into Main for release
  • Loading branch information
mathomp4 authored Jan 25, 2023
2 parents 09018c2 + c42ed15 commit 1b21435
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 23 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

## [1.49.0] - 2023-01-25

### Changed

- When running `compare` in default mode, size columns based on the longest branch name of a repo that has changed. This prevents
odd column widths based on long branch names in repos that haven't changed

## [1.48.0] - 2022-12-09

### Added
Expand Down
24 changes: 20 additions & 4 deletions mepo.d/command/compare/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def run(args):
if not any_differing_repos(allcomps):
print(f'No repositories have changed')
else:
max_namelen, max_origlen = calculate_header_lengths(allcomps)
max_namelen, max_origlen = calculate_header_lengths(allcomps, args.all)
print_header(max_namelen, max_origlen)
for comp in allcomps:
git = GitRepository(comp.remote, comp.local)
Expand All @@ -39,14 +39,30 @@ def any_differing_repos(allcomps):

return False

def calculate_header_lengths(allcomps):
def calculate_header_lengths(allcomps, all_repos=False):
names = []
versions = []
for comp in allcomps:
git = GitRepository(comp.remote, comp.local)
names.append(comp.name)
versions.append(version_to_string(comp.version,git))

# We want to base the display on changed repos
# if we don't ask for all repos
if not all_repos:
curr_ver = version_to_string(git.get_version(),git)
orig_ver = version_to_string(comp.version,git)

# This command is to try and work with git tag oddities
curr_ver = sanitize_version_string(orig_ver,curr_ver,git)

if curr_ver not in orig_ver:
names.append(comp.name)
versions.append(version_to_string(comp.version,git))
else:
names.append(comp.name)
versions.append(version_to_string(comp.version,git))
max_namelen = len(max(names, key=len))
# Note: max_namelen could be 3 characters but we want at least 4 for "Repo"
max_namelen = max(max_namelen, 4)
max_origlen = len(max(versions, key=len))
return max_namelen, max_origlen

Expand Down
10 changes: 5 additions & 5 deletions mepo.d/utest/output/compare_brief_output.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Repo | Original | Current
---------------------- | -------------------------------- | -------
env | (t) v3.13.0 (DH) | (b) main
cmake | (t) v3.12.0 (DH) | (b) develop
fvdycore | (t) geos/v1.3.0 (DH) | (b) geos/develop
Repo | Original | Current
-------- | -------------------- | -------
env | (t) v4.8.0 (DH) | (b) main
cmake | (t) v3.21.0 (DH) | (b) develop
fvdycore | (t) geos/v1.5.0 (DH) | (b) geos/develop
16 changes: 8 additions & 8 deletions mepo.d/utest/output/compare_full_output.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Repo | Original | Current
---------------------- | -------------------------------- | -------
GEOSfvdycore | (t) v1.5.0 (DH) | (t) v1.5.0 (DH)
env | (t) v3.13.0 (DH) | (b) main
cmake | (t) v3.12.0 (DH) | (b) develop
ecbuild | (t) geos/v1.2.0 (DH) | (t) geos/v1.2.0 (DH)
GMAO_Shared | (t) v1.5.3 (DH) | (t) v1.5.3 (DH)
MAPL | (t) v2.19.0 (DH) | (t) v2.19.0 (DH)
GEOSfvdycore | (t) v1.13.0 (DH) | (t) v1.13.0 (DH)
env | (t) v4.8.0 (DH) | (b) main
cmake | (t) v3.21.0 (DH) | (b) develop
ecbuild | (t) geos/v1.3.0 (DH) | (t) geos/v1.3.0 (DH)
GMAO_Shared | (t) v1.6.3 (DH) | (t) v1.6.3 (DH)
MAPL | (t) v2.33.0 (DH) | (t) v2.33.0 (DH)
FMS | (t) geos/2019.01.02+noaff.8 (DH) | (t) geos/2019.01.02+noaff.8 (DH)
FVdycoreCubed_GridComp | (t) v1.6.0 (DH) | (t) v1.6.0 (DH)
fvdycore | (t) geos/v1.3.0 (DH) | (b) geos/develop
FVdycoreCubed_GridComp | (t) v1.12.1 (DH) | (t) v1.12.1 (DH)
fvdycore | (t) geos/v1.5.0 (DH) | (b) geos/develop
10 changes: 5 additions & 5 deletions mepo.d/utest/output/status_output.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Checking status...
GEOSfvdycore | (t) v1.5.0 (DH)
GEOSfvdycore | (t) v1.13.0 (DH)
env | (b) main
cmake | (b) develop
ecbuild | (t) geos/v1.2.0 (DH)
GMAO_Shared | (t) v1.5.3 (DH)
MAPL | (t) v2.19.0 (DH)
ecbuild | (t) geos/v1.3.0 (DH)
GMAO_Shared | (t) v1.6.3 (DH)
MAPL | (t) v2.33.0 (DH)
FMS | (t) geos/2019.01.02+noaff.8 (DH)
FVdycoreCubed_GridComp | (t) v1.6.0 (DH)
FVdycoreCubed_GridComp | (t) v1.12.1 (DH)
fvdycore | (b) geos/develop
2 changes: 1 addition & 1 deletion mepo.d/utest/test_mepo_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setUpClass(cls):
cls.input_dir = os.path.join(THIS_DIR, 'input')
cls.output_dir = os.path.join(THIS_DIR, 'output')
cls.fixture = 'GEOSfvdycore'
cls.tag = 'v1.5.0'
cls.tag = 'v1.13.0'
cls.tmpdir = os.path.join(THIS_DIR, 'tmp')
cls.fixture_dir = os.path.join(cls.tmpdir, cls.fixture)
if os.path.isdir(cls.fixture_dir):
Expand Down

0 comments on commit 1b21435

Please sign in to comment.