You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2021/05/10 21:42:30 UTC

[solr-operator] branch release-0.3 updated: Various fixes for the release wizard and accompanying scripts. (#269)

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch release-0.3
in repository https://gitbox.apache.org/repos/asf/solr-operator.git


The following commit(s) were added to refs/heads/release-0.3 by this push:
     new 1ceed74  Various fixes for the release wizard and accompanying scripts. (#269)
1ceed74 is described below

commit 1ceed74c234a907b7ee366011510a475e4439c2b
Author: Houston Putman <ho...@apache.org>
AuthorDate: Mon May 10 16:41:08 2021 -0500

    Various fixes for the release wizard and accompanying scripts. (#269)
---
 hack/release/upload/upload_crds.sh     |   2 +
 hack/release/upload/upload_helm.sh     |   2 +
 hack/release/wizard/poll-mirrors.py    | 122 ++++++++++++++++-----------------
 hack/release/wizard/releaseWizard.py   |  20 ++++--
 hack/release/wizard/releaseWizard.yaml |  92 +++++++++++++++++++++----
 5 files changed, 158 insertions(+), 80 deletions(-)

diff --git a/hack/release/upload/upload_crds.sh b/hack/release/upload/upload_crds.sh
index fd7853f..44a46fa 100755
--- a/hack/release/upload/upload_crds.sh
+++ b/hack/release/upload/upload_crds.sh
@@ -97,6 +97,8 @@ echo "Pulling CRDs from the staged url and uploading to release location ${CRDS_
     # Download CRD files from the staged location
     wget -r -np -nH -nd --level=1 -A "*.yaml*" "${RELEASE_URL}/crds/"
 
+    rm -f robots.txt*
+
     # Create base release directory for CRDs
     curl "${WITH_APACHE_ID[@]}" -X MKCOL "${CRDS_FULL_URL}"
 
diff --git a/hack/release/upload/upload_helm.sh b/hack/release/upload/upload_helm.sh
index c463e7f..7e155ae 100755
--- a/hack/release/upload/upload_helm.sh
+++ b/hack/release/upload/upload_helm.sh
@@ -98,6 +98,8 @@ echo "Pulling Helm chart from the staged url and uploading to release Helm repo.
     # Pull Helm charts from staged location
     wget -r -np -nH -nd --level=1 -A "*.tgz*" "${RELEASE_URL}/helm-charts"
 
+    rm -f robots.txt*
+
     # Pull the official Helm repo index.yaml
     wget "${CHART_REPO}/index.yaml"
 
diff --git a/hack/release/wizard/poll-mirrors.py b/hack/release/wizard/poll-mirrors.py
index 606217f..f7011e3 100755
--- a/hack/release/wizard/poll-mirrors.py
+++ b/hack/release/wizard/poll-mirrors.py
@@ -98,68 +98,68 @@ def check_mirror(url):
     p('.')
     return None
   else:
-    p('\nFAIL: ' + url + '\n' if args.details else 'X')
+    # p('\nFAIL: ' + url + '\n')
+    p('X')
     return url
 
+if __name__ == '__main__':
+  desc = 'Periodically checks that all Solr mirrors contain either a copy of a release or a specified path'
+  parser = argparse.ArgumentParser(description=desc)
+  parser.add_argument('-version', '-v', help='Solr Operator version to check')
+  parser.add_argument('-path', '-p', help='instead of a versioned release, check for some/explicit/path')
+  parser.add_argument('-interval', '-i', help='seconds to wait before re-querying mirrors', type=int, default=300)
+  parser.add_argument('-once', '-o', help='run only once', action='store_true', default=False)
+  args = parser.parse_args()
 
-desc = 'Periodically checks that all Lucene/Solr mirrors contain either a copy of a release or a specified path'
-parser = argparse.ArgumentParser(description=desc)
-parser.add_argument('-version', '-v', help='Solr Operator version to check')
-parser.add_argument('-path', '-p', help='instead of a versioned release, check for some/explicit/path')
-parser.add_argument('-interval', '-i', help='seconds to wait before re-querying mirrors', type=int, default=300)
-parser.add_argument('-details', '-d', help='print missing mirror URLs', action='store_true', default=False)
-parser.add_argument('-once', '-o', help='run only once', action='store_true', default=False)
-args = parser.parse_args()
-
-if (args.version is None and args.path is None) \
-    or (args.version is not None and args.path is not None):
-  p('You must specify either -version or -path but not both!\n')
-  sys.exit(1)
-
-try:
-  conn = http.HTTPConnection('www.apache.org')
-  conn.request('GET', '/mirrors/')
-  response = conn.getresponse()
-  html = response.read()
-except Exception as e:
-  p('Unable to fetch the Apache mirrors list!\n')
-  sys.exit(1)
-
-mirror_path = args.path if args.path is not None else 'solr/solr-operator/{}/solr-operator-{}.tgz.sha512'.format(args.version, args.version)
-
-pending_mirrors = []
-for match in re.finditer('<TR>(.*?)</TR>', str(html), re.MULTILINE | re.IGNORECASE | re.DOTALL):
-  row = match.group(1)
-  if not '<TD>ok</TD>' in row:
-    # skip bad mirrors
-    continue
-
-  match = re.search('<A\s+HREF\s*=\s*"([^"]+)"\s*>', row, re.MULTILINE | re.IGNORECASE)
-  if match:
-    pending_mirrors.append(match.group(1) + mirror_path)
-
-total_mirrors = len(pending_mirrors)
-
-label = args.version if args.version is not None else args.path
-while True:
-  p('\n{:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now()))
-  p('\nPolling {} Apache Mirrors'.format(len(pending_mirrors)))
-  p('...\n')
-
-  start = time.time()
-  with Pool(processes=5) as pool:
-    pending_mirrors = list(filter(lambda x: x is not None, pool.map(check_mirror, pending_mirrors)))
-  stop = time.time()
-  remaining = args.interval - (stop - start)
-
-  available_mirrors = total_mirrors - len(pending_mirrors)
-
-  p('\n{} is downloadable from {}/{} Apache Mirrors ({:.2f}%)\n'
-    .format(label, available_mirrors, total_mirrors, available_mirrors * 100 / total_mirrors))
-  if len(pending_mirrors) == 0 or args.once == True:
-    break
-
-  if remaining > 0:
-    p('Sleeping for {:d} seconds...\n'.format(int(remaining + 0.5)))
-    time.sleep(remaining)
+  if (args.version is None and args.path is None) \
+      or (args.version is not None and args.path is not None):
+    p('You must specify either -version or -path but not both!\n')
+    sys.exit(1)
+
+  try:
+    conn = http.HTTPSConnection('www.apache.org')
+    conn.request('GET', '/mirrors/')
+    response = conn.getresponse()
+    html = response.read()
+  except Exception as e:
+    p('Unable to fetch the Apache mirrors list!\n')
+    sys.exit(1)
+
+  mirror_path = args.path if args.path is not None else 'solr/solr-operator/{}/solr-operator-{}.tgz'.format(args.version, args.version)
+
+  pending_mirrors = []
+  for match in re.finditer('<TR>(.*?)</TR>', str(html), re.MULTILINE | re.IGNORECASE | re.DOTALL):
+    row = match.group(1)
+    if not '<TD>ok</TD>' in row:
+      # skip bad mirrors
+      continue
+
+    match = re.search('<A\s+HREF\s*=\s*"([^"]+)"\s*>', row, re.MULTILINE | re.IGNORECASE)
+    if match:
+      pending_mirrors.append(match.group(1) + mirror_path)
+
+  total_mirrors = len(pending_mirrors)
+
+  label = args.version if args.version is not None else args.path
+  while True:
+    p('\n{:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now()))
+    p('\nPolling {} Apache Mirrors'.format(len(pending_mirrors)))
+    p('...\n')
+
+    start = time.time()
+    with Pool(processes=5) as pool:
+      pending_mirrors = list(filter(lambda x: x is not None, pool.map(check_mirror, pending_mirrors)))
+    stop = time.time()
+    remaining = args.interval - (stop - start)
+
+    available_mirrors = total_mirrors - len(pending_mirrors)
+
+    p('\n{} is downloadable from {}/{} Apache Mirrors ({:.2f}%)\n'
+      .format(label, available_mirrors, total_mirrors, available_mirrors * 100 / (1 if total_mirrors == 0 else total_mirrors) ))
+    if len(pending_mirrors) == 0 or args.once == True:
+      break
+
+    if remaining > 0:
+      p('Sleeping for {:d} seconds...\n'.format(int(remaining + 0.5)))
+      time.sleep(remaining)
 
diff --git a/hack/release/wizard/releaseWizard.py b/hack/release/wizard/releaseWizard.py
index 7bc851d..05555ef 100755
--- a/hack/release/wizard/releaseWizard.py
+++ b/hack/release/wizard/releaseWizard.py
@@ -100,6 +100,9 @@ def expand_jinja(text, vars=None):
         'gpg_key': state.get_gpg_key(),
         'epoch': unix_time_millis(datetime.utcnow()),
         'get_next_version': state.get_next_version(),
+        'get_next_major_version': state.get_next_major_version(),
+        'get_next_minor_version': state.get_next_minor_version(),
+        'get_next_bugfix_version': state.get_next_bugfix_version(),
         'current_git_rev': state.get_current_git_rev(),
         'keys_downloaded': keys_downloaded(),
         'editor': get_editor(),
@@ -580,11 +583,20 @@ class ReleaseState:
 
     def get_next_version(self):
         if self.release_type == 'major':
-            return "v%s.0.0" % (self.release_version_major + 1)
+            return self.get_next_major_version()
         if self.release_type == 'minor':
-            return "v%s.%s.0" % (self.release_version_major, self.release_version_minor + 1)
+            return self.get_next_minor_version()
         if self.release_type == 'bugfix':
-            return "v%s.%s.%s" % (self.release_version_major, self.release_version_minor, self.release_version_bugfix + 1)
+            return self.get_next_bugfix_version()
+
+    def get_next_major_version(self):
+        return "v%s.0.0" % (self.release_version_major + 1)
+
+    def get_next_minor_version(self):
+        return "v%s.%s.0" % (self.release_version_major, self.release_version_minor + 1)
+
+    def get_next_bugfix_version(self):
+        return "v%s.%s.%s" % (self.release_version_major, self.release_version_minor, self.release_version_bugfix + 1)
 
     def get_refguide_release(self):
         return "%s_%s" % (self.release_version_major, self.release_version_minor)
@@ -1949,7 +1961,7 @@ def vote_close_72h_holidays():
     return holidays if len(holidays) > 0 else None
 
 
-def prepare_announce_solr_operator(todo):
+def prepare_announce(todo):
     if not os.path.exists(solr_operator_news_file):
         solr_operator_text = expand_jinja("(( template=announce_solr_operator ))")
         with open(solr_operator_news_file, 'w') as fp:
diff --git a/hack/release/wizard/releaseWizard.yaml b/hack/release/wizard/releaseWizard.yaml
index 22c7048..08e4da3 100644
--- a/hack/release/wizard/releaseWizard.yaml
+++ b/hack/release/wizard/releaseWizard.yaml
@@ -80,10 +80,9 @@ templates:
   announce_solr_operator: |
     Title: Apache Solr Operatorâ„¢ {{ release_version }} available
     category: solr/operator/news
-    URL:
     save_as:
 
-    The Solr PMC is pleased to announce the release of the Apache Solr Operator {{ release_version }}.
+    The Apache Solr PMC is pleased to announce the release of the Apache Solr Operator {{ release_version }}.
 
     The Apache Solr Operator is a safe and easy way of managing a Solr ecosystem in Kubernetes.
 
@@ -91,6 +90,18 @@ templates:
 
       <https://solr.apache.org/operator/downloads.html>
 
+    ### Solr Operator {{ release_version }} Release Highlights:
+
+    * Copy from the draft release notes
+
+    A summary of important changes is published in the documentation at:
+
+      <https://apache.github.io/solr-operator/docs/upgrade-notes.html>
+
+    For the most exhaustive list, see the full release notes in the Github Releases or by viewing the git history in the solr-operator repo.
+
+      <https://github.com/apache/solr-operator/releases/tag/{{ release_version }}>
+
   announce_solr_operator_mail: |
     The template below can be used to announce the Solr Operator release to the
     internal mailing lists.
@@ -116,7 +127,7 @@ templates:
     (( template=announce_solr_operator_mail_body ))
     ----
   announce_solr_operator_mail_body: |
-    {% for line in load_lines(solr_news_file, 4) -%}
+    {% for line in load_lines(solr_operator_news_file, 4) -%}
     {{ line }}
     {%- endfor %}
 
@@ -124,7 +135,6 @@ templates:
     Note: The Apache Software Foundation uses an extensive mirroring network for
     distributing releases. It is possible that the mirror you are using may not have
     replicated the release yet. If that is the case, please try another mirror.
-    This also applies to Maven access.
 # TODOs belong to groups for easy navigation in menus. Todo objects may contain asciidoc
 # descriptions, a number of commands to execute, some links to display, user input to gather
 # etc. Here is the documentation of each type of object. For further details, please consult
@@ -959,7 +969,7 @@ groups:
 - !TodoGroup
   id: publish
   title: Publishing to the ASF Mirrors
-  description: Once the vote has passed, the release may be published to the ASF Mirrors and to Maven Central.
+  description: Once the vote has passed, the release may be published to the ASF Mirrors.
   todos:
   - !Todo
     id: tag_release
@@ -1013,7 +1023,7 @@ groups:
           cmd: git add -u .  && git commit -m "Add next patch version {{ next_version }}"
           logfile: commit-release-next-version.log
         - !Command
-          cmd: git push {{ release_branch }}
+          cmd: git push origin {{ release_branch }}
           comment: |
             This will push both the release commit as well as the commit to increase version.
             The release commit will correspond to the previously pushed tag.
@@ -1043,7 +1053,10 @@ groups:
     commands: !Commands
       root_folder: '{{ git_checkout_folder }}'
       confirm_each_command: false
-      commands_text: This will upload the staged Helm chart to the release location in nightlies.apache.org
+      commands_text: |
+        This will upload the staged Helm chart to the release location in nightlies.apache.org.
+        You will be prompted for your Apache password in the beggining, to use when uploading.
+        Next you will be prompted for your GPG Key passphrase, to sign the helm index.yaml.
       commands:
         - !Command
           cmd: ./hack/release/upload/upload_helm.sh -g "{{ gpg_key | default("<gpg_key_id>", True) }}" -a "{{ gpg.apache_id | default("<apache_id>", True) }}" -c "{{ official_helm_charts_url }}" -r "{{ dist_release_url }}"
@@ -1059,7 +1072,9 @@ groups:
     commands: !Commands
       root_folder: '{{ git_checkout_folder }}'
       confirm_each_command: false
-      commands_text: This will upload the staged CRDs to the release location in nightlies.apache.org
+      commands_text: |
+        This will upload the staged CRDs to the release location in nightlies.apache.org.
+        You will be prompted for your Apache password in the beggining, to use when uploading.
       commands:
         - !Command
           cmd: ./hack/release/upload/upload_crds.sh  -a "{{ gpg.apache_id | default('<apache_id>', True) }}" -c "{{ crds_release_url }}" -r "{{ dist_release_url }}" -v "{{ release_version }}"
@@ -1115,6 +1130,17 @@ groups:
       - !Command
         cmd: python3 -u hack/release/wizard/poll-mirrors.py -version {{ release_version }} -o
         live: true
+  - !Todo
+    id: check_artifact_hub
+    title: Check state of ArtifactHub entries
+    depends:
+      - publish_docker_image
+      - publish_helm_charts
+    description: |
+      Check to make sure that ArtifactHub has successfully loaded the {{ release_version }} Helm Chart.
+      Mark this as complete when you have confirmed all aspects of the chart in artifactHub.
+    links:
+      - https://artifacthub.io/packages/helm/apache-solr/solr-operator
 - !TodoGroup
   id: website
   title: Update the website
@@ -1282,7 +1308,7 @@ groups:
         cmd: git checkout main && git status
         stdout: true
       - !Command
-        cmd: git diff
+        cmd: git diff origin/main
         redirect: "{{ [release_folder, 'website.diff'] | path_join }}"
         comment: Make a diff of all edits. Will open in next step
       - !Command
@@ -1332,6 +1358,41 @@ groups:
       - https://ci2.apache.org/#/builders/3
       - https://solr.apache.org
       - https://solr.apache.org/operator
+  - !Todo
+    id: create_github_release
+    title: Create a Github Release
+    description: |
+      Create a github release named "{{ release_version }}" based off of the git tag "{{ release_version }}".
+      You can use the previous releases as a template.
+      (You can hit "edit" on a previous release, to get the markdown version of the notes to copy.)
+    links:
+      - https://github.com/apache/solr-operator/releases
+  - !Todo
+    id: migrate_docs_to_gh_pages
+    title: Migrate documentation to github pages.
+    commands: !Commands
+      root_folder: '{{ git_checkout_folder }}'
+      commands_text: Run these commands to copy the documentation to the repo's Github Pages site.
+      commands:
+        - !Command
+          cmd: git checkout gh-pages
+          stdout: true
+        - !Command
+          cmd: git rm -r *
+          comment: Delete all current docs
+          tee: true
+        - !Command
+          cmd: git checkout {{ release_version }} -- LICENSE NOTICE README.md docs example .gitignore
+          comment: Checkout relevant docs & examples from the release tag.
+          stdout: true
+        - !Command
+          cmd: git status
+          stdout: true
+          logfile: github-pages-status.log
+        - !Command
+          cmd: git commit -a -m "Upgrade documentation for {{ release_version }} release" && git push origin gh-pages
+          stdout: true
+          logfile: github-pages-push.log
 - !TodoGroup
   id: announce
   title: Announce the release
@@ -1438,14 +1499,15 @@ groups:
 #    links:
 #    - https://issues.apache.org/jira/issues/?jql=project+=+SOLR+AND+level+=+%22Public%22
   - !Todo
-    id: new_github_milestone_version_bugfix
-    title: Add a new milestone in Github for the next release
+    id: new_github_milestone_version_bugfix_minor
+    title: Add a new milestone in Github for the next releases
     description: |-
-      Go to the Github Milestones page and add the new version:
+      Go to the Github Milestones page and add the new versions:
 
-      - Create a new (unreleased) version `{{ get_next_version }}`
-    types:
-      - bugfix
+      {% if release_type == 'major' %}
+      - New (unreleased) version `{{ get_next_minor_version }}`
+      {% endif %}
+      - New (unreleased) version `{{ get_next_bugfix_version }}`
     links:
       - https://github.com/apache/solr-operator/milestones
   - !Todo