Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
165 changes: 0 additions & 165 deletions hack/release/wizard/poll-mirrors.py

This file was deleted.

39 changes: 23 additions & 16 deletions hack/release/wizard/releaseWizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def expand_jinja(text, vars=None):
'latest_version': state.get_latest_version(),
'latest_lts_version': state.get_latest_lts_version(),
'main_version': state.get_main_version(),
'mirrored_versions': state.get_mirrored_versions(),
'mirrored_versions_to_delete': state.get_mirrored_versions_to_delete(),
'released_versions': state.get_released_versions(),
'released_versions_to_delete': state.get_released_versions_to_delete(),
'home': os.path.expanduser("~")
})
global_vars.update(state.get_todo_states())
Expand Down Expand Up @@ -285,7 +285,7 @@ def __init__(self, config_path, release_version, script_version):
self.rc_number = 1
self.start_date = unix_time_millis(datetime.utcnow())
self.script_branch = run("git rev-parse --abbrev-ref HEAD").strip()
self.mirrored_versions = None
self.released_versions = None
try:
self.script_branch_type = scriptutil.find_branch_type()
except:
Expand Down Expand Up @@ -341,30 +341,27 @@ def get_release_date_iso(self):

def get_latest_version(self):
if self.latest_version is None:
#TODO: Remove when first release is made
#versions = self.get_mirrored_versions()
#latest = versions[0]
versions = []
latest = "v0.2.8"
versions = self.get_released_versions()
latest = versions[0]
for ver in versions:
if Version.parse(ver).gt(Version.parse(latest)):
latest = ver
self.latest_version = latest
self.save()
return state.latest_version

def get_mirrored_versions(self):
if state.mirrored_versions is None:
def get_released_versions(self):
if state.released_versions is None:
releases_str = load("https://projects.apache.org/json/foundation/releases.json", "utf-8")
releases = json.loads(releases_str)
state.mirrored_versions = []
state.released_versions = []
if 'solr' in releases.keys():
releases = releases['solr']
state.mirrored_versions = [ r for r in list(map(lambda y: y[14:], filter(lambda x: x.startswith('solr-operator-v'), list(releases.keys())))) ]
return state.mirrored_versions
state.released_versions = [ r for r in list(map(lambda y: y[14:], filter(lambda x: x.startswith('solr-operator-v'), list(releases.keys())))) ]
return state.released_versions

def get_mirrored_versions_to_delete(self):
versions = self.get_mirrored_versions()
def get_released_versions_to_delete(self):
versions = self.get_released_versions()
to_keep = versions
if state.release_type == 'major':
to_keep = [self.release_version, self.get_latest_version()]
Expand All @@ -385,7 +382,7 @@ def get_main_version(self):

def get_latest_lts_version(self):
return None
versions = self.get_mirrored_versions()
versions = self.get_released_versions()
latest = self.get_latest_version()
lts_prefix = "%s." % (Version.parse(latest).major - 1)
lts_versions = list(filter(lambda x: x.startswith(lts_prefix), versions))
Expand Down Expand Up @@ -1993,6 +1990,16 @@ def prepare_announce(todo):
print("Draft already exist, not re-generating")
return True

def check_artifacts_available(todo):
try:
cdnUrl = expand_jinja("https://dlcdn.apache.org/solr/solr-operator/{{ release_version }}/solr-operator-{{ release_version }}.tgz.asc")
load(cdnUrl)
print("Found %s" % cdnUrl)
except Exception as e:
print("Could not fetch %s (%s)" % (cdnUrl, e))
return False

return True

def load_lines(file, from_line=0):
if os.path.exists(file):
Expand Down
70 changes: 19 additions & 51 deletions hack/release/wizard/releaseWizard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ templates:
{% for line in load_lines(solr_operator_news_file, 4) -%}
{{ line }}
{%- endfor %}


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.
# 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
Expand Down Expand Up @@ -997,8 +992,8 @@ groups:
- https://www.apache.org/foundation/voting.html
- !TodoGroup
id: publish
title: Publishing to the ASF Mirrors
description: Once the vote has passed, the release may be published to the ASF Mirrors.
title: Publishing to the ASF
description: Once the vote has passed, the release may be published to the ASF.
todos:
- !Todo
id: tag_release
Expand Down Expand Up @@ -1149,16 +1144,14 @@ groups:
cmd: docker buildx build --pull --push --platform "linux/amd64,linux/arm64" --build-arg GIT_SHA={{ build_rc.git_sha | default("<git_sha>", True) }} . --tag apache/solr-operator:{{ release_version }} -f ./build/Dockerfile
logfile: docker_upload.log
- !Todo
id: check_mirroring
title: Check state of mirroring so far
description: Mark this as complete once a good spread is confirmed
commands: !Commands
root_folder: '{{ git_checkout_folder }}'
commands_text: Run this script to check the number and percentage of mirrors that have the release
commands:
- !Command
cmd: python3 -u hack/release/wizard/poll-mirrors.py -version {{ release_version }} -o
live: true
id: check_distribution_directory
depends: svn_release_mv
title: Check that artifacts are available
function: check_artifacts_available
description: |
The task will attempt to fetch https://dlcdn.apache.org/solr/solr-operator/{{ release_version }}/solr-operator-{{ release_version }}.tgz.asc
to validate the ASF repo.
If the check fails, please re-run the task, until it succeeds.
- !Todo
id: check_artifact_hub
title: Check state of ArtifactHub entries
Expand Down Expand Up @@ -1464,15 +1457,6 @@ groups:
title: Announce the Solr Operator release (announce@a.o)
description: |
(( template=announce_solr_operator_sign_mail ))
# - !Todo
# id: add_to_wikipedia
# title: Add the new version to Wikipedia
# description: |
# Go to Wikipedia and edit the page to include the new release.
# Major versions should have a small new paragraph under 'History'.
# If you know other languages than English, edit those as well.
# links:
# - https://en.wikipedia.org/wiki/Apache_Solr
- !Todo
id: add_to_apache_reporter
title: Add the new version to the Apache Release Reporter
Expand Down Expand Up @@ -1514,22 +1498,6 @@ groups:

links:
- https://github.com/apache/solr-operator/milestones?state=open
# - !Todo
# id: jira_clear_security
# title: Clear Security Level of Public Solr JIRA Issues
# description: |-
# ASF JIRA has a deficiency in which issues that have a security level of "Public" are nonetheless not searchable.
# As a maintenance task, we'll clear the security flag for all public Solr JIRAs, even if it is not a task directly
# related to the release:
#
# . Open in browser: https://issues.apache.org/jira/issues/?jql=project+=+SOLR+AND+level+=+%22Public%22
# . In the `Tools` menu, start a bulk change, select all issues and click `Next`
# . Select operation="Edit issues" and click `Next`
# . Click the checkbox next to `Change security level` and choose `None` in the dropdown.
# . On the bottom of the form, uncheck the box that says `Send mail for this update`
# . Click `Next`, review the changes and click `Confirm`
# links:
# - https://issues.apache.org/jira/issues/?jql=project+=+SOLR+AND+level+=+%22Public%22
- !Todo
id: new_github_milestone_version_bugfix_minor
title: Add a new milestone in Github for the next releases
Expand All @@ -1543,32 +1511,32 @@ groups:
links:
- https://github.com/apache/solr-operator/milestones
- !Todo
id: stop_mirroring
title: Stop mirroring old releases
id: archive_old_releases
title: Move old releases to archive
description: |
Shortly after new releases are first mirrored, they are automatically copied to the archives.
Shortly after new releases are uploaded, they are automatically copied to the archives.
Only the latest point release from each active branch should be kept under the Solr PMC
svnpubsub areas `dist/releases/solr/solr-operator`. Older releases can be
safely deleted, since they are already backed up in the archives.

Currenlty these versions are in the mirrors:
Currently these versions are in the ASF releases:

*{{ mirrored_versions|join(', ') }}*
*{{ released_versions|join(', ') }}*

The commands below will remove old versions automatically. If this suggestion is wrong,
please do *not* execute the commands automatically, but edit the command and run manually.
Versions to be deleted from the mirrors are:
Versions to be deleted from the distribution directory repo are:

*{{ mirrored_versions_to_delete|join(', ') }}*
*{{ released_versions_to_delete|join(', ') }}*

commands: !Commands
root_folder: '{{ git_checkout_folder }}'
commands_text: |
Run these commands to delete proposed versions from mirrors.
Run these commands to delete proposed versions from the distribution directory repo.

WARNING: Validate that the proposal is correct!
commands:
- !Command
cmd: |
svn rm -m "Stop mirroring old Solr Operator releases"{% for ver in mirrored_versions_to_delete %} https://dist.apache.org/repos/dist/release/solr/solr-operator/{{ ver }}{% endfor %}
svn rm -m "Move old Solr Operator releases to archive"{% for ver in released_versions_to_delete %} https://dist.apache.org/repos/dist/release/solr/solr-operator/{{ ver }}{% endfor %}
logfile: svn-rm-solr-operator.log
2 changes: 1 addition & 1 deletion hack/release/wizard/scriptutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def attemptDownload(urlString, fileName):
if not success:
os.remove(fileName)

version_prop_re = re.compile(r'Version\s*string\s*=\s*([\'"])(.*)\1')
version_prop_re = re.compile(r'Version\s*=\s*([\'"])(.*)\1')
def find_current_version():
script_path = os.path.dirname(os.path.realpath(__file__))
top_level_dir = os.path.join(os.path.abspath("%s/" % script_path), os.path.pardir, os.path.pardir, os.path.pardir)
Expand Down