This repository was archived by the owner on Nov 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Add Github issues and PRs scanner #8
Draft
turbaszek
wants to merge
7
commits into
apache:main
Choose a base branch
from
turbaszek:add-github-scanners
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0bc940d
Add Github issues and PRs scanner
turbaszek 5fdca3b
fixup! Add Github issues and PRs scanner
turbaszek 6b2228d
fixup! fixup! Add Github issues and PRs scanner
turbaszek 75346a9
fixup! fixup! fixup! Add Github issues and PRs scanner
turbaszek 454233e
fixup! fixup! fixup! fixup! Add Github issues and PRs scanner
turbaszek b0359a0
Add Elasticsearch
turbaszek 0fb16e6
Update architecture.rst
sharanf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| version: '3' | ||
|
|
||
| services: | ||
| # Elasticsearch node required as a database for Apache Kibble | ||
| elasticsearch: | ||
| image: elasticsearch:7.13.1 | ||
| ports: | ||
| - 9200:9200 | ||
| - 9300:9300 | ||
| environment: | ||
| node.name: es01 | ||
| discovery.seed_hosts: es02 | ||
| cluster.initial_master_nodes: es01 | ||
| cluster.name: kibble | ||
| ES_JAVA_OPTS: -Xms256m -Xmx256m | ||
| ulimits: | ||
| memlock: | ||
| soft: -1 | ||
| hard: -1 | ||
| volumes: | ||
| - "kibble-es-data:/usr/share/elasticsearch/data" | ||
|
|
||
| # Kibana to view and manage Elasticsearch | ||
| kibana: | ||
| image: kibana:7.13.1 | ||
| ports: | ||
| - 5601:5601 | ||
| depends_on: | ||
| - elasticsearch | ||
| environment: | ||
| ELASTICSEARCH_URL: http://elasticsearch:9200 | ||
| ELASTICSEARCH_HOSTS: http://elasticsearch:9200 | ||
|
|
||
| volumes: | ||
| # named volumes can be managed easier using docker-compose | ||
| kibble-es-data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| .. 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. | ||
|
|
||
| Apache Kibble Overview | ||
| ====================== | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sharanf @Humbedooh @kaxil @michalslowikowski00 I added some docs/notes about current status and how things are. Let me know what do you think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks Tomek! This is good work. I have added some minor text changes. |
||
|
|
||
| Kibble configuration | ||
| -------------------- | ||
|
|
||
| Currently Apache Kibble is configured using `kibble.yaml` configuration file. | ||
|
|
||
| Database configuration | ||
| ...................... | ||
|
|
||
| .. code-block:: | ||
|
|
||
| elasticsearch: | ||
| hosts: | ||
| - http://localhost:9200 | ||
|
|
||
| Data sources configuration | ||
| .......................... | ||
|
|
||
| Multiple data sources can be configured. Each data source is defined by a python class. Additionally to that users | ||
| have to pass ``name`` and ``config`` which is a configuration specific for a given data source. | ||
|
|
||
| .. code-block:: | ||
|
|
||
| data_sources: | ||
| - name: name | ||
| class: path.to.a.Class | ||
| config: | ||
| # Data source specific configuration | ||
|
|
||
| Data source | ||
| ----------- | ||
|
|
||
| Data source represents an external source of information (for example Github, JIRA, mailing list etc). Each data source | ||
| is a python package. In this way users can easily build their own data sources and use them with Kibble. | ||
|
|
||
| Data source package has to have the following structure: | ||
|
|
||
| .. code-block:: | ||
|
|
||
| data_source_name/ | ||
| | __init__.py | ||
| | ... | ||
| | data_types | ||
| | | __init__.py | ||
| | | type1.py | ||
| | | type2.py | ||
| | | ... | ||
|
|
||
| The ``data_source_name.__init__`` should include the class defining the data source but the class can be placed in another | ||
| file in top leve directory of the package. | ||
|
|
||
| Data types | ||
| .......... | ||
|
|
||
| Data type represents a single type of data within a data source. For example if Github is a data source then issues and | ||
| comments will be two different data types. A data type is a class that has to implement ``fetch_data`` method that is | ||
| used to fetch and persist data. | ||
|
|
||
| Data types are automatically determined using data source class path. | ||
|
|
||
| Each data type is an index in Kibble elasticsearch instance. The data should be stored "as is" so users can leverage existing | ||
| documentation. | ||
|
|
||
| Next to persisting data, a data type should also define metrics that can be calculate on retrieved data. | ||
|
|
||
| Configuring a data source | ||
| ......................... | ||
|
|
||
| As described previously data sources can be configured in ``kibble.yaml`` config file. For example: | ||
|
|
||
| .. code-block:: | ||
|
|
||
| data_sources: | ||
| - name: kibble_github | ||
| class: kibble.data_sources.github.GithubDataSource | ||
| config: | ||
| repo_owner: apache | ||
| repo_name: kibble | ||
| enabled_data_types: | ||
| - issues | ||
| - discussions | ||
|
|
||
| - name: pulsar_github | ||
| class: kibble.data_sources.github.GithubDataSource | ||
| config: | ||
| repo_owner: apache | ||
| repo_name: pulsar | ||
| enabled_data_types: | ||
| - issues | ||
| - comments | ||
|
|
||
| - name: pulsar_dev_list | ||
| class: kibble.data_sources.pony.PonyDataSource | ||
| config: | ||
| list_name: dev@pulsar.apache.org | ||
| enabled_data_types: | ||
| - threads | ||
|
|
||
| In the above example we can see that: | ||
|
|
||
| * We configured two different data sources based on ``GithubDataSource``: apache/pulsar and apache/kibble Github repositories. | ||
| For both sources we fetch different information. For Kibble we fetch issues and discussions data while for Apache | ||
| Pulsar we fetch issues and comments data. | ||
| * There's also a third data source using ``PonyDataSource`` configured for Apache Pulsar dev list. | ||
|
|
||
| Thanks to this design users will gain more granularity to configure the data they want to fetch. This also creates a big | ||
| opportunity for configuring different authorization options for each data source in future. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| .. 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| .. 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. | ||
|
|
||
| Installation steps | ||
| ================== | ||
|
|
||
| To install Apache Kibble run: | ||
|
|
||
| .. code-block:: | ||
|
|
||
| pip install -e ".[devel]" | ||
|
|
||
| You will also need a Elasticsearch instance up and running. You can setup one using docker-compose | ||
|
|
||
| .. code-block:: | ||
|
|
||
| docker-compose -f docker-compose.dev.yaml up | ||
|
|
||
| Once ES is running you can scan configured data sources: | ||
|
|
||
| .. code-block:: | ||
| kibble scanners run -s github_kibble |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # 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 pathlib import Path | ||
| from typing import Dict | ||
|
|
||
| import yaml | ||
|
|
||
| KIBBLE_YAML = "kibble.yaml" | ||
|
|
||
|
|
||
| def parse_kibble_yaml() -> Dict: | ||
| """Reads kibble.yaml config file""" | ||
| config_path = Path(__file__).parent.parent.joinpath(KIBBLE_YAML) | ||
| with open(config_path, "r") as stream: | ||
| config = yaml.safe_load(stream) | ||
| return config | ||
|
|
||
|
|
||
| kconfig = parse_kibble_yaml() | ||
|
|
||
| if __name__ == "__main__": | ||
| parse_kibble_yaml() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # 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. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.