Skip to content

Commit

Permalink
Several improvements on workflows and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendez committed Apr 25, 2023
1 parent 8af1d30 commit 0c162cd
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 81 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ jobs:
env:
CI: 1

- name: Check PR contains changeset
run: pnpm changeset status --since=origin/master

- name: Open API schema changes
run: |
pnpm --filter "@qdrant/js-client-rest" codegen:openapi-typescript
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ jobs:
run: pnpm audit

- name: Install Dependencies
run: |
pnpm install --frozen-lockfile
run: pnpm install --frozen-lockfile
env:
CI: 1

Expand All @@ -48,7 +47,7 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
publish: pnpm ci:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
packages/**/package-lock.json
**/package-lock.json
**/yarn.lock
**/node_modules/
**/.pnpm-store/
Expand Down
10 changes: 4 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ Pull requests are the best way to propose changes to the codebase (we use [Githu

1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests.
3. If the Qdrant Open API has changed, update it with: `codegen:openapi-typescript`.
4. Make sure your code lints: `pnpm pre-check`. The root package installs a `pre-commit` hook with [husky](https://github.com/typicode/husky/) to automate this check.
5. Ensure the test suite passes: `pnpm test`.
6. Ensure the integration test suite passes: `pnpm test:integration`.
7. When ready, use [Changesets](https://github.com/changesets/changesets): `pnpm changeset` to describe the change(s). The generated markdown files in the `.changeset` directory should be committed to the repository.
8. Issue that pull request!
3. Make sure your code lints: `pnpm pre-check`. The root package installs a `pre-commit` hook with [husky](https://github.com/typicode/husky/) to automate this check.
4. Ensure the test suite passes: `pnpm test`.
5. When ready, use [Changesets](https://github.com/changesets/changesets): `pnpm changeset` to describe the change(s). The generated markdown files in the `.changeset` directory should be committed to the repository.
6. Issue that pull request!

## Any contributions you make will be under the Apache License 2.0

Expand Down
18 changes: 12 additions & 6 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ New releases are made from the `master` branch following semver. Major and minor

## Manual steps

1. Add new changeset to describe the changes `pnpm changeset` (**AC**)
2. Decide on a semver release, bump version in package.json file(s) and update the changelog: `pnpm changeset version` (**RC**)
1. (**AC**) Add new changeset to describe the changes `pnpm changeset`. _In some cases, you may want to merge a change without doing any releases (such as when you only change tests or build tools). In this case, you can run `pnpm changeset --empty`. This will add a special changeset that does not release anything._

> In some cases, you may want to merge a change without doing any releases (such as when you only change tests or build tools). In this case, you can run `pnpm changeset --empty`. This will add a special changeset that does not release anything.
2. (**AC**) Then open a pull request.

3. (**RC**) verifies the **semver** version commitment and turns it into a bump wtih `pnpm run version` on the root directory. This updates the versions on package.json files and updates the CHANGELOG.md files.

> This last step if skipped could result in an outdated pnpm lock file, and if so, update it manually with: `pnpm install --lockfile-only`.
## Automation

Expand All @@ -22,11 +25,14 @@ The [changesets](https://github.com/changesets/action) Github Action within `rel

- open a pull request with the branch `changeset-release/master` against the `baseBranch` containing the automatic versioning and changelog changes.

2. Finds a new changeset version, in which case it will:
> the opened pull request will have the result of running `changeset version`, but could have a pnpm lock file out-of-date, please run `pnpm install --lockfile-only` locally and push the updated pnpm lock file to this branch.
2. Finds a new version, in which case it will release using these steps:

- commit the version and changelog changes, push the changes to the `baseBranch`
- commit the version and changelog changes to the `baseBranch`
- create the relevant `git tag`(s) for the packages
- create a GitHub release with the changelog and artifacts
- push the changes including the tags
- create a GitHub release with the updated changelog and artifacts
- publish the package(s) to npmjs.com

Learn more about `changeset` by heading to their [documentation](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
60 changes: 0 additions & 60 deletions examples/node-js-basic/package-lock.json

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"packageManager": "[email protected]",
"scripts": {
"prepare": "node ./prepare.cjs && pnpm -r build",
"release": "pnpm -r build && pnpm changeset publish",
"version": "pnpm changeset version && pnpm install --lockfile-only"
"version": "pnpm changeset version && pnpm install --lockfile-only",
"ci:release": "pnpm changeset publish"
},
"devDependencies": {
"@changesets/changelog-github": "0.4.8",
Expand Down
11 changes: 11 additions & 0 deletions packages/js-client-rest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,14 @@ await client.api('collections').getCollections();
## Releases

Major and minor versions align with Qdrant's engine releases, whilst patch are reserved for fixes regarding the current minor release. Check out [RELEASE.md](../../RELEASE.md) for more info on release guidelines.

## Contributing

These are the most relevant scripts for development:

- `pnpm build`: builds and bundles from TypeScript sources
- `pnpm pre-check`: type-checks sources
- `pnpm pre-commit`: same as pre-check, but for git hooks (husky)
- `pnpm test`: run unit tests
- `./tests/integration-tests.sh`: starts local docker container and runs integration tests with: `pnpm test:integration`
- `pnpm codegen:openapi-typescript`: updates generated TS schema from the latest openapi.json remote
8 changes: 8 additions & 0 deletions packages/qdrant-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ The next packages are re-exported from it:

- [JS Client REST](../js-client-rest)
- [JS Client gRPC](../js-client-grpc) (coming soon)

## Contributing

These are the most relevant scripts for development:

- `pnpm build`: builds and bundles from TypeScript sources
- `pnpm pre-check`: type-checks sources
- `pnpm pre-commit`: same as pre-check, but for git hooks (husky)

0 comments on commit 0c162cd

Please sign in to comment.