Skip to content

Commit

Permalink
WIP: need sdformat check
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
  • Loading branch information
j-rivero committed May 21, 2024
1 parent 141d6b0 commit 449e5e3
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,24 @@ def sanity_check_bump_linux(source_tarball_uri):
error('--only-bump-revision-linux needs --source-tarball-uri argument'
'to call builders and not source generation')

def sanity_checks_tag_right_branch(args):
if needs_repo_tag(args):

def needs_repo_tag(args):
if NIGHTLY or args.source_tarball_uri:
return False

return True if not args.source_repo_ref else False


def sanity_checks_tag_right_branch(package_name):
# Expect to find same branch than package name
out, _ = check_call(['git', 'branch', '--show-current'],
IGNORE_DRY_RUN)
current_branch = out.decode().strip()
if current_branch != package_name:
error(f'Current local branch to tag the release is: '
f'"{current_branch}" but package name is : '
f'"{package_name}". They usally match. If you '
'are sure about this, use --no-sanity-checks')


def sanity_checks(args, repo_dir):
Expand All @@ -320,6 +336,9 @@ def sanity_checks(args, repo_dir):
sanity_package_name(repo_dir, args.package, args.package_alias)
sanity_check_repo_name(args.upload_to_repository)

if (needs_repo_tag(args)):
sanity_checks_tag_right_branch(args.package)

if (args.bump_rev_linux_only):
sanity_check_bump_linux(args.source_tarball_uri)

Expand Down Expand Up @@ -408,10 +427,6 @@ def check_call(cmd, ignore_dry_run=False):
return out, err


def needs_repo_tag(args):
return not args.source_repo_ref


def tag_repo(args):
try:
# tilde is not a valid character in git
Expand Down

0 comments on commit 449e5e3

Please sign in to comment.