This repository contains the source code for BigBOSS, a tool designed to monitor and analyze contributions and Codes of Conduct (CoC) in Open Source Software (OSS) projects. The project includes two main services:
conductAnalyzer
: Analyzes comments for adherence to a predefined code of conduct and generates appropriate responses.cocAnalyzer
: Processes and evaluates code of conduct (CoC) files, identifies ethical patterns, and detects compliance with Contributor Covenant guidelines.
These services are integrated with GitHub Actions to automate the analysis and management of comments and CoC files in OSS repositories. See the GitHub Actions Integration section for more details.
This project provides:
- Scripts for:
- Detecting and analyzing comments for appropriate behavior (conductAnalyzer).
- Detecting and analyzing Code of Conduct (CoC) content (cocAnalyzer).
- Evaluating alignment with Contributor Covenant guidelines.
- Extracting ethical flags from comments and CoC files based on predefined patterns.
- Python 3.8 or higher
- Flask
- SQLite (or an alternative database engine)
- Ollama for downloading and using the language model
To install dependencies, run:
pip install -r requirements.txt
git clone https://github.com/your-repository/bigboss.git
cd bigboss
By default, the tool uses SQLite. Ensure the database connection in database.py
is configured according to your needs.
Download the required model using Ollama:
ollama download mixtral:8x22b
BigBOSS relies on a set of GitHub Actions to enable seamless monitoring and analysis of contributions and Codes of Conduct in OSS repositories. These actions automate workflows for analyzing comments, managing Code of Conduct files, and creating issues or pull requests as needed.
To ensure full functionality, the following GitHub Actions must be configured in your repository:
-
Comment Analyzer
: Handles analysis of comments in issues, pull requests, and discussions, and triggers appropriate actions such as generating responses or notifying repository owners. -
Code of Conduct Analyzer
: Processes and sends Code of Conduct files to the analysis server for evaluation. -
Code of Conduct Initializer
: Adds or updates theCODE_OF_CONDUCT.md
file in repositories where it is missing or outdated. -
Issue Manager
: Creates issues for repositories with incomplete or missing Code of Conduct guidelines.
Ensure the following steps are completed to integrate the actions:
- Add the required secrets (e.g.,
GITHUB_TOKEN
,SERVER_URL
,BOT_USER
,BOT_TOKEN
) to your GitHub repository. - Include the appropriate workflow files (e.g.,
.github/workflows/comment-analyzer.yml
) in your repository. - Configure the actions with the necessary inputs to match your project's requirements.
Start the Flask server:
python app.py
The server will be accessible at: http://0.0.0.0:5000
.
Analyzes comments for ethical and professional behavior. Generates responses for flagged comments.
Endpoint: /analyze
Method: POST
Payload (example):
{
"comment_id": "12345",
"event_type": "issue_comment",
"user": "user123",
"user_id": "67890",
"user_avatar_url": "https://example.com/avatar.jpg",
"user_html_url": "https://github.com/user123",
"user_type": "User",
"comment_body": "Thank you for your help!",
"created_at": "2023-01-01T00:00:00Z",
"updated_at": "2023-01-01T00:00:00Z",
"event_number": "1",
"event_title": "Issue title",
"event_body": "Issue body",
"event_url": "https://github.com/repo/issues/1",
"comment_url": "https://github.com/repo/issues/1#issuecomment-1",
"repository_name": "repo",
"response_comment": null,
"response_at": null
}
Processes and evaluates Code of Conduct (CoC) files for compliance and ethical patterns.
Endpoint: /analyze
Method: POST
Payload (example):
{
"type": "code_of_conduct",
"repository_name": "repo",
"repository_url": "https://github.com/repo",
"code_of_conduct": "This is the text of the CoC file."
}
app.py
: Entry point for the Flask application.config.py
: Contains constants and configurations for both services.controllers/
:controller.py
: Defines the route handler for comment and CoC analysis.
models/
:conductanalyzer.py
: Defines data handling and database interactions for comment analysis.cocanalyzer.py
: Defines data handling and database interactions for CoC analysis.
services/
:conductanalyzer.py
: Implements comment analysis using a language model.cocanalyzer.py
: Implements CoC evaluation and flag detection.
We welcome contributions! Please refer to the CONTRIBUTING.md file for details on our development guidelines.
This project adheres to a Code of Conduct. By participating, you agree to uphold our Code of Conduct.
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.