Skip to content

Refactor sloc scanner to be a class #124

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

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a2d61ac
Refactor setup.py (#48)
turbaszek Oct 12, 2020
b371d80
Introduce github actions for CI (#47)
turbaszek Oct 16, 2020
2002a53
Apply pre-commit checks to all files and make CI green (#58)
turbaszek Oct 16, 2020
9376200
Add Github Action and license badge (#60)
turbaszek Oct 17, 2020
aaae65d
Add and unify license headers (#61)
turbaszek Oct 22, 2020
7092e86
Add dev docker compose (#50)
turbaszek Oct 23, 2020
5e18332
Refactor api to be a package (#51)
turbaszek Oct 24, 2020
edb9a91
Make Kibble a package (#67)
turbaszek Oct 24, 2020
340f104
Add auto-labeler for PRs (#68)
turbaszek Oct 24, 2020
e4563ca
Fix labeler definitions (#70)
turbaszek Oct 24, 2020
d7f9031
Add Black to pre-commit (#66)
Oct 24, 2020
17e6734
Add kibana dashboard to dokcer-compose (#75)
turbaszek Oct 27, 2020
2abfcc8
Add KibbleConfigParser (#74)
skekre98 Oct 27, 2020
4d5f537
Fix deprecation warning for yaml.load() (#82)
midhun1998 Oct 27, 2020
5471c07
Remove ulimits for elasticsearch in docker-compose (#80)
turbaszek Oct 27, 2020
6959f3c
Use KibbleConfigParser in setup script (#83)
turbaszek Nov 2, 2020
0a11b51
Add scanners to main repository (#78)
turbaszek Nov 10, 2020
4884cf5
GitHub uses main as default branch, so we should obviously look for t…
Humbedooh Nov 12, 2020
7d70dd5
Refactor setup scripts as kibble cli command (#91)
skekre98 Nov 14, 2020
3d03a24
Build docker image on CI (#92)
turbaszek Nov 14, 2020
639f10c
Add isort pre-commit hook (#96)
turbaszek Nov 17, 2020
1aa6804
Remove unused variables (#98)
Nov 27, 2020
393635e
Refactor make_account as cli command (#94)
turbaszek Nov 27, 2020
5228a4a
fix doc typo (#99)
Nov 27, 2020
e437790
Fix broken Kibble (#106)
kaxil Dec 12, 2020
275c55f
Update pre-commits hook from 2.3 to 3.0 (#101)
kaxil Dec 13, 2020
36e2cf7
Fix asf.yaml INFRA link (#102)
kaxil Dec 13, 2020
d285764
Replace mention of 'master' branch with 'main' (#103)
kaxil Dec 13, 2020
e07e601
Use https URL for Kibble in setup.py (#104)
kaxil Dec 13, 2020
076bbe4
Fix various typos (#105)
kaxil Dec 13, 2020
f03b7ed
Use python:3.8-slim image for Dockerfile (#107)
kaxil Dec 13, 2020
1876559
Fix ES Memory locking issue (#108)
kaxil Dec 13, 2020
d9a3893
Fix error when running Kibble Scanner (#109)
kaxil Dec 13, 2020
729256f
Upgrade black to 20.8b1 (#112)
kaxil Dec 13, 2020
3485535
Improve Code Quality (#113)
kaxil Dec 13, 2020
c14a053
Fix unresolved reference error in kibble/api/plugins/database.py (#111)
kaxil Dec 13, 2020
5bf37a8
Install cloc in Dockerfile to fix git scanner (#110)
kaxil Dec 13, 2020
89748e4
Fix failing test & Run tests on CI (#115)
kaxil Dec 13, 2020
ea59ae0
Show colored output for Pytest & Show diff on pre-commits (#116)
kaxil Dec 13, 2020
f3a4b27
Add scan command to run scanners (#114)
turbaszek Dec 13, 2020
b4025c2
Fix name of config.yml in Github Issue Template (#117)
kaxil Dec 13, 2020
f042a59
Add missing __init__.py file in plugins & cli directory (#118)
kaxil Dec 13, 2020
257992d
Fix the path for the scanners in scanners/README.md (#119)
kaxil Dec 13, 2020
f8d731c
Improve code quality of scanners (#120)
turbaszek Dec 13, 2020
e19cf6c
Make scanners use kibble.ini instead of config.yaml (#122)
turbaszek Dec 13, 2020
96959ac
Introduce a BaseScanner class (#121)
turbaszek Dec 16, 2020
dee60e4
Refactor sloc scanner to be a class
turbaszek Dec 17, 2020
a3a7a83
fixup! Refactor sloc scanner to be a class
turbaszek Dec 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

# https://cwiki.apache.org/confluence/display/INFRA/.asf.yaml+features+for+git+repositories
# https://cwiki.apache.org/confluence/display/INFRA/git+-+.asf.yaml+features
---
github:
description: "Apache Kibble - a tool to collect, aggregate and visualize data about any software project"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature request
about: Idea or feature request
about: Idea or feature request
title: ''
labels: 'kind:feature'
assignees: ''
Expand Down
23 changes: 23 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
area:api:
- 'kibble/api/*'

area:cli:
- 'kibble/cli/*'

area:scanners:
- 'kibble/scanners/*'

area:ui:
- 'ui/*'

area:docs:
- 'docs/*'
- '*.md'

area:dev:
- '.github/*'
- '.pre-commit.config.yaml'
- 'asf.yaml'
- 'Dockerfile*'
- 'docker*'
- 'setup.*'
53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
---
name: CI
on:
- push
- pull_request

jobs:
statics:
name: Static checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
with:
extra_args: --show-diff-on-failure
build-docker:
name: Build kibble dev image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: docker-compose -f docker-compose-dev.yaml build setup
- name: Run kibble command
run: docker run apache/kibble kibble --help
- name: Check dependencies
run: docker run apache/kibble pip check
run-tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- run: pip install '.[devel]'
- run: pytest tests --color=yes
12 changes: 12 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "PR labeler"
on:
- pull_request_target

jobs:
triage:
name: Label
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Apache Kibble files
api/yaml/kibble.yaml
api/yaml/kibble.yaml*
kibble/api/yaml/kibble.yaml*

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
54 changes: 53 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,60 @@ minimum_pre_commit_version: "1.20.0"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v3.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: ^ui/vendors/.*$
- id: trailing-whitespace
exclude: ^ui/vendors/.*$
- id: fix-encoding-pragma
args:
- --remove
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.9
hooks:
- id: insert-license
name: Add license for all other files
exclude: ^\.github/.*$
args:
- --comment-style
- "|#|"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
files: >
\.cfg$|^Dockerfile.*$|\.sh$|\.bash$|\.py$|\.yml$|\.yaml$
- id: insert-license
name: Add license for all rst files
exclude: ^\.github/.*$
args:
- --comment-style
- "||"
- --license-filepath
- license-templates/LICENSE.rst
- --fuzzy-match-generates-todo
files: \.rst$
- id: insert-license
name: Add license for all md and html files
files: \.md$|\.html$
exclude: ^\.github/.*$|
args:
- --comment-style
- "<!--|| -->"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
name: Black
types: [python]
- repo: https://github.com/timothycrosley/isort
rev: 5.6.4
hooks:
- id: isort
name: Run isort to sort imports
args: ['--multi-line', '3', '--trailing-comma']
files: \.py$
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code of Conduct

The Apache Kibble project follows the
The Apache Kibble project follows the
[Apache Software Foundation code of conduct](https://www.apache.org/foundation/policies/conduct.html).

If you observe behavior that violates those rules please follow the
If you observe behavior that violates those rules please follow the
[ASF reporting guidelines](https://www.apache.org/foundation/policies/conduct#reporting-guidelines).
58 changes: 55 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Kibble #

## Community
## Community

The main development and design discussion happens on our mailing lists.
We have a list specifically for development, and one for future user questions and feedback.
Expand All @@ -15,5 +15,57 @@ We also have:

## Development installation

This project requires Python in higher version than 3.3.
More information will come soon!
You should be able to install Apache Kibble by simply doing:
```
pip install -e ."[devel]"
```

The easiest option to spin up a development environment is to use our development docker-compose.
The development image has mounted all Kibble sources so all your local code changes will be automatically
reflected in the running app.

First you need to configure the Elasticsearch node:
```
docker-compose -f docker-compose-dev.yaml up setup
```
Once you see the
```
setup_1 | All done, Kibble should...work now :)
```
Now you can can launch Apache Kibble ui:
```
docker-compose -f docker-compose-dev.yaml up ui
```
The ui should be available under `http://0.0.0.0:8000` or `http://localhost:8000`. To log in you can use
the dummy admin account `admin@kibble` and password `kibbleAdmin`.

You can also start only the API server:
```
docker-compose -f docker-compose-dev.yaml up kibble
```

## Code Quality

Apache Kibble project is using [pre-commits](https://pre-commit.com) to ensure the quality of the code.
We encourage you to use pre-commits, but it's not required in order to contribute. Every change is checked
on CI and if it does not pass the tests it cannot be accepted. If you want to check locally then
you should install Python3.6 or newer together and run:
```bash
pip install pre-commit
# or
brew install pre-commit
```
For more installation options visit the [pre-commits](https://pre-commit.com).

To turn on pre-commit checks for commit operations in git, run:
```bash
pre-commit install
```
To run all checks on your staged files, run:
```bash
pre-commit run
```
To run all checks on all files, run:
```bash
pre-commit run --all-files
```
29 changes: 29 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

FROM python:3.8-slim

USER root
RUN apt-get update
RUN apt-get install -y gcc git unzip cloc

COPY . /kibble/

WORKDIR /kibble

RUN pip install --upgrade pip
RUN pip install -e .
28 changes: 27 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metis Dashboard (MIT License)
------------------------------------------------------------------------

Copyright (c) 2015 onokumus
Copyright (c) 2015 onokumus
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
Expand Down Expand Up @@ -187,3 +187,29 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


------------------------------------------------------------------------
Loguru (MIT License)
------------------------------------------------------------------------

MIT License

Copyright (c) 2017

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<p align="center"><img src="/ui/images/kibble-logo.png" width="300"/></p>

# Apache Kibble
![CI](https://github.com/apache/kibble/workflows/CI/badge.svg)
[![License](http://img.shields.io/:license-Apache%202-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)

Apache Kibble is a tool to collect, aggregate and visualize data about any software project that uses commonly known tools. It consists of two components:

- **Kibble Server** (this repository) - main database and UI Server. It serves as the hub
for the scanners to connect to, and provides the overall management of sources as well as the
visualizations and API end points.
- **Kibble scanners** ([kibble-scanners](https://github.com/apache/kibble-scanners)) - a collection of
scanning applications each designed to work with a specific type of resource (git repo, mailing list,
scanning applications each designed to work with a specific type of resource (git repo, mailing list,
JIRA, etc) and push compiled data objects to the Kibble Server.

## Documentation
Expand Down
Loading