mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 14:28:22 +00:00
Update CHANGELOG.md for 0.52.0
release, add scripts/ instructions for ASF releases (#1479)
This commit is contained in:
parent
d853c35391
commit
334a5bf354
14 changed files with 926 additions and 127 deletions
181
dev/release/README.md
Normal file
181
dev/release/README.md
Normal file
|
@ -0,0 +1,181 @@
|
|||
<!---
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
|
||||
## Process Overview
|
||||
|
||||
As part of the Apache governance model, official releases consist of signed
|
||||
source tarballs approved by the DataFusion PMC.
|
||||
|
||||
We then use the code in the approved artifacts to release to crates.io.
|
||||
|
||||
### Change Log
|
||||
|
||||
We maintain a `CHANGELOG.md` so our users know what has been changed between releases.
|
||||
|
||||
You will need a GitHub Personal Access Token for the following steps. Follow
|
||||
[these instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
|
||||
to generate one if you do not already have one.
|
||||
|
||||
The changelog is generated using a Python script which needs `PyGitHub`, installed using pip:
|
||||
|
||||
```shell
|
||||
pip3 install PyGitHub
|
||||
```
|
||||
|
||||
To generate the changelog, set the `GITHUB_TOKEN` environment variable to a valid token and then run the script
|
||||
providing two commit ids or tags followed by the version number of the release being created. The following
|
||||
example generates a change log of all changes between the first commit and the current HEAD revision.
|
||||
|
||||
```shell
|
||||
export GITHUB_TOKEN=<your-token-here>
|
||||
python ./dev/release/generate-changelog.py v0.51.0 HEAD 0.52.0 > changelog/0.52.0.md
|
||||
```
|
||||
|
||||
This script creates a changelog from GitHub PRs based on the labels associated with them as well as looking for
|
||||
titles starting with `feat:`, `fix:`, or `docs:`.
|
||||
|
||||
Add an entry to CHANGELOG.md for the new version
|
||||
|
||||
## Prepare release commits and PR
|
||||
|
||||
### Update Version
|
||||
|
||||
Checkout the main commit to be released
|
||||
|
||||
```shell
|
||||
git fetch apache
|
||||
git checkout apache/main
|
||||
```
|
||||
|
||||
Manually update the version in the root `Cargo.toml` to the release version (e.g. `0.52.0`).
|
||||
|
||||
Lastly commit the version change:
|
||||
|
||||
```shell
|
||||
git commit -a -m 'Update version'
|
||||
```
|
||||
|
||||
## Prepare release candidate artifacts
|
||||
|
||||
After the PR gets merged, you are ready to create release artifacts from the
|
||||
merged commit.
|
||||
|
||||
(Note you need to be a committer to run these scripts as they upload to the apache svn distribution servers)
|
||||
|
||||
### Pick a Release Candidate (RC) number
|
||||
|
||||
Pick numbers in sequential order, with `0` for `rc0`, `1` for `rc1`, etc.
|
||||
|
||||
### Create git tag for the release:
|
||||
|
||||
While the official release artifacts are signed tarballs and zip files, we also
|
||||
tag the commit it was created for convenience and code archaeology.
|
||||
|
||||
Using a string such as `v0.52.0` as the `<version>`, create and push the tag by running these commands:
|
||||
|
||||
For example to tag version `0.52.0`
|
||||
|
||||
```shell
|
||||
git fetch apache
|
||||
git tag v0.52.0-rc1 apache/main
|
||||
# push tag to Github remote
|
||||
git push apache v0.52.0-rc1
|
||||
```
|
||||
|
||||
### Create, sign, and upload artifacts
|
||||
|
||||
Run `create-tarball.sh` with the `<version>` tag and `<rc>` and you found in previous steps:
|
||||
|
||||
```shell
|
||||
GITHUB_TOKEN=<TOKEN> ./dev/release/create-tarball.sh 0.52.0 1
|
||||
```
|
||||
|
||||
The `create-tarball.sh` script
|
||||
|
||||
1. creates and uploads all release candidate artifacts to the [datafusion
|
||||
dev](https://dist.apache.org/repos/dist/dev/datafusion) location on the
|
||||
apache distribution svn server
|
||||
|
||||
2. provide you an email template to
|
||||
send to dev@datafusion.apache.org for release voting.
|
||||
|
||||
### Vote on Release Candidate artifacts
|
||||
|
||||
Send the email output from the script to dev@datafusion.apache.org.
|
||||
|
||||
For the release to become "official" it needs at least three PMC members to vote +1 on it.
|
||||
|
||||
### Verifying Release Candidates
|
||||
|
||||
The `dev/release/verify-release-candidate.sh` is a script in this repository that can assist in the verification process. Run it like:
|
||||
|
||||
```shell
|
||||
./dev/release/verify-release-candidate.sh 0.52.0 1
|
||||
```
|
||||
|
||||
#### If the release is not approved
|
||||
|
||||
If the release is not approved, fix whatever the problem is, merge changelog
|
||||
changes into main if there is any and try again with the next RC number.
|
||||
|
||||
## Finalize the release
|
||||
|
||||
NOTE: steps in this section can only be done by PMC members.
|
||||
|
||||
### After the release is approved
|
||||
|
||||
Move artifacts to the release location in SVN, using the `release-tarball.sh` script:
|
||||
|
||||
```shell
|
||||
./dev/release/release-tarball.sh 0.52.0 1
|
||||
```
|
||||
|
||||
Congratulations! The release is now official!
|
||||
|
||||
### Publish on Crates.io
|
||||
|
||||
Only approved releases of the tarball should be published to
|
||||
crates.io, in order to conform to Apache Software Foundation
|
||||
governance standards.
|
||||
|
||||
A DataFusion committer can publish this crate after an official project release has
|
||||
been made to crates.io using the following instructions.
|
||||
|
||||
Follow [these
|
||||
instructions](https://doc.rust-lang.org/cargo/reference/publishing.html) to
|
||||
create an account and login to crates.io before asking to be added as an owner
|
||||
to the sqlparser DataFusion crates.
|
||||
|
||||
Download and unpack the official release tarball
|
||||
|
||||
Verify that the Cargo.toml in the tarball contains the correct version
|
||||
(e.g. `version = "0.52.0"`) and then publish the crates by running the following commands
|
||||
|
||||
```shell
|
||||
cargo publish
|
||||
```
|
||||
|
||||
If necessary, also publish the `sqlparser_derive` crate:
|
||||
|
||||
crates.io homepage: https://crates.io/crates/sqlparser_derive
|
||||
|
||||
```shell
|
||||
(cd derive && cargo publish
|
||||
```
|
59
dev/release/check-rat-report.py
Normal file
59
dev/release/check-rat-report.py
Normal file
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/python
|
||||
##############################################################################
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
##############################################################################
|
||||
import fnmatch
|
||||
import re
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
sys.stderr.write("Usage: %s exclude_globs.lst rat_report.xml\n" %
|
||||
sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
exclude_globs_filename = sys.argv[1]
|
||||
xml_filename = sys.argv[2]
|
||||
|
||||
globs = [line.strip() for line in open(exclude_globs_filename, "r")]
|
||||
|
||||
tree = ET.parse(xml_filename)
|
||||
root = tree.getroot()
|
||||
resources = root.findall('resource')
|
||||
|
||||
all_ok = True
|
||||
for r in resources:
|
||||
approvals = r.findall('license-approval')
|
||||
if not approvals or approvals[0].attrib['name'] == 'true':
|
||||
continue
|
||||
clean_name = re.sub('^[^/]+/', '', r.attrib['name'])
|
||||
excluded = False
|
||||
for g in globs:
|
||||
if fnmatch.fnmatch(clean_name, g):
|
||||
excluded = True
|
||||
break
|
||||
if not excluded:
|
||||
sys.stdout.write("NOT APPROVED: %s (%s): %s\n" % (
|
||||
clean_name, r.attrib['name'], approvals[0].attrib['name']))
|
||||
all_ok = False
|
||||
|
||||
if not all_ok:
|
||||
sys.exit(1)
|
||||
|
||||
print('OK')
|
||||
sys.exit(0)
|
135
dev/release/create-tarball.sh
Executable file
135
dev/release/create-tarball.sh
Executable file
|
@ -0,0 +1,135 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Adapted from https://github.com/apache/datafusion/tree/master/dev/release/create-tarball.sh
|
||||
|
||||
# This script creates a signed tarball in
|
||||
# dev/dist/apache-datafusion-sqlparser-rs-<version>-rc.tar.gz and uploads it to
|
||||
# the "dev" area of the dist.apache.datafusion repository and prepares an
|
||||
# email for sending to the dev@datafusion.apache.org list for a formal
|
||||
# vote.
|
||||
#
|
||||
# See release/README.md for full release instructions
|
||||
#
|
||||
# Requirements:
|
||||
#
|
||||
# 1. gpg setup for signing and have uploaded your public
|
||||
# signature to https://pgp.mit.edu/
|
||||
#
|
||||
# 2. Logged into the apache svn server with the appropriate
|
||||
# credentials
|
||||
#
|
||||
# 3. Install the requests python package
|
||||
#
|
||||
#
|
||||
# Based in part on 02-source.sh from apache/arrow
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SOURCE_TOP_DIR="$(cd "${SOURCE_DIR}/../../" && pwd)"
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "Usage: $0 <version> <rc>"
|
||||
echo "ex. $0 0.52.0 2"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -z "${GITHUB_TOKEN}" ]]; then
|
||||
echo "Please set personal github token through GITHUB_TOKEN environment variable"
|
||||
exit
|
||||
fi
|
||||
|
||||
version=$1
|
||||
rc=$2
|
||||
tag="v${version}-rc${rc}"
|
||||
|
||||
echo "Attempting to create ${tarball} from tag ${tag}"
|
||||
release_hash=$(cd "${SOURCE_TOP_DIR}" && git rev-list --max-count=1 ${tag})
|
||||
|
||||
release=apache-datafusion-sqlparser-rs-${version}
|
||||
distdir=${SOURCE_TOP_DIR}/dev/dist/${release}-rc${rc}
|
||||
tarname=${release}.tar.gz
|
||||
tarball=${distdir}/${tarname}
|
||||
url="https://dist.apache.org/repos/dist/dev/datafusion/${release}-rc${rc}"
|
||||
|
||||
if [ -z "$release_hash" ]; then
|
||||
echo "Cannot continue: unknown git tag: ${tag}"
|
||||
fi
|
||||
|
||||
echo "Draft email for dev@datafusion.apache.org mailing list"
|
||||
echo ""
|
||||
echo "---------------------------------------------------------"
|
||||
cat <<MAIL
|
||||
To: dev@datafusion.apache.org
|
||||
Subject: [VOTE] Release Apache DataFusion sqlparser-rs ${version} RC${rc}
|
||||
Hi,
|
||||
|
||||
I would like to propose a release of Apache DataFusion sqlparser-rs version ${version}.
|
||||
|
||||
This release candidate is based on commit: ${release_hash} [1]
|
||||
The proposed release tarball and signatures are hosted at [2].
|
||||
The changelog is located at [3].
|
||||
|
||||
Please download, verify checksums and signatures, run the unit tests, and vote
|
||||
on the release. The vote will be open for at least 72 hours.
|
||||
|
||||
Only votes from PMC members are binding, but all members of the community are
|
||||
encouraged to test the release and vote with "(non-binding)".
|
||||
|
||||
The standard verification procedure is documented at https://github.com/apache/datafusion-sqlparser-rs/blob/main/dev/release/README.md#verifying-release-candidates.
|
||||
|
||||
[ ] +1 Release this as Apache DataFusion sqlparser-rs ${version}
|
||||
[ ] +0
|
||||
[ ] -1 Do not release this as Apache DataFusion sqlparser-rs ${version} because...
|
||||
|
||||
Here is my vote:
|
||||
|
||||
+1
|
||||
|
||||
[1]: https://github.com/apache/datafusion-sqlparser-rs/tree/${release_hash}
|
||||
[2]: ${url}
|
||||
[3]: https://github.com/apache/datafusion-sqlparser-rs/blob/${release_hash}/CHANGELOG.md
|
||||
MAIL
|
||||
echo "---------------------------------------------------------"
|
||||
|
||||
|
||||
# create <tarball> containing the files in git at $release_hash
|
||||
# the files in the tarball are prefixed with {version} (e.g. 4.0.1)
|
||||
mkdir -p ${distdir}
|
||||
(cd "${SOURCE_TOP_DIR}" && git archive ${release_hash} --prefix ${release}/ | gzip > ${tarball})
|
||||
|
||||
echo "Running rat license checker on ${tarball}"
|
||||
${SOURCE_DIR}/run-rat.sh ${tarball}
|
||||
|
||||
echo "Signing tarball and creating checksums"
|
||||
gpg --armor --output ${tarball}.asc --detach-sig ${tarball}
|
||||
# create signing with relative path of tarball
|
||||
# so that they can be verified with a command such as
|
||||
# shasum --check apache-datafusion-sqlparser-rs-0.52.0-rc1.tar.gz.sha512
|
||||
(cd ${distdir} && shasum -a 256 ${tarname}) > ${tarball}.sha256
|
||||
(cd ${distdir} && shasum -a 512 ${tarname}) > ${tarball}.sha512
|
||||
|
||||
|
||||
echo "Uploading to sqlparser-rs dist/dev to ${url}"
|
||||
svn co --depth=empty https://dist.apache.org/repos/dist/dev/datafusion ${SOURCE_TOP_DIR}/dev/dist
|
||||
svn add ${distdir}
|
||||
svn ci -m "Apache DataFusion ${version} ${rc}" ${distdir}
|
164
dev/release/generate-changelog.py
Executable file
164
dev/release/generate-changelog.py
Executable file
|
@ -0,0 +1,164 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from github import Github
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
def print_pulls(repo_name, title, pulls):
|
||||
if len(pulls) > 0:
|
||||
print("**{}:**".format(title))
|
||||
print()
|
||||
for (pull, commit) in pulls:
|
||||
url = "https://github.com/{}/pull/{}".format(repo_name, pull.number)
|
||||
print("- {} [#{}]({}) ({})".format(pull.title, pull.number, url, commit.author.login))
|
||||
print()
|
||||
|
||||
|
||||
def generate_changelog(repo, repo_name, tag1, tag2, version):
|
||||
|
||||
# get a list of commits between two tags
|
||||
print(f"Fetching list of commits between {tag1} and {tag2}", file=sys.stderr)
|
||||
comparison = repo.compare(tag1, tag2)
|
||||
|
||||
# get the pull requests for these commits
|
||||
print("Fetching pull requests", file=sys.stderr)
|
||||
unique_pulls = []
|
||||
all_pulls = []
|
||||
for commit in comparison.commits:
|
||||
pulls = commit.get_pulls()
|
||||
for pull in pulls:
|
||||
# there can be multiple commits per PR if squash merge is not being used and
|
||||
# in this case we should get all the author names, but for now just pick one
|
||||
if pull.number not in unique_pulls:
|
||||
unique_pulls.append(pull.number)
|
||||
all_pulls.append((pull, commit))
|
||||
|
||||
# we split the pulls into categories
|
||||
breaking = []
|
||||
bugs = []
|
||||
docs = []
|
||||
enhancements = []
|
||||
performance = []
|
||||
other = []
|
||||
|
||||
# categorize the pull requests based on GitHub labels
|
||||
print("Categorizing pull requests", file=sys.stderr)
|
||||
for (pull, commit) in all_pulls:
|
||||
|
||||
# see if PR title uses Conventional Commits
|
||||
cc_type = ''
|
||||
cc_scope = ''
|
||||
cc_breaking = ''
|
||||
parts = re.findall(r'^([a-z]+)(\([a-z]+\))?(!)?:', pull.title)
|
||||
if len(parts) == 1:
|
||||
parts_tuple = parts[0]
|
||||
cc_type = parts_tuple[0] # fix, feat, docs, chore
|
||||
cc_scope = parts_tuple[1] # component within project
|
||||
cc_breaking = parts_tuple[2] == '!'
|
||||
|
||||
labels = [label.name for label in pull.labels]
|
||||
if 'api change' in labels or cc_breaking:
|
||||
breaking.append((pull, commit))
|
||||
elif 'bug' in labels or cc_type == 'fix':
|
||||
bugs.append((pull, commit))
|
||||
elif 'performance' in labels or cc_type == 'perf':
|
||||
performance.append((pull, commit))
|
||||
elif 'enhancement' in labels or cc_type == 'feat':
|
||||
enhancements.append((pull, commit))
|
||||
elif 'documentation' in labels or cc_type == 'docs' or cc_type == 'doc':
|
||||
docs.append((pull, commit))
|
||||
else:
|
||||
other.append((pull, commit))
|
||||
|
||||
# produce the changelog content
|
||||
print("Generating changelog content", file=sys.stderr)
|
||||
|
||||
# ASF header
|
||||
print("""<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->\n""")
|
||||
|
||||
print(f"# sqlparser-rs {version} Changelog\n")
|
||||
|
||||
# get the number of commits
|
||||
commit_count = subprocess.check_output(f"git log --pretty=oneline {tag1}..{tag2} | wc -l", shell=True, text=True).strip()
|
||||
|
||||
# get number of contributors
|
||||
contributor_count = subprocess.check_output(f"git shortlog -sn {tag1}..{tag2} | wc -l", shell=True, text=True).strip()
|
||||
|
||||
print(f"This release consists of {commit_count} commits from {contributor_count} contributors. "
|
||||
f"See credits at the end of this changelog for more information.\n")
|
||||
|
||||
print_pulls(repo_name, "Breaking changes", breaking)
|
||||
print_pulls(repo_name, "Performance related", performance)
|
||||
print_pulls(repo_name, "Implemented enhancements", enhancements)
|
||||
print_pulls(repo_name, "Fixed bugs", bugs)
|
||||
print_pulls(repo_name, "Documentation updates", docs)
|
||||
print_pulls(repo_name, "Other", other)
|
||||
|
||||
# show code contributions
|
||||
credits = subprocess.check_output(f"git shortlog -sn {tag1}..{tag2}", shell=True, text=True).rstrip()
|
||||
|
||||
print("## Credits\n")
|
||||
print("Thank you to everyone who contributed to this release. Here is a breakdown of commits (PRs merged) "
|
||||
"per contributor.\n")
|
||||
print("```")
|
||||
print(credits)
|
||||
print("```\n")
|
||||
|
||||
print("Thank you also to everyone who contributed in other ways such as filing issues, reviewing "
|
||||
"PRs, and providing feedback on this release.\n")
|
||||
|
||||
def cli(args=None):
|
||||
"""Process command line arguments."""
|
||||
if not args:
|
||||
args = sys.argv[1:]
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("tag1", help="The previous commit or tag (e.g. 0.1.0)")
|
||||
parser.add_argument("tag2", help="The current commit or tag (e.g. HEAD)")
|
||||
parser.add_argument("version", help="The version number to include in the changelog")
|
||||
args = parser.parse_args()
|
||||
|
||||
token = os.getenv("GITHUB_TOKEN")
|
||||
project = "apache/datafusion-sqlparser-rs"
|
||||
|
||||
g = Github(token)
|
||||
repo = g.get_repo(project)
|
||||
generate_changelog(repo, project, args.tag1, args.tag2, args.version)
|
||||
|
||||
if __name__ == "__main__":
|
||||
cli()
|
6
dev/release/rat_exclude_files.txt
Normal file
6
dev/release/rat_exclude_files.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Files to exclude from the Apache Rat (license) check
|
||||
.gitignore
|
||||
.tool-versions
|
||||
dev/release/rat_exclude_files.txt
|
||||
fuzz/.gitignore
|
||||
|
74
dev/release/release-tarball.sh
Executable file
74
dev/release/release-tarball.sh
Executable file
|
@ -0,0 +1,74 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Adapted from https://github.com/apache/arrow-rs/tree/master/dev/release/release-tarball.sh
|
||||
|
||||
# This script copies a tarball from the "dev" area of the
|
||||
# dist.apache.datafusion repository to the "release" area
|
||||
#
|
||||
# This script should only be run after the release has been approved
|
||||
# by the Apache DataFusion PMC committee.
|
||||
#
|
||||
# See release/README.md for full release instructions
|
||||
#
|
||||
# Based in part on post-01-upload.sh from apache/arrow
|
||||
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "Usage: $0 <version> <rc-num>"
|
||||
echo "ex. $0 0.52.0 2"
|
||||
exit
|
||||
fi
|
||||
|
||||
version=$1
|
||||
rc=$2
|
||||
|
||||
tmp_dir=tmp-apache-datafusion-dist
|
||||
|
||||
echo "Recreate temporary directory: ${tmp_dir}"
|
||||
rm -rf ${tmp_dir}
|
||||
mkdir -p ${tmp_dir}
|
||||
|
||||
echo "Clone dev dist repository"
|
||||
svn \
|
||||
co \
|
||||
https://dist.apache.org/repos/dist/dev/datafusion/apache-datafusion-sqlparser-rs-${version}-rc${rc} \
|
||||
${tmp_dir}/dev
|
||||
|
||||
echo "Clone release dist repository"
|
||||
svn co https://dist.apache.org/repos/dist/release/datafusion ${tmp_dir}/release
|
||||
|
||||
echo "Copy ${version}-rc${rc} to release working copy"
|
||||
release_version=datafusion-sqlparser-rs-${version}
|
||||
mkdir -p ${tmp_dir}/release/${release_version}
|
||||
cp -r ${tmp_dir}/dev/* ${tmp_dir}/release/${release_version}/
|
||||
svn add ${tmp_dir}/release/${release_version}
|
||||
|
||||
echo "Commit release"
|
||||
svn ci -m "Apache DataFusion sqlparser-rs ${version}" ${tmp_dir}/release
|
||||
|
||||
echo "Clean up"
|
||||
rm -rf ${tmp_dir}
|
||||
|
||||
echo "Success! The release is available here:"
|
||||
echo " https://dist.apache.org/repos/dist/release/datafusion/${release_version}"
|
43
dev/release/run-rat.sh
Executable file
43
dev/release/run-rat.sh
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
RAT_VERSION=0.13
|
||||
|
||||
# download apache rat
|
||||
if [ ! -f apache-rat-${RAT_VERSION}.jar ]; then
|
||||
curl -s https://repo1.maven.org/maven2/org/apache/rat/apache-rat/${RAT_VERSION}/apache-rat-${RAT_VERSION}.jar > apache-rat-${RAT_VERSION}.jar
|
||||
fi
|
||||
|
||||
RAT="java -jar apache-rat-${RAT_VERSION}.jar -x "
|
||||
|
||||
RELEASE_DIR=$(cd "$(dirname "$BASH_SOURCE")"; pwd)
|
||||
|
||||
# generate the rat report
|
||||
$RAT $1 > rat.txt
|
||||
python $RELEASE_DIR/check-rat-report.py $RELEASE_DIR/rat_exclude_files.txt rat.txt > filtered_rat.txt
|
||||
cat filtered_rat.txt
|
||||
UNAPPROVED=`cat filtered_rat.txt | grep "NOT APPROVED" | wc -l`
|
||||
|
||||
if [ "0" -eq "${UNAPPROVED}" ]; then
|
||||
echo "No unapproved licenses"
|
||||
else
|
||||
echo "${UNAPPROVED} unapproved licences. Check rat report: rat.txt"
|
||||
exit 1
|
||||
fi
|
152
dev/release/verify-release-candidate.sh
Executable file
152
dev/release/verify-release-candidate.sh
Executable file
|
@ -0,0 +1,152 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
case $# in
|
||||
2) VERSION="$1"
|
||||
RC_NUMBER="$2"
|
||||
;;
|
||||
*) echo "Usage: $0 X.Y.Z RC_NUMBER"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
set -e
|
||||
set -x
|
||||
set -o pipefail
|
||||
|
||||
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
||||
ARROW_DIR="$(dirname $(dirname ${SOURCE_DIR}))"
|
||||
ARROW_DIST_URL='https://dist.apache.org/repos/dist/dev/datafusion'
|
||||
|
||||
download_dist_file() {
|
||||
curl \
|
||||
--silent \
|
||||
--show-error \
|
||||
--fail \
|
||||
--location \
|
||||
--remote-name $ARROW_DIST_URL/$1
|
||||
}
|
||||
|
||||
download_rc_file() {
|
||||
download_dist_file apache-datafusion-sqlparser-rs-${VERSION}-rc${RC_NUMBER}/$1
|
||||
}
|
||||
|
||||
import_gpg_keys() {
|
||||
download_dist_file KEYS
|
||||
gpg --import KEYS
|
||||
}
|
||||
|
||||
if type shasum >/dev/null 2>&1; then
|
||||
sha256_verify="shasum -a 256 -c"
|
||||
sha512_verify="shasum -a 512 -c"
|
||||
else
|
||||
sha256_verify="sha256sum -c"
|
||||
sha512_verify="sha512sum -c"
|
||||
fi
|
||||
|
||||
fetch_archive() {
|
||||
local dist_name=$1
|
||||
download_rc_file ${dist_name}.tar.gz
|
||||
download_rc_file ${dist_name}.tar.gz.asc
|
||||
download_rc_file ${dist_name}.tar.gz.sha256
|
||||
download_rc_file ${dist_name}.tar.gz.sha512
|
||||
verify_dir_artifact_signatures
|
||||
}
|
||||
|
||||
verify_dir_artifact_signatures() {
|
||||
# verify the signature and the checksums of each artifact
|
||||
find . -name '*.asc' | while read sigfile; do
|
||||
artifact=${sigfile/.asc/}
|
||||
gpg --verify $sigfile $artifact || exit 1
|
||||
|
||||
# go into the directory because the checksum files contain only the
|
||||
# basename of the artifact
|
||||
pushd $(dirname $artifact)
|
||||
base_artifact=$(basename $artifact)
|
||||
${sha256_verify} $base_artifact.sha256 || exit 1
|
||||
${sha512_verify} $base_artifact.sha512 || exit 1
|
||||
popd
|
||||
done
|
||||
}
|
||||
|
||||
setup_tempdir() {
|
||||
cleanup() {
|
||||
if [ "${TEST_SUCCESS}" = "yes" ]; then
|
||||
rm -fr "${ARROW_TMPDIR}"
|
||||
else
|
||||
echo "Failed to verify release candidate. See ${ARROW_TMPDIR} for details."
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -z "${ARROW_TMPDIR}" ]; then
|
||||
# clean up automatically if ARROW_TMPDIR is not defined
|
||||
ARROW_TMPDIR=$(mktemp -d -t "$1.XXXXX")
|
||||
trap cleanup EXIT
|
||||
else
|
||||
# don't clean up automatically
|
||||
mkdir -p "${ARROW_TMPDIR}"
|
||||
fi
|
||||
}
|
||||
|
||||
test_source_distribution() {
|
||||
# install rust toolchain in a similar fashion like test-miniconda
|
||||
export RUSTUP_HOME=$PWD/test-rustup
|
||||
export CARGO_HOME=$PWD/test-rustup
|
||||
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path
|
||||
|
||||
export PATH=$RUSTUP_HOME/bin:$PATH
|
||||
source $RUSTUP_HOME/env
|
||||
|
||||
# build and test rust
|
||||
|
||||
# raises on any formatting errors
|
||||
rustup component add rustfmt --toolchain stable
|
||||
cargo fmt --all -- --check
|
||||
|
||||
cargo build
|
||||
cargo test --all-features
|
||||
|
||||
if ( find -iname 'Cargo.toml' | xargs grep SNAPSHOT ); then
|
||||
echo "Cargo.toml version should not contain SNAPSHOT for releases"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check that publish works
|
||||
cargo publish --dry-run
|
||||
}
|
||||
|
||||
TEST_SUCCESS=no
|
||||
|
||||
setup_tempdir "datafusion-sqlparser-rs-${VERSION}"
|
||||
echo "Working in sandbox ${ARROW_TMPDIR}"
|
||||
cd ${ARROW_TMPDIR}
|
||||
|
||||
dist_name="apache-datafusion-sqlparser-rs-${VERSION}"
|
||||
import_gpg_keys
|
||||
fetch_archive ${dist_name}
|
||||
tar xf ${dist_name}.tar.gz
|
||||
pushd ${dist_name}
|
||||
test_source_distribution
|
||||
popd
|
||||
|
||||
TEST_SUCCESS=yes
|
||||
echo 'Release candidate looks good!'
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue