removed docs and scripts around submodules. submodules are no longer

used.
This commit is contained in:
Yu Liao 2022-02-04 10:32:36 -08:00
parent 0cac1054cb
commit 87614465d5
3 changed files with 9 additions and 119 deletions

View File

@ -17,11 +17,7 @@ are a higher than expected number of issues there can be multiple releases
## Automated release
### 1. (Optional) Update submodules
Update submodules by referring to this [link](https://github.com/kubernetes-client/python/blob/master/devel/submodules.md#update-submodule). Commit the changes and open a pull request.
### 2. Run the release script and send a PR
### 1. Run the release script and send a PR
Generate a Github personal access token following instruction
[link](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
@ -49,11 +45,11 @@ $ KUBERNETES_BRANCH=release-1.${MINOR_VERSION} CLIENT_VERSION=${MINOR_VERSION}.$
Checkout the generated local branch (named "automated-release-of-xxx") to
continue with the remaining steps.
### 3. README (not required for snapshots)
### 2. README (not required for snapshots)
Update the compatibility matrix and maintenance status in the README file.
### 4. Submit pull request
### 3. Submit pull request
For snapshots, create a PR against the master repo.
@ -62,17 +58,13 @@ For actual releases, create:
- a second PR against the master branch to cherrypick the CHANGELOG and README
changes.
### 5. (Repo admin) Create release branch
### 4. (Repo admin) Create release branch
After merging a new snapshot, create a release branch from the master branch.
## (Deprecated) Manual release
### 1. Update submodules
Update submodules by referring to this [link](https://github.com/kubernetes-client/python/blob/master/devel/submodules.md#update-submodule). Commit the changes and open a pull request.
### 2. Create or update release branch
### 1. Create or update release branch
The release branch name should have release-x.x format. All minor and pre-releases
should be on the same branch. To update an existing branch with master (only for
@ -89,7 +81,7 @@ git pull -X theirs upstream master
You may need to fix some conflicts. For auto-generated files, you can commit
either version. They will be updated to the current version in the next step.
### 3. Update release tags
### 2. Update release tags
Release tags are in the "scripts/constants.py" file. These are the constants you
may need to update:
@ -126,7 +118,7 @@ apply the manual fixes.***
git push upstream $RELEASE_BRANCH
```
### 4. Hot issues
### 3. Hot issues
Use the `scripts/apply-hotfixes.sh` script to apply the fixes below in one step.
**As mentioned above, the script should be run after finishing the section "Update release tags". Also, ensure a clean working directory before applying the script.**
@ -152,7 +144,7 @@ For more details, see [#974](https://github.com/kubernetes-client/python/issues/
5. Add tests for the default `Configuration` behavior (ref: https://github.com/kubernetes-client/python/pull/1303 and https://github.com/kubernetes-client/python/pull/1285). The commit [1ffa61d0650e4c93e0d7f0becd2c54797eafd407](https://github.com/kubernetes-client/python/pull/1285/commits/1ffa61d0650e4c93e0d7f0becd2c54797eafd407) should be cherry-picked.
### 5. CHANGELOG
### 4. CHANGELOG
Make sure the change logs are up to date [here](https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md).
If they are not, follow commits added after the last release and update/commit
@ -160,7 +152,7 @@ the change logs to master.
Then based on the release, follow one of next two steps.
### 6. README
### 5. README
Update the compatibility matrix and maintenance status in the README file.

View File

@ -1,29 +0,0 @@
# Submodules
To comply with [client library structure requirement](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/csi-client-structure-proposal.md),
python client base utilities is moved into the [kubernetes-client/python-base](https://github.com/kubernetes-client/python-base) repo. `git submodules` is being used to handle dependency to that repo.
This document will provide basic steps to get submodules working.
# Clone repo
To clone the repo, you need to pass the `recursive` parameter to make the clone also get submodules:
```bash
git clone --recursive https://github.com/kubernetes-client/python.git
```
if you have already cloned the repo with no `--recursive` option, you can run this command to get submodules:
```bash
git submodule update --init
```
# Update submodule
If you changed [kubernetes-client/python-base](https://github.com/kubernetes-client/python-base) and want to pull your changes into this repo run this command:
```bash
scripts/update-submodule.sh
```
After the script finishes, please create a commit "generated python-base update" and send a PR to this repository.

View File

@ -1,73 +0,0 @@
#!/bin/bash
# Copyright 2021 The Kubernetes Authors.
#
# Licensed 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.
# Update python-base submodule and collect release notes.
# Usage:
#
# $ scripts/update-submodule.sh
#
# # To update the release notes for a specific release (e.g. v18.17.0a1):
# $ TARGET_RELEASE="v18.17.0a1" scripts/update-submodule.sh
#
# After the script finishes, please create a commit "generated python-base update"
# and send a PR to this repository.
# TODO(roycaihw): make the script send a PR
set -o errexit
set -o nounset
set -o pipefail
repo_root="$(git rev-parse --show-toplevel)"
declare -r repo_root
cd "${repo_root}"
source scripts/util/changelog.sh
source scripts/util/common.sh
util::common::check_sed
go install k8s.io/release/cmd/release-notes@latest
TARGET_RELEASE=${TARGET_RELEASE:-"v$(grep "^CLIENT_VERSION = \"" scripts/constants.py | sed "s/CLIENT_VERSION = \"//g" | sed "s/\"//g")"}
# update submodule
git submodule update --remote
# download release notes
start_sha=$(git diff | grep "^-Subproject commit " | sed 's/-Subproject commit //g')
end_sha=$(git diff | grep "^+Subproject commit " | sed 's/+Subproject commit //g')
output="/tmp/python-base-relnote-$(date +%s).md"
release-notes --dependencies=false --org kubernetes-client --repo python-base --start-sha $start_sha --end-sha $end_sha --output $output
if [ -s $output ]; then
sed -i 's/(\[\#/(\[kubernetes-client\/python-base\#/g' $output
# update changelog
IFS_backup=$IFS
IFS=$'\n'
sections=($(grep "^### " $output))
IFS=$IFS_backup
for section in "${sections[@]}"; do
# ignore section titles and empty lines; replace newline with liternal "\n"
release_notes=$(sed -n "/$section/,/###/{/###/!p}" $output | sed -n "{/^$/!p}" | sed ':a;N;$!ba;s/\n/\\n/g')
util::changelog::write_changelog "$TARGET_RELEASE" "$section" "$release_notes"
done
rm -f $output
echo "Successfully updated CHANGELOG for submodule."
else
echo "No CHANGELOG for submodule."
fi