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

Added github test tools #137

Open
wants to merge 1 commit 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
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: "\U0001F41E Bug Report"
description: Create a bug report to help us fix it
labels: ["bug"]
body:
- type: checkboxes
attributes:
label: Actions before raising this issue
options:
- label: I searched the existing issues and did not find anything similar.
required: true
- label: I read/searched [the docs](https://docs.cvat.ai/docs/)
required: true

- type: textarea
attributes:
label: Steps to Reproduce
description: Provide a link to a live example or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Possible Solution
description: |
Not obligatory, but suggest a fix/reason for the bug, or ideas on how to implement the addition or change
validations:
required: false
- type: textarea
attributes:
label: Context
description: |
How has this issue affected you? What are you trying to accomplish?
Providing context helps us come up with a solution that is most useful in the real world!

Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
Include relevant details about the environment you experienced
placeholder: |
- Git hash commit (`git log -1`):
- Docker version `docker version` (e.g. Docker 17.0.05):
- Are you using Docker Swarm or Kubernetes?
- Operating System and version (e.g. Linux, Windows, MacOS):
- Code example or link to GitHub repo or gist to reproduce problem:
- Other diagnostic information / logs:
<details>
<summary>Logs from `cvat` container</summary>
</details>
render: Markdown
validations:
required: false
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "\U0001F680 Feature Request"
description: Suggest an idea for this project
labels: ["enhancement"]
body:
- type: checkboxes
attributes:
label: Actions before raising this issue
options:
- label: I searched the existing issues and did not find anything similar.
required: true
- label: I read/searched [the docs](https://docs.cvat.ai/docs/)
required: true
- type: textarea
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is.
placeholder: I'm always frustrated when I have to press this small button.
validations:
required: false
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
placeholder: Make this button bigger
validations:
required: false
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
placeholder: I wanted to buy bigger display, but it would be too expensive.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: |
Add any other context or screenshots about the feature request here.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
38 changes: 38 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- Raise an issue to propose your change (https://github.com/cvat-ai/cvat/issues).
It helps to avoid duplication of efforts from multiple independent contributors.
Discuss your ideas with maintainers to be sure that changes will be approved and merged.
Read the [Contribution guide](https://docs.cvat.ai/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it fixes an open
issue, please link to the issue here. Describe your changes in detail, add
screenshots. -->

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes that apply.
If an item isn't applicable for some reason, then ~~explicitly strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the pull request.
If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] I submit my changes into the `main` branch
- [ ] I have created a changelog fragment <!-- see top comment in CHANGELOG.md -->
- [ ] I have updated the documentation accordingly
- [ ] I have added tests to cover my changes
- [ ] I have linked related issues (see [GitHub docs](
https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))
- [ ] I have increased versions of npm packages if it is necessary
<!-- ([cvat-canvas](https://github.com/cvat-ai/cvat/tree/develop/cvat-canvas#versioning),
[cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning),
[cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning) and
[cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning)) -->

### License

- [ ] I submit _my code changes_ under the same [MIT License] that covers the project.
Feel free to contact the maintainers if that's a concern.
34 changes: 34 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
comment:
layout: "header, diff, components"

component_management:
individual_components:
- component_id: cvat-ui
name: cvat-ui
paths:
- cvat/cvat-canvas/**
- cvat/cvat-canvas3d/**
- cvat/cvat-core/**
- cvat/cvat-data/**
- cvat/cvat-ui/**
- audino-frontend/**
- component_id: cvat-server
name: cvat-server
paths:
- cvat/cvat/**
- cvat/cvat-cli/**
- cvat/cvat-sdk/**
- cvat/utils/**

codecov:
require_ci_to_pass: yes
notify:
wait_for_ci: yes

coverage:
status:
patch: false
project:
default:
target: auto
threshold: 5%
29 changes: 29 additions & 0 deletions .github/workflows/bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Bandit
on: pull_request
jobs:
Linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: files
uses: tj-actions/[email protected]
with:
submodules: true
files: |
cvat/**/*.py
files_ignore: |
cvat/**/cvat-sdk/*

- name: Run checks
run: |
CHANGED_FILES="${{steps.files.outputs.all_changed_files}}"

if [[ ! -z $CHANGED_FILES ]]; then
pipx install bandit

echo "Bandit version: "$(bandit --version | head -1)
echo "The files will be checked: "$(echo $CHANGED_FILES)
bandit -a file --ini .bandit $CHANGED_FILES
else
echo "No files with the \"py\" extension found"
fi
43 changes: 43 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Black
on: pull_request
jobs:
Linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: files
uses: tj-actions/[email protected]
with:
submodules: true
files: |
cvat/cvat-sdk/**/*.py
cvat/cvat-cli/**/*.py
cvat/tests/python/**/*.py
cvat/cvat/apps/quality_control/**/*.py
cvat/cvat/apps/analytics_report/**/*.py
dir_names: true

- name: Run checks
env:
PR_FILES_AM: ${{ steps.files.outputs.added_modified }}
PR_FILES_RENAMED: ${{ steps.files.outputs.renamed }}
run: |
# If different modules use different Black configs,
# we need to run Black for each python component group separately.
# Otherwise, they all will use the same config.

UPDATED_DIRS="${{steps.files.outputs.all_changed_files}}"

if [[ ! -z $UPDATED_DIRS ]]; then
pipx install $(egrep "black.*" ./cvat/cvat-cli/requirements/development.txt)

echo "Black version: "$(black --version)
echo "The dirs will be checked: $UPDATED_DIRS"
EXIT_CODE=0
for DIR in $UPDATED_DIRS; do
black --check --diff $DIR || EXIT_CODE=$(($? | $EXIT_CODE)) || true
done
exit $EXIT_CODE
else
echo "No files with the \"py\" extension found"
fi
79 changes: 79 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main", "develop", master, release-* ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "develop" ]
schedule:
- cron: '27 19 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
submodules: true
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
with:
submodules: true

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
submodules: true
Loading