message: LTS compatibility: cope with `daily-` tags
diff: @@ -21,6 +21,7 @@ REPOSITORY_NAME = "microsoft/CCF"
  REMOTE_URL = f"https://github.com/{REPOSITORY_NAME}"
  BRANCH_RELEASE_PREFIX = "release/"
  TAG_RELEASE_PREFIX = "ccf-"
  +TAG_DAILY_RELEASE_PREFIX = "daily-"
  TAG_DEVELOPMENT_SUFFIX = "-dev"
  TAG_RELEASE_CANDIDATE_SUFFIX = "-rc"
  MAIN_BRANCH_NAME = "main"
  @@ -53,6 +54,10 @@ def is_release_tag(tag_name):
  return tag_name.startswith(TAG_RELEASE_PREFIX)
  +def is_latest_release_tag(tag_name):
  + return tag_name.startswith(TAG_DAILY_RELEASE_PREFIX)
  +
  +
  def strip_release_branch_name(branch_name):
  assert is_release_branch(branch_name), branch_name
  return branch_name[len(BRANCH_RELEASE_PREFIX) :]
  @@ -74,6 +79,12 @@ def strip_backport_prefix(branch_name):
  return branch_name
  +def get_branch_name_from_latest_release_tag_name(tag_name):
  + assert is_latest_release_tag(tag_name), tag_name
  + branch = tag_name[len(TAG_DAILY_RELEASE_PREFIX) :]
  + return branch if branch == MAIN_BRANCH_NAME else f"{BRANCH_RELEASE_PREFIX}{branch}"
  +
  +
  def get_major_version_from_release_branch_name(full_branch_name):
  return int(strip_release_branch_name(full_branch_name).split(".")[0])
  @@ -103,7 +114,9 @@ def sanitise_branch_name(branch_name):
  # For simplification, assume that dev tags are only released from main branch
  LOG.debug(f"Considering dev tag {branch_name} as {MAIN_BRANCH_NAME} branch")
  return MAIN_BRANCH_NAME
  - elif is_release_tag(branch_name):
  + elif is_release_tag(branch_name) or is_latest_release_tag(branch_name):
  + if is_latest_release_tag(branch_name):
  + return get_branch_name_from_latest_release_tag_name(branch_name)
  tag_major_version = get_version_from_tag_name(branch_name)
  if tag_major_version == 0:
  return MAIN_BRANCH_NAME
  @@ -483,6 +496,18 @@ if __name__ == "__main__":
  env.mut(local="unknown_branch"),
  exp(prev="ccf-3.0.0"),
  ), # Non-release branch
  + (
  + env.mut(tag="daily-main"),
  + exp(prev="ccf-3.0.0", same=None),
  + ), # Latest release tag
  + (
  + env.mut(tag="daily-2.x"),
  + exp(prev="ccf-1.0.1", same="ccf-2.0.2"),
  + ), # Latest release tag (2.x)
  + (
  + env.mut(tag="daily-3.x"),
  + exp(prev="ccf-2.0.2", same="ccf-3.0.0"),
  + ), # Latest release tag (3.x)
  ]
  for e, exp in test_scenario:
  