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

test code #34

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,20 @@ concurrency:
cancel-in-progress: true

jobs:
MacOS2:
if: ${{ github.repository == 'driazati/tvm' }}
runs-on: ubuntu-latest
steps:
- name: quit
run: |
exit 1
MacOS:
if: ${{ github.repository == 'apache/tvm' }}
runs-on: macOS-latest
if: ${{ github.repository == 'driazati/tvm' }}
runs-on: ubuntu-latest
steps:
- name: quit
run: |
exit 1
- uses: actions/checkout@v2
with:
submodules: 'recursive'
Expand Down
1 change: 1 addition & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,4 @@ tasks.
```bash
./docker/build.sh ci_cpu tests/scripts/task_golang.sh
```
hi
41 changes: 23 additions & 18 deletions tests/scripts/github_tvmbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,30 +566,35 @@ def check_author(pr, triggering_comment, args):
return False


def check_collaborator(pr, triggering_comment, args):
logging.info("Checking collaborators")
# Get the list of collaborators for the repo filtered by the comment
# author
def search_users(name, triggering_comment, testing_json, search_fn):
logging.info(f"Checking {name}")
commment_author = triggering_comment["user"]["login"]
if args.testing_collaborators_json:
collaborators = json.loads(args.testing_collaborators_json)
if testing_json:
matching_users = json.loads(testing_json)
else:
collaborators = pr.search_collaborator(commment_author)
logging.info(f"Found collaborators: {collaborators}")
matching_users = search_fn(commment_author)
logging.info(f"Found {name}: {matching_users}")
user_names = {user["login"] for user in matching_users}

return len(collaborators) > 0 and commment_author in collaborators
return len(matching_users) > 0 and commment_author in user_names


def check_mentionable_users(pr, triggering_comment, args):
logging.info("Checking mentionable users")
commment_author = triggering_comment["user"]["login"]
if args.testing_mentionable_users_json:
mentionable_users = json.loads(args.testing_mentionable_users_json)
else:
mentionable_users = pr.search_mentionable_users(commment_author)
logging.info(f"Found mentionable_users: {mentionable_users}")
def check_collaborator(pr, triggering_comment, args):
return search_users(
name="collaborators",
triggering_comment=triggering_comment,
search_fn=pr.search_collaborator,
testing_json=args.testing_collaborators_json,
)


return len(mentionable_users) > 0 and commment_author in mentionable_users
def check_mentionable_users(pr, triggering_comment, args):
return search_users(
name="mentionable users",
triggering_comment=triggering_comment,
search_fn=pr.search_mentionable_users,
testing_json=args.testing_mentionable_users,
)


AUTH_CHECKS = {
Expand Down