Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Add parser for the datetime to allow us to pass commit times manually…
…. This enables passing the commit timestamp without calling to git.
  • Loading branch information
LoopedBard3 committed Sep 22, 2022
commit f98340afb75a43b88d0edd79457f25cdc0510dd4
12 changes: 11 additions & 1 deletion scripts/ci_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import os
import sys


from dateutil import parser as date_parser
from subprocess import check_output

from performance.common import get_repo_root_path
Expand Down Expand Up @@ -94,6 +96,13 @@ def add_arguments(parser: ArgumentParser) -> ArgumentParser:
type=str,
help='Product commit sha.'
)
parser.add_argument(
'--commit-time',
dest='commit_time',
required=False,
type=str,
help='Product commit time.'
)
parser.add_argument(
'--repository',
dest='repository',
Expand Down Expand Up @@ -309,7 +318,8 @@ def __main(args: list) -> int:
target_framework_moniker = dotnet.FrameworkAction.get_target_framework_moniker(framework)
dotnet_version = dotnet.get_dotnet_version(target_framework_moniker, args.cli) if args.dotnet_versions == [] else args.dotnet_versions[0]
commit_sha = dotnet.get_dotnet_sdk(target_framework_moniker, args.cli) if args.commit_sha is None else args.commit_sha
source_timestamp = dotnet.get_commit_date(target_framework_moniker, commit_sha, repo_url)
timestamp_value = dotnet.get_commit_date(target_framework_moniker, commit_sha, repo_url) if args.commit_time is None else args.commit_time
source_timestamp = date_parser.parse(timestamp_value).strftime('%Y-%m-%dT%H:%M:%SZ')

branch = ChannelMap.get_branch(args.channel) if not args.branch else args.branch

Expand Down