From d2fb56c067a866b5ea54f790e043cddce6e0bd30 Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 11:59:45 +0100 Subject: [PATCH 01/10] chore(ci): readd commint lint Signed-off-by: Sami Jaghouar --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 113dbe1695f..99c3dd37d2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,51 @@ name: CI on: [push, pull_request] jobs: + + commit-lint: + runs-on: ubuntu-latest + steps: + - name: find the prev warning if exist + uses: peter-evans/find-comment@v1 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: "github-actions[bot]" + body-includes: "bad commit message" + - name: Delete comment if exist + if: ${{ steps.fc.outputs.comment-id != 0 }} + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: ${{ steps.fc.outputs.comment-id }}, + }) + - uses: actions/checkout@v2.5.0 + with: + fetch-depth: 0 + - run: 'echo "module.exports = {extends: [''@commitlint/config-conventional'']}" > commitlint.config.js' + - uses: wagoid/commitlint-github-action@v1 + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - name: if lint failed + if: ${{ failure() }} + uses: peter-evans/create-or-update-comment@v1 + with: + issue-number: ${{ github.event.pull_request.number }} + body: | + Thanks for your contribution :heart: + :broken_heart: Unfortunately, this PR has one ore more **bad commit messages**, it can not be merged. To fix this problem, please refer to: + - [Commit Message Guideline for the First Time Contributor](https://github.com/jina-ai/jina/issues/553) + - [Contributing Guideline](https://github.com/jina-ai/jina/blob/master/CONTRIBUTING.md) + + Note, other CI tests will *not* *start* until the commit messages get fixed. + + This message will be deleted automatically when the commit messages get fixed. + reaction-type: "eyes" + lint-ruff: runs-on: ubuntu-latest steps: From 013d0cd9eb1f32ee4d5d4d9480aa67fac6019812 Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 12:01:09 +0100 Subject: [PATCH 02/10] chore(ci): add commit link to sucessful Signed-off-by: Sami Jaghouar --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99c3dd37d2c..ce2429a5d72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,7 +174,7 @@ jobs: # just for blocking the merge until all parallel core-test are successful success-all-test: - needs: [docarray-test] + needs: [docarray-test, commit-lint] if: always() runs-on: ubuntu-latest steps: From dcd81feb6e6cbe99f7bdf0e79d700f2c23445d2e Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 13:02:14 +0100 Subject: [PATCH 03/10] chore(ci): fix ci Signed-off-by: Sami Jaghouar --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce2429a5d72..ef9d85a3ee6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,7 @@ jobs: # prep-testbed: # runs-on: ubuntu-latest -# needs: [lint-flake-8, check-black, import-test] +# needs: [lint-ruff, check-black, import-test] # steps: # - uses: actions/checkout@v2.5.0 # - id: set-matrix @@ -131,7 +131,7 @@ jobs: # matrix: ${{ steps.set-matrix.outputs.matrix }} docarray-test: - needs: [lint-flake-8, check-black, import-test] + needs: [lint-ruff, check-black, import-test] runs-on: ubuntu-latest strategy: fail-fast: false From c6335fac3b45b4ece81d8f60d9757e2715c4f853 Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 13:13:32 +0100 Subject: [PATCH 04/10] chore(ci): test disable commit lint comment Signed-off-by: Sami Jaghouar --- .github/workflows/ci.yml | 66 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef9d85a3ee6..e35db553881 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,24 +7,24 @@ jobs: commit-lint: runs-on: ubuntu-latest steps: - - name: find the prev warning if exist - uses: peter-evans/find-comment@v1 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: "github-actions[bot]" - body-includes: "bad commit message" - - name: Delete comment if exist - if: ${{ steps.fc.outputs.comment-id != 0 }} - uses: actions/github-script@v3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - github.issues.deleteComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: ${{ steps.fc.outputs.comment-id }}, - }) +# - name: find the prev warning if exist +# uses: peter-evans/find-comment@v1 +# id: fc +# with: +# issue-number: ${{ github.event.pull_request.number }} +# comment-author: "github-actions[bot]" +# body-includes: "bad commit message" +# - name: Delete comment if exist +# if: ${{ steps.fc.outputs.comment-id != 0 }} +# uses: actions/github-script@v3 +# with: +# github-token: ${{ secrets.GITHUB_TOKEN }} +# script: | +# github.issues.deleteComment({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# comment_id: ${{ steps.fc.outputs.comment-id }}, +# }) - uses: actions/checkout@v2.5.0 with: fetch-depth: 0 @@ -32,21 +32,21 @@ jobs: - uses: wagoid/commitlint-github-action@v1 env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - name: if lint failed - if: ${{ failure() }} - uses: peter-evans/create-or-update-comment@v1 - with: - issue-number: ${{ github.event.pull_request.number }} - body: | - Thanks for your contribution :heart: - :broken_heart: Unfortunately, this PR has one ore more **bad commit messages**, it can not be merged. To fix this problem, please refer to: - - [Commit Message Guideline for the First Time Contributor](https://github.com/jina-ai/jina/issues/553) - - [Contributing Guideline](https://github.com/jina-ai/jina/blob/master/CONTRIBUTING.md) - - Note, other CI tests will *not* *start* until the commit messages get fixed. - - This message will be deleted automatically when the commit messages get fixed. - reaction-type: "eyes" +# - name: if lint failed +# if: ${{ failure() }} +# uses: peter-evans/create-or-update-comment@v1 +# with: +# issue-number: ${{ github.event.pull_request.number }} +# body: | +# Thanks for your contribution :heart: +# :broken_heart: Unfortunately, this PR has one ore more **bad commit messages**, it can not be merged. To fix this problem, please refer to: +# - [Commit Message Guideline for the First Time Contributor](https://github.com/jina-ai/jina/issues/553) +# - [Contributing Guideline](https://github.com/jina-ai/jina/blob/master/CONTRIBUTING.md) +# +# Note, other CI tests will *not* *start* until the commit messages get fixed. +# +# This message will be deleted automatically when the commit messages get fixed. +# reaction-type: "eyes" lint-ruff: runs-on: ubuntu-latest From 5704d5aeb8c314d3e17a99d97b704cf4826fb8b9 Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 13:15:32 +0100 Subject: [PATCH 05/10] chore(ci): fix do ci only once Signed-off-by: Sami Jaghouar --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e35db553881..8390b0e6f30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [push, pull_request] +on: [push] jobs: From 78a7db9543b953e25f584cc887e6a4760a2036ce Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 13:21:30 +0100 Subject: [PATCH 06/10] chore(ci): fix blsck Signed-off-by: Sami Jaghouar --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8390b0e6f30..84611067d2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: python -m pip install --upgrade pip python -m pip install poetry poetry install --only dev - poetry run black . + poetry run black --check . env: CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} From 4e16005e418943dda214edc6083778db2f2ed2d4 Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 13:30:05 +0100 Subject: [PATCH 07/10] chore(ci): update on what trigger pr Signed-off-by: Sami Jaghouar --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84611067d2e..25699967be0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,11 @@ name: CI -on: [push] - +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize] jobs: commit-lint: From 3ebe44dc7df5348b1b32aa94c35b6b8848724766 Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 13:30:44 +0100 Subject: [PATCH 08/10] chore(ci): apply black Signed-off-by: Sami Jaghouar --- tests/integrations/typing/tensor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/integrations/typing/tensor.py b/tests/integrations/typing/tensor.py index 0d17207e667..880e1df65a8 100644 --- a/tests/integrations/typing/tensor.py +++ b/tests/integrations/typing/tensor.py @@ -1,11 +1,10 @@ import numpy as np -from docarray.typing import Tensor from docarray import Document +from docarray.typing import Tensor def test_set_tensor(): - class MyDocument(Document): tensor: Tensor From 3981c197fbf78879aa146303d4e783136a6b171f Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 13:33:13 +0100 Subject: [PATCH 09/10] chore(ci): add check mypy to success all Signed-off-by: Sami Jaghouar --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25699967be0..b04335b2edb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,7 +178,7 @@ jobs: # just for blocking the merge until all parallel core-test are successful success-all-test: - needs: [docarray-test, commit-lint] + needs: [docarray-test, check-mypy, commit-lint] if: always() runs-on: ubuntu-latest steps: From 97c905db02a8bef06656e0c3990cb5463481c16b Mon Sep 17 00:00:00 2001 From: Sami Jaghouar Date: Mon, 14 Nov 2022 13:37:53 +0100 Subject: [PATCH 10/10] chore(ci): re add commit link comment Signed-off-by: Sami Jaghouar --- .github/workflows/ci.yml | 66 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b04335b2edb..56155898225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,24 +11,24 @@ jobs: commit-lint: runs-on: ubuntu-latest steps: -# - name: find the prev warning if exist -# uses: peter-evans/find-comment@v1 -# id: fc -# with: -# issue-number: ${{ github.event.pull_request.number }} -# comment-author: "github-actions[bot]" -# body-includes: "bad commit message" -# - name: Delete comment if exist -# if: ${{ steps.fc.outputs.comment-id != 0 }} -# uses: actions/github-script@v3 -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} -# script: | -# github.issues.deleteComment({ -# owner: context.repo.owner, -# repo: context.repo.repo, -# comment_id: ${{ steps.fc.outputs.comment-id }}, -# }) + - name: find the prev warning if exist + uses: peter-evans/find-comment@v1 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: "github-actions[bot]" + body-includes: "bad commit message" + - name: Delete comment if exist + if: ${{ steps.fc.outputs.comment-id != 0 }} + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: ${{ steps.fc.outputs.comment-id }}, + }) - uses: actions/checkout@v2.5.0 with: fetch-depth: 0 @@ -36,21 +36,21 @@ jobs: - uses: wagoid/commitlint-github-action@v1 env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" -# - name: if lint failed -# if: ${{ failure() }} -# uses: peter-evans/create-or-update-comment@v1 -# with: -# issue-number: ${{ github.event.pull_request.number }} -# body: | -# Thanks for your contribution :heart: -# :broken_heart: Unfortunately, this PR has one ore more **bad commit messages**, it can not be merged. To fix this problem, please refer to: -# - [Commit Message Guideline for the First Time Contributor](https://github.com/jina-ai/jina/issues/553) -# - [Contributing Guideline](https://github.com/jina-ai/jina/blob/master/CONTRIBUTING.md) -# -# Note, other CI tests will *not* *start* until the commit messages get fixed. -# -# This message will be deleted automatically when the commit messages get fixed. -# reaction-type: "eyes" + - name: if lint failed + if: ${{ failure() }} + uses: peter-evans/create-or-update-comment@v1 + with: + issue-number: ${{ github.event.pull_request.number }} + body: | + Thanks for your contribution :heart: + :broken_heart: Unfortunately, this PR has one ore more **bad commit messages**, it can not be merged. To fix this problem, please refer to: + - [Commit Message Guideline for the First Time Contributor](https://github.com/jina-ai/jina/issues/553) + - [Contributing Guideline](https://github.com/jina-ai/jina/blob/master/CONTRIBUTING.md) + + Note, other CI tests will *not* *start* until the commit messages get fixed. + + This message will be deleted automatically when the commit messages get fixed. + reaction-type: "eyes" lint-ruff: runs-on: ubuntu-latest