diff --git a/release/README.md b/release/README.md index 1f56f6790112b..bde487fff355e 100644 --- a/release/README.md +++ b/release/README.md @@ -25,7 +25,7 @@ pip install -r requirements.txt # Usage -To start a release, first activate the virutalenv, and then run +To start a release, first activate the virtualenv, and then run the release script. ``` diff --git a/release/git.py b/release/git.py index 9cb106df2fdcb..02d7dc8cbe284 100644 --- a/release/git.py +++ b/release/git.py @@ -136,4 +136,3 @@ def push_ref(ref, remote=push_remote_name, **kwargs): def merge_ref(ref, **kwargs): __defaults(kwargs) cmd(f"Merging ref {ref}", f"git merge {ref}") - diff --git a/release/gpg.py b/release/gpg.py index 6b396119265c9..347389e308942 100644 --- a/release/gpg.py +++ b/release/gpg.py @@ -32,7 +32,7 @@ def key_exists(key_id): """ try: execute(f"gpg --list-keys {key_id}") - except Exception as e: + except Exception: return False return True @@ -70,13 +70,13 @@ def valid_passphrase(key_id, passphrase): with tempfile.TemporaryDirectory() as tmpdir: content = __file__ signature = tmpdir + '/sig.asc' - # if the agent is running, the suplied passphrase may be ignored + # if the agent is running, the supplied passphrase may be ignored agent_kill() try: sign(key_id, passphrase, content, signature) verify(content, signature) - except subprocess.CalledProcessError as e: - False + except subprocess.CalledProcessError: + return False return True @@ -88,5 +88,3 @@ def key_pass_id(key_id, passphrase): h.update(key_id.encode()) h.update(passphrase.encode()) return h.hexdigest() - - diff --git a/release/notes.py b/release/notes.py index 529c27b372883..e561fa03a2040 100644 --- a/release/notes.py +++ b/release/notes.py @@ -41,13 +41,13 @@ def query(query, **kwargs): Any additional keyword arguments are forwarded to jira.search_issues. """ results = [] - startAt = 0 + start_at = 0 new_results = None jira = JIRA(JIRA_BASE_URL) while new_results is None or len(new_results) == MAX_RESULTS: - new_results = jira.search_issues(query, startAt=startAt, maxResults=MAX_RESULTS, **kwargs) + new_results = jira.search_issues(query, startAt=start_at, maxResults=MAX_RESULTS, **kwargs) results += new_results - startAt += len(new_results) + start_at += len(new_results) return results @@ -172,5 +172,3 @@ def generate(version): except Exception as e: print(e, file=sys.stderr) sys.exit(1) - - diff --git a/release/preferences.py b/release/preferences.py index 9b57554585ad1..f32f1650eeddc 100644 --- a/release/preferences.py +++ b/release/preferences.py @@ -89,5 +89,3 @@ def as_json(): Export all saved preferences in JSON format. """ json.dumps(prefs, indent=2) - - diff --git a/release/release.py b/release/release.py index d0cba6f178216..92b76dee1e3ee 100644 --- a/release/release.py +++ b/release/release.py @@ -218,7 +218,7 @@ def verify_gpg_key(): if not gpg.key_exists(gpg_key_id): fail(f"GPG key {gpg_key_id} not found") if not gpg.valid_passphrase(gpg_key_id, gpg_passphrase): - fail(f"GPG passprase not valid for key {gpg_key_id}") + fail(f"GPG passphrase not valid for key {gpg_key_id}") preferences.once("verify_requirements", lambda: confirm_or_fail(templates.requirements_instructions(preferences.FILE, preferences.as_json()))) @@ -232,12 +232,12 @@ def verify_gpg_key(): jdk21_env = get_jdk(21) -def verify_prerequeisites(): +def verify_prerequisites(): print("Begin to check if you have met all the pre-requisites for the release process") def prereq(name, soft_check): try: result = soft_check() - if result == False: + if not result: fail(f"Pre-requisite not met: {name}") else: print(f"Pre-requisite met: {name}") @@ -250,7 +250,7 @@ def prereq(name, soft_check): return True -preferences.once(f"verify_prerequeisites", verify_prerequeisites) +preferences.once(f"verify_prerequisites", verify_prerequisites) # Validate that the release doesn't already exist git.fetch_tags() @@ -360,7 +360,7 @@ def delete_gitrefs(): # TODO: Many of these suggested validation steps could be automated # and would help pre-validate a lot of the stuff voters test -print(templates.sanity_check_instructions(release_version, rc_tag, apache_id)) +print(templates.sanity_check_instructions(release_version, rc_tag)) confirm_or_fail("Have you sufficiently verified the release artifacts?") # TODO: Can we close the staging repository via a REST API since we @@ -376,6 +376,5 @@ def delete_gitrefs(): git.switch_branch(starting_branch) git.delete_branch(release_version) -rc_vote_email_text = templates.rc_vote_email_text(release_version, rc, rc_tag, dev_branch, docs_release_version, apache_id) +rc_vote_email_text = templates.rc_vote_email_text(release_version, rc, rc_tag, dev_branch, docs_release_version) print(templates.rc_email_instructions(rc_vote_email_text)) - diff --git a/release/runtime.py b/release/runtime.py index c0d5d67eafb77..28765f0d92bcc 100644 --- a/release/runtime.py +++ b/release/runtime.py @@ -108,7 +108,7 @@ def _prefix(prefix_str, value_str): def cmd(action, cmd_arg, *args, **kwargs): """ - Execute an external command. This should be preferered over execute() + Execute an external command. This should be preferred over execute() when returning the output is not necessary, as the user will be given the option of retrying in case of a failure. """ @@ -144,5 +144,3 @@ def cmd(action, cmd_arg, *args, **kwargs): print(templates.cmd_failed()) fail("") - - diff --git a/release/svn.py b/release/svn.py index 4869f79ddf1a0..41c2fc6d28afc 100644 --- a/release/svn.py +++ b/release/svn.py @@ -27,7 +27,7 @@ SVN_DEV_URL="https://dist.apache.org/repos/dist/dev/kafka" -def delete_old_rc_directory_if_needed(rc_tag, src, work_dir): +def delete_old_rc_directory_if_needed(rc_tag, work_dir): svn_dev = os.path.join(work_dir, "svn_dev") cmd_desc = f"Check if {rc_tag} exists in the subversion repository." cmd_str = f"svn info --show-item revision {SVN_DEV_URL}/{rc_tag}" @@ -39,7 +39,7 @@ def delete_old_rc_directory_if_needed(rc_tag, src, work_dir): cmd(cmd_desc, cmd_str, cwd = svn_dev) def commit_artifacts(rc_tag, src, work_dir): - delete_old_rc_directory_if_needed(rc_tag, src, work_dir) + delete_old_rc_directory_if_needed(rc_tag, work_dir) svn_dev = os.path.join(work_dir, "svn_dev") dst = os.path.join(svn_dev, rc_tag) print(f"Copying {src} to {dst}") diff --git a/release/templates.py b/release/templates.py index e067f1eb475e2..2f9f07b0e3c1e 100644 --- a/release/templates.py +++ b/release/templates.py @@ -154,11 +154,11 @@ def deploy_instructions(): There will be more than one repository entries created, please close all of them. In some cases, you may get errors on some repositories while closing them, see KAFKA-15033. If this is not the first RC, you need to 'Drop' the previous artifacts. -Confirm the correct artifacts are visible at https://repository.apache.org/content/groups/staging/org/apache/kafka/ +Confirm the correct artifacts are visible at https://repository.apache.org/content/groups/staging/org/apache/kafka/ and build the +jvm and native Docker images following these instructions: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=34840886#ReleaseProcess-CreateJVMApacheKafkaDockerArtifacts(Forversions>=3.7.0) """ - -def sanity_check_instructions(release_version, rc_tag, apache_id): +def sanity_check_instructions(release_version, rc_tag): return f""" ******************************************************************************************************************************************************* Ok. We've built and staged everything for the {rc_tag}. @@ -189,14 +189,14 @@ def sanity_check_instructions(release_version, rc_tag, apache_id): """ -def rc_vote_email_text(release_version, rc, rc_tag, dev_branch, docs_version, apache_id): +def rc_vote_email_text(release_version, rc, rc_tag, dev_branch, docs_version): return f""" To: dev@kafka.apache.org, users@kafka.apache.org, kafka-clients@googlegroups.com Subject: [VOTE] {release_version} RC{rc} Hello Kafka users, developers and client-developers, -This is the first candidate for release of Apache Kafka {release_version}. +This is the candidate for release of Apache Kafka {release_version}. @@ -221,7 +221,7 @@ def rc_vote_email_text(release_version, rc, rc_tag, dev_branch, docs_version, ap https://repository.apache.org/content/groups/staging/org/apache/kafka/ * Javadoc: -https://dist.apache.org/repos/dist/dev/kafka/{rc_tag}/javadoc/ +https://dist.apache.org/repos/dist/dev/kafka/{rc_tag}/javadoc/index.html * Tag to be voted upon (off {dev_branch} branch) is the {release_version} tag: https://github.com/apache/kafka/releases/tag/{rc_tag} @@ -233,17 +233,16 @@ def rc_vote_email_text(release_version, rc, rc_tag, dev_branch, docs_version, ap https://kafka.apache.org/{docs_version}/protocol.html * Successful CI builds for the {dev_branch} branch: -Unit/integration tests: https://ci-builds.apache.org/job/Kafka/job/kafka/job/{dev_branch}// --- Confluent engineers can access the semphore build to provide the build number -System tests: https://confluent-open-source-kafka-system-test-results.s3-us-west-2.amazonaws.com/{dev_branch}//report.html +Unit/integration tests: https://github.com/apache/kafka/actions/runs/ +System tests: +/report.html> * Successful Docker Image Github Actions Pipeline for {dev_branch} branch: Docker Build Test Pipeline (JVM): https://github.com/apache/kafka/actions/runs/ Docker Build Test Pipeline (Native): https://github.com/apache/kafka/actions/runs/ -/************************************** - Thanks, """ @@ -294,5 +293,3 @@ def release_announcement_email_instructions(release_announcement_email): - Finally, validate all the links before shipping! Note that all substitutions are annotated with <> around them. """ - - diff --git a/release/textfiles.py b/release/textfiles.py index 7598b96067a55..20752659c4bd2 100644 --- a/release/textfiles.py +++ b/release/textfiles.py @@ -71,5 +71,3 @@ def replace(path, pattern, replacement, **kwargs): with open(path, "w") as f: for line in updated: f.write(line) - -