Skip to content

Commit

Permalink
historic releases had a short git commit with 7 chars, now we have 8
Browse files Browse the repository at this point in the history
  • Loading branch information
yeoldegrove committed Oct 23, 2024
1 parent d70cf91 commit d07bce4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions glrd/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"type": "object",
"properties": {
"commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"commit_short": {"type": "string", "pattern": "^[0-9a-f]{7}$"}
"commit_short": {"type": "string", "pattern": "^[0-9a-f]{7,8}$"}
},
"required": ["commit", "commit_short"]
},
Expand Down Expand Up @@ -167,7 +167,7 @@
"type": "object",
"properties": {
"commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"commit_short": {"type": "string", "pattern": "^[0-9a-f]{7}$"}
"commit_short": {"type": "string", "pattern": "^[0-9a-f]{7,8}$"}
},
"required": ["commit", "commit_short"]
}
Expand Down Expand Up @@ -198,7 +198,7 @@
"type": "object",
"properties": {
"commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"commit_short": {"type": "string", "pattern": "^[0-9a-f]{7}$"}
"commit_short": {"type": "string", "pattern": "^[0-9a-f]{7,8}$"}
},
"required": ["commit", "commit_short"]
}
Expand Down Expand Up @@ -249,7 +249,7 @@ def get_git_commit_from_tag(tag):
sys.exit(ERROR_CODES["subprocess_output_missing"])

commit = result.stdout.strip()
return commit, commit[:7] # Return full commit and shortened version
return commit, commit[:8] # Return full commit and shortened version
except Exception as e:
logging.error(f"Error fetching git commit for tag {tag}: {e}")
sys.exit(ERROR_CODES["subprocess_output_error"])
Expand Down Expand Up @@ -318,7 +318,7 @@ def get_git_commit_at_time(date, time="08:00", branch="main", remote_repo="https
logging.error(f"No commit found for {date} at {time}")
sys.exit(ERROR_CODES["subprocess_output_missing"])

return commit, commit[:7]
return commit, commit[:8]

def get_garden_version_for_date(release_type, date, existing_releases):
"""
Expand Down Expand Up @@ -512,7 +512,7 @@ def create_single_release(release_type, args, existing_releases):
if len(commit) != 40:
logging.error("Error: Invalid commit hash. Must be 40 characters.")
sys.exit(ERROR_CODES["validation_error"])
commit_short = commit[:7]
commit_short = commit[:8]
else:
commit, commit_short = get_git_commit_at_time(lifecycle_released_isodate)

Expand Down

0 comments on commit d07bce4

Please sign in to comment.