Skip to content
Snippets Groups Projects
Commit 218b9d6b authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

prepare_release_notes: minor fixes for numbered releases

- make the repository configurable for testing
- fix running without token
- print URL after release was created
parent 721d7438
No related branches found
No related tags found
14 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!76089prepare_release_notes: minor fixes for numbered releases,!75127Draft: Seeder types rebase2 grid fix
......@@ -29,6 +29,7 @@ try:
except ImportError:
gitlab_available = False
repo = 'atlas/athena' # change this for testing
def main():
parser = argparse.ArgumentParser(description=__doc__,
......@@ -87,6 +88,7 @@ def main():
print('Are you running this script from within the athena/ directory?')
exit(1)
# If possible, use Gitlab
gl = None
gl_project = None
if args.token and gitlab_available:
if verbose: print('Trying to connect to gitlab using the supplied token')
......@@ -97,7 +99,7 @@ def main():
except Exception as err:
print(f"Authentication failed. {err=}, {type(err)=}")
exit(1)
gl_project = gl.projects.get("atlas/athena")
gl_project = gl.projects.get(repo)
print('Retrieving the list of MRs (run with --verbose to get more output while this is happening).')
merged_mrs = parse_mrs_from_log(output_log['stdout'].decode("utf-8"),
......@@ -132,7 +134,7 @@ def main():
except Exception as err:
print(f"Failed to create tag or release. {err=}, {type(err)=}")
exit(1)
print('Just created the following release:', release)
print(f'Created the following release: https://gitlab.cern.ch/{repo}/-/releases/{release.name}')
# Create a Draft sweep MR in GitLab
if args.sweep and args.token and gitlab_available:
......@@ -334,7 +336,7 @@ the previous release {previous_release_link:s}:
Link to the full diff between {target_release_link:s} and
{previous_release_link:s}
is available at
https://gitlab.cern.ch/atlas/athena/compare/{previous_release:s}...{target_release:s}
https://gitlab.cern.ch/{repo:s}/compare/{previous_release:s}...{target_release:s}
"""
def sweep_template():
......@@ -395,7 +397,7 @@ def fill_template(template, target_release, nightly_tag, optional_message, previ
[" * %s" % mr for mr in merged_mrs]) if merged_mrs else '* None'
def formatted_tag_link(tag=''):
base_url = 'https://gitlab.cern.ch/atlas/athena/tags'
base_url = f'https://gitlab.cern.ch/{repo}/tags'
return "[%s](%s)" % (tag, base_url+'/'+tag)
filled_template = template.format(**{'target_release': target_release,
......@@ -403,6 +405,7 @@ def fill_template(template, target_release, nightly_tag, optional_message, previ
'nightly_tag': nightly_tag,
'nightly_tag_link': formatted_tag_link(nightly_tag),
'optional_message': optional_message,
'repo' : repo,
'previous_release': previous_release,
'previous_release_link': formatted_tag_link(previous_release),
'formatted_list_of_merge_requests': formatted_mrs})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment