Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): set up conventional commit changelog tool. Part of #3920 #4033

Merged
merged 12 commits into from
Jun 23, 2020
Merged
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@


**Checklist:**
- [ ] PR title should follow our convention. Examples:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeliedtke Can you also review this section?
Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested revision:

  • The title for your pull request (PR) should follow our title convention. Learn more about the pull request title convention used in this repository.

    PR titles examples:

    • fix(frontend): fixes empty page. Fixes #1234
      Use fix to indicate that this PR resolves an open issue.
    • feat(backend): configurable service account. Fixes #1234, fixes #1235
      Use feat to indicate that this PR adds a new feature.
    • chore: refactor some files
      Use chore to specify that this PR cleans up or improves the affected files.
    • test: fix CI failure. Part of #1234
      Use part of to indicate that a PR is working on an issue, but shouldn't close the issue when merged.

* `"fix(frontend): fixes empty page. Fixes #1234"`
* `"feat(backend): configurable service account. Fixes #1234, fixes #1235"`
* `"chore: refactor some files"`
* `"test: fix CI failure. Part of #1234"` // use "part of" when a PR is an work item of some issue, but shouldn't close the issue when merged.

Read more about the format we use in [CONTRIBUTING.md](https://github.com/kubeflow/pipelines/blob/master/CONTRIBUTING.md#pull-request-title-convention).

- [ ] Do you want this PR cherry picked to release branch?

If yes, please either
Expand Down
60 changes: 60 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,66 @@ use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Pull Request Title Convention
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeliedtke and this section


We enforce a PR title convention to quickly indicate type and scope of a PR.
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
We also parse it programmatically for changelog generation.
Bobgy marked this conversation as resolved.
Show resolved Hide resolved

PR titles should
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* be a user facing description of the change
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* be [conventional](https://www.conventionalcommits.org/en/v1.0.0/)
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* append fixed issue(s) at the end (if any)
Bobgy marked this conversation as resolved.
Show resolved Hide resolved

Examples:
* `"fix(ui): fixes empty page. Fixes #1234"`
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* `"feat(backend): configurable service account. Fixes #1234, fixes #1235"`
* `"chore: refactor some files"`
* `"test: fix CI failure. Part of #1234"` // use "part of" when a PR is an work item of some issue, but shouldn't close the issue when merged.
Bobgy marked this conversation as resolved.
Show resolved Hide resolved

A quick summary of the conventions we care about:
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
### PR Title Structure
```
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
<type>[optional scope]: <description> [Fixes #<issue-number>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the variable substitutions are inconsistent. Consider changing this to something like:

<type>(<scope>): <description> [Fixes #<issue-number>]

Also consider adding a section like the following below the code block:

Replace the following:

  • <type>: The PR type describes the reason for the change, such as fix to indicate that the PR fixes an open issue. More information about PR types is available in the next section.
  • <scope>: (Optional.) The PR scope describes the part of Kubeflow Pipelines that this PR changes, such as frontend to indicate that the change affects the user interface.
  • <description>: A user friendly description of this change.
  • [Fixes #<issues-number>]: (Optional.) Specifies the issues fixed by this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess sth not clear is that, there's a syntax that uses <> to specify something required, and [] to specify something optional, because scope is optional including the parenthesis, we cannot put parenthesis there.

The replace the following section is really helpful. Gonna add it, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at new revision

```
### PR Type
Type can be one of
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* feat: A new feature
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* fix: A bug fix (however a bug fix to test infra is not user facing, so it should be test type instead)
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* docs: Documentation only changes
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* chore: Anything else that do not need to be user facing
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* test: Adding missing tests or correcting existing tests
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* refactor: A code change that neither fixes a bug nor adds a feature
* perf: A code change that improves performance

Note, only feature and fix type PRs will be included in CHANGELOG, because they are
user facing.

If you think the PR contains multiple types, you can choose the major one or
split the PR to focused sub-PRs.

If you are not sure which type your PR is and it does not have user impact,
use `chore` as the fallback.

### PR Scope
Scope is optional, it can be one of
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* frontend - UI or UI server related, folder `frontend`, `frontend/server`
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
* backend - Backend, folder `backend`
* sdk - `kfp` python package, folder `sdk`
* sdk/client - `kfp-server-api` python package, folder `backend/api/python_http_client`
* components - Pipeline components, folder `components`
* deployment - Kustomize or gcp marketplace manifests, folder `manifests`
* metadata - Related to machine learning metadata (MLMD), folder `backend/metadata_writer`
* cache - Caching, folder `backend/src/cache`
* swf - Scheduled workflow, folder `backend/src/crd/controller/scheduledworkflow`
* viewer - Tensorboard viewer, folder `backend/src/crd/controller/viewer`

If you think the PR is related to multiple scopes, you can choose the major one or
split the PR to focused sub-PRs. Note, suggest splitting a huge PR because different scopes
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
usually have different reviewers, it helps getting through the review process faster too.

If you are not sure, or the PR doesn't fit into above scopes. You can either
omit the scope because it's optional, or propose an additional scope here.
Bobgy marked this conversation as resolved.
Show resolved Hide resolved

## Community Guidelines

This project follows
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0-dev.2
1.0.0-dev.2
13 changes: 8 additions & 5 deletions hack/check-release-needed-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
set -e

echo "The following tools are needed when releasing KFP:"
echo "node==12"
which node >/dev/null || (echo "node not found in PATH, recommend install via https://github.com/nvm-sh/nvm#installing-and-updating" && exit 1)
node -v | grep v12 || (echo "node not v12.x version" && exit 1)
echo "jq>=1.6"
which jq || (echo "jq not found in PATH" && exit 1)
which jq >/dev/null || (echo "jq not found in PATH" && exit 1)
echo "yq>=3.3"
which yq || (echo "yq not found in PATH" && exit 1)
which yq >/dev/null || (echo "yq not found in PATH" && exit 1)
yq -V | grep 3. || (echo "yq version 3.x should be used" && exit 1)
echo "java>=8"
which java || (echo "java not found in PATH" && exit 1)
which java >/dev/null || (echo "java not found in PATH" && exit 1)
echo "bazel==0.24.0"
which bazel || (echo "bazel not found in PATH" && exit 1)
which bazel >/dev/null || (echo "bazel not found in PATH" && exit 1)
bazel version | grep 0.24.0 || (echo "bazel not 0.24.0 version" && exit 1)
echo "python>3"
which python || (echo "python not found in PATH" && exit 1)
which python >/dev/null || (echo "python not found in PATH" && exit 1)
python -c "import setuptools" || (echo "setuptools should be installed in python" && exit 1)

echo "All tools installed"
Expand Down
13 changes: 12 additions & 1 deletion hack/release-imp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

set -ex

echo "Usage: edit kubeflow/pipelines/VERSION to new version tag first, then run this script."
echo "Usage: update kubeflow/pipelines/VERSION to new version tag by"
echo '`echo -n "\$VERSION" > VERSION` first, then run this script.'
echo "Please use the above command to make sure the file doesn't have extra"
echo "line endings."

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
REPO_ROOT="$DIR/.."
Expand All @@ -29,6 +32,14 @@ fi

"$DIR/check-release-needed-tools.sh"

pushd "$REPO_ROOT"
npm ci
npm run changelog
popd
# Change github issue/PR references like #123 to real urls in markdown.
# The issues must have a " " or a "(" before it to avoid already converted issues like [\#123](url...).
sed -i.bak -e 's|\([ (]\)#\([0-9]\+\)|\1[\\#\2](https://github.com/kubeflow/pipelines/issues/\2)|g' "$REPO_ROOT/CHANGELOG.md"

"$REPO_ROOT/components/release-in-place.sh" $TAG_NAME
"$REPO_ROOT/manifests/gcp_marketplace/hack/release.sh" $TAG_NAME
"$REPO_ROOT/manifests/kustomize/hack/release.sh" $TAG_NAME
Expand Down
2 changes: 1 addition & 1 deletion hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ git clone "git@github.com:${REPO}.git" "$clone_dir"
cd "$clone_dir"
git checkout "$BRANCH"

echo "$TAG_NAME" > ./VERSION
echo -n "$TAG_NAME" > ./VERSION
# Run the release script in cloned repo
"hack/release-imp.sh" $TAG_NAME

Expand Down
Loading