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

chore: Adding template tooling and fixing markdown #1

Merged
merged 2 commits into from
Oct 30, 2024
Merged
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
89 changes: 89 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Git
.git
.gitignore
.gitattributes


# CI
.codeclimate.yml
.travis.yml
.taskcluster.yml

# Docker
docker-compose.yml
Dockerfile
.docker
.dockerignore

# Byte-compiled / optimized / DLL files
**/__pycache__/
**/*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Virtual environment
.env
.venv/
venv/

# PyCharm
.idea

# Python mode for VIM
.ropeproject
**/.ropeproject

# Vim swap files
**/*.swp

# VS Code
.vscode/
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @voxel51/aloha-shirts
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Rationale

<!-- Explain why you are making this change. Describe the problem. -->

## Changes

<!-- Describe the changes. -->

## Testing

<!-- Describe the way the changes were tested. -->

<!-- Optional Sections:

## Screenshots
## To Do
## Notes
## Related

-->

<!-- Template for collapsed sections
<details>
<summary></summary>
</details>
-->
50 changes: 50 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Docker Builds For Voxel51 Discord Bot

on:
push:
branches:
- "main"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: 'write'
id-token: 'write'
env:
GCP_LOCATION: ''
GCP_PROJECT: ''
GCP_DOCKER_REPOSITORY: ''
GCP_HELM_REGISTRY: ''
GCP_SERVICE_ACCOUNT: ''
VERSION: ${{ github.sha }}
steps:
- uses: actions/checkout@v4
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: ${{ env.GCP_PROJECT }}
service_account: ${{ env.GCP_SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.ORG_GOOGLE_WORKLOAD_IDP }}
- name: Set Up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Docker login
run: |
gcloud auth print-access-token | docker login \
-u oauth2accesstoken \
--password-stdin "https://${{ env.GCP_LOCATION }}-docker.pkg.dev"
- name: Helm login
run: |
gcloud auth print-access-token | \
helm registry login -u oauth2accesstoken \
--password-stdin "https://${{ env.GCP_LOCATION }}-docker.pkg.dev"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/amd64,linux/arm64
file: ./external/VoxelBot/dockerfile
context: ./external/VoxelBot
tags: ${{ env.GCP_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT }}/${{ env.GCP_DOCKER_REPOSITORY }}/voxel51-discordbot:${{ env.VERSION }}
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: pre-commit

on:
pull_request:
types:
- opened
- synchronize

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/setup-python@v5.2.0
- name: install asdf & tools
uses: asdf-vm/actions/install@v3.0.2
- uses: pre-commit/action@v3.0.1
6 changes: 6 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
default: true

MD013: # Line Length
code_blocks: false
tables: false
53 changes: 53 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
exclude: argocd/crds/7.3.6/applicationset-crd.yaml
- id: check-case-conflict
- id: check-shebang-scripts-are-executable
- id: check-yaml
args:
- --allow-multiple-document
exclude: apps/platform/atlantis/templates/.*yaml|argocd/crds/.*yaml
- id: detect-aws-credentials
args:
- --allow-missing-credentials
- id: end-of-file-fixer
- id: mixed-line-ending
- id: pretty-format-json
- id: trailing-whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: forbid-tabs
exclude_types:
- makefile
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.36.0
hooks:
- id: markdownlint
- id: markdownlint-fix
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
entry: yamllint --config-file .yamllint.yaml
exclude: apps/platform/atlantis/templates/.*yaml|argocd/crds/.*yaml
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args:
- --exclude-secrets
- '(auth|secretName|secretKey)'
- repo: https://github.com/rhysd/actionlint
rev: v1.7.0
hooks:
- id: actionlint
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
5 changes: 5 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
helm 3.15.1
kubectl 1.30.1
pre-commit 3.4.0
python 3.10.14
shellcheck 0.10.0
6 changes: 6 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
extends: default
rules:
indentation:
spaces: 2
line-length: disable
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Help
.PHONY: $(shell sed -n -e '/^$$/ { n ; /^[^ .\#][^ ]*:/ { s/:.*$$// ; p ; } ; }' $(MAKEFILE_LIST))

help:
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

.DEFAULT_GOAL := help

asdf: ## Update plugins, add plugins, install plugins, set local, reshim
@echo "Updating asdf plugins..."
@asdf plugin update --all >/dev/null 2>&1 || true

@echo "Adding asdf plugins..."
@cut -d" " -f1 .tool-versions | xargs -I{} asdf plugin add {} >/dev/null 2>&1 || true

@echo "Installing asdf tools..."
@cat .tool-versions | xargs -I{} bash -c 'asdf install {}'

@echo "Setting local package versions..."
@cat .tool-versions | xargs -I{} bash -c 'asdf local {}'

@echo "Reshimming.."
@asdf reshim

hooks: ## Install git hooks (pre-commit)
@pre-commit install
@pre-commit install --hook-type commit-msg

# Install environments for all available hooks now (rather than when they are first executed)
@pre-commit install --install-hooks

pre-commit: ## Run pre-commit against all files
@pre-commit run -a
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# Voxelbot

Voxelbot is a versatile Discord bot designed for the FiftyOne Discord community, utilizing the [Hata](https://github.com/HuyaneMatsu/hata) framework. It offers a range of features for server management, user interaction, and community engagement.
Voxelbot is a versatile Discord bot designed for the FiftyOne Discord
community, utilizing the
[Hata](https://github.com/HuyaneMatsu/hata)
framework. It offers a range of features for server management, user interaction,
and community engagement.

## Features

Voxelbot’s functionality is modular, with each feature residing in its own plugin located under `voxelbot/plugins`. Below is an overview of the core plugins:

- **code_metrics.py**: Tracks and provides metrics related to the fiftyone repo. Useful for monitoring development activity within the Discord server.
- **faqs.py**: Manages a frequently asked questions (FAQ) system, allowing server members to easily find answers to common questions.
- **moderation_menu.py**: ability to softkick someone Bans a user, then unbans them, deleting their messages in the process.
- **easy_github_contribution.py**: Simplifies the verification of contributors to open-source projects.
Voxelbot’s functionality is modular, with each feature residing in its own
plugin located under `voxelbot/plugins`. Below is an overview of the core plugins:

- **code_metrics.py**: Tracks and provides metrics related to the fiftyone repo.
Useful for monitoring development activity within the Discord server.
- **faqs.py**: Manages a frequently asked questions (FAQ) system,
allowing server members to easily find answers to common questions.
- **moderation_menu.py**: ability to softkick someone Bans a user,
then unbans them, deleting their messages in the process.
- **easy_github_contribution.py**: Simplifies the verification of
contributors to open-source projects.
- **logging.py**: Logs the activity on the discord to monitor any bad behaviour
- **misc.py**: Some easy simple commands

Expand All @@ -20,11 +29,16 @@ git clone https://github.com/yourusername/voxelbot.git
cd voxelbot
```

Configure the bot: Set up your required vriables in the `.env` file inside voxelbot or export them in your shell.
Configure the bot: Set up your required vriables in the `.env` file inside
voxelbot or export them in your shell.

### Running in docker

The simplest and most efficient way to run Voxelbot is through Docker. We've provided a `docker-run.sh` script that sets up and runs the bot inside a Docker container. This ensures that the bot runs in a consistent environment without needing to manually manage dependencies.
The simplest and most efficient way to run Voxelbot is through Docker.
We've provided a `docker-run.sh` script that sets up and runs the bot
inside a Docker container.
This ensures that the bot runs in a consistent environment without
needing to manually manage dependencies.

To run the bot using Docker:

Expand Down
13 changes: 10 additions & 3 deletions assets/faqs/fiftyone-teams.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Fiftyone Teams

[FiftyOne Teams](https://voxel51.com/fiftyone-teams/) enables multiple users to securely collaborate on the same datasets and models, either on-premises or in the cloud, all built on top of the open source FiftyOne workflows that you’re already relying on.
[FiftyOne Teams](https://voxel51.com/fiftyone-teams/)
enables multiple users to securely collaborate on the same
datasets and models, either on-premises or in the cloud,
all built on top of the open source FiftyOne workflows that
you’re already relying on.

You can try it out [here](https://try.fiftyone.ai/)
You can try it out
[here](https://try.fiftyone.ai/)

If you like what you see [lets have a call](https://voxel51.com/schedule-teams-workshop) to help you get setup
If you like what you see
[lets have a call](https://voxel51.com/schedule-teams-workshop)
to help you get setup
6 changes: 5 additions & 1 deletion assets/faqs/quickstart.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
Welcome to fiftyone! You can start by reading through the documentation here: <https://docs.voxel51.com/index.html>
# Quickstart

Welcome to fiftyone!
You can start by reading through the documentation
here[https://docs.voxel51.com/index.html]
Loading