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

feat: adjust settings to use guild configs #74

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d3bc7e1
feat: add server count to web ui
JacobCoffee Mar 3, 2024
e1518bf
feat: add event message for new guild joins in dev discord
JacobCoffee Mar 3, 2024
d2b9eef
feat: use guild settings for issue creation link
JacobCoffee Mar 3, 2024
0b62008
fix(ui): adjust plurality of server count
JacobCoffee Mar 3, 2024
24b3080
feat: allow guild-specific github issues
JacobCoffee Mar 3, 2024
f880ce7
docs: add api ref docs
JacobCoffee Mar 3, 2024
e74c6cd
fix(docs): adjust stale links
JacobCoffee Mar 3, 2024
e573f42
fix: better type hints
Mar 3, 2024
1123117
feat: add scaffolding for guild configuration
JacobCoffee Mar 3, 2024
d30d632
docs: update documentation refs
JacobCoffee Mar 3, 2024
4d13052
docs: add basic usage information docs
JacobCoffee Mar 3, 2024
b2c5976
feat(ui): add live health to home page
JacobCoffee Mar 3, 2024
da6ec7c
feat: enhance guild schema detail
JacobCoffee Mar 4, 2024
79a7f89
feat: add predicate for guild admin check
JacobCoffee Mar 9, 2024
b036bb7
feat: add guild configuration command (#78)
JacobCoffee Mar 10, 2024
03a160b
feat: add model for forum configuration
JacobCoffee Mar 10, 2024
187d1b0
feat: update schema for updateable settings
JacobCoffee Mar 10, 2024
67b756b
ci: add helpers for container setup and teardown
JacobCoffee Mar 11, 2024
aeee8bc
feat: update schemas and route for updating
JacobCoffee Mar 11, 2024
aa612ee
fix: correctly load forum config
JacobCoffee Mar 11, 2024
38af834
ci: update deps
JacobCoffee Mar 11, 2024
a73c315
feat: add routes to display sections on guild data
JacobCoffee Mar 11, 2024
d5708fb
ci: add helper for full container refresh
JacobCoffee Mar 11, 2024
47635b8
fix!: new migration for uuid issues
JacobCoffee Mar 11, 2024
bd8ce86
fix: remove blanket check for delete button view
JacobCoffee Mar 11, 2024
653fba1
fix: allow dropdown for config key
JacobCoffee Mar 11, 2024
acc4bf1
chore: updates
JacobCoffee May 11, 2024
b24f92b
ci: 3.12
JacobCoffee May 11, 2024
b3a7c11
ci: 3.11 only in railway
JacobCoffee May 11, 2024
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"

- name: Install Pre-Commit
run: python -m pip install pre-commit && pre-commit install
Expand All @@ -34,7 +34,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
python-version: ["3.12"]
timeout-minutes: 15
defaults:
run:
Expand Down Expand Up @@ -73,12 +73,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: "3.11"
python-version: "3.12"
allow-python-prereleases: true
cache: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: "3.11"
python-version: "3.12"
allow-python-prereleases: true
cache: true

Expand Down
2 changes: 1 addition & 1 deletion .pdm-python
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.venv/bin/python
/Users/jcoffee5/git/public/JacobCoffee/byte/.venv/bin/python
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: "3.11"
python: "3.12"
default_install_hook_types: [commit-msg, pre-commit]
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
Expand All @@ -18,7 +18,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.2.2"
rev: "v0.3.2"
hooks:
- id: ruff
args: ["--fix"]
Expand Down Expand Up @@ -88,7 +88,7 @@ repos:
# discord-py,
# ]
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.351
rev: v1.1.353
hooks:
- id: pyright
additional_dependencies:
Expand Down Expand Up @@ -142,6 +142,7 @@ repos:
asyncpg-stubs,
polyfactory,
discord-py,
types-python-dateutil,
]
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: "v0.9.1"
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python 3.11
python 3.12
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,34 @@ install: ## Install all dependencies
@command -v $(PDM) > /dev/null || (echo "PDM not found. Installing..." && $(MAKE) install-pdm)
$(MAKE) install-pre-commit

up-container: ## Start the Byte database container
@echo "=> Starting Byte database container"
@docker compose -f docker-compose.infra.yml up -d
@echo "=> Started Byte database container"

clean-container: ## Stop, remove, and wipe the Byte database container and volume
@echo "=> Stopping and removing Byte database container"
@docker stop byte-db-1
@docker rm byte-db-1
@docker volume rm byte_db-data
@echo "=> Stopped and removed Byte database container"

load-container: migrate ## Perform database migrations and load test data into the Byte database container
@echo "=> Loading database migrations and test data"
@echo "not yet implemented"
@echo "=> Loaded database migrations and test data"

refresh-container: clean-container up-container load-container ## Refresh the Byte database container


.PHONY: refresh-lockfiles
refresh-lockfiles: ## Sync lockfiles with requirements files.
$(PDM) update --update-reuse -G:all

.PHONY: lock
lock: ## Rebuild lockfiles from scratch, updating all dependencies
$(PDM) update --update-eager -G:all

# =============================================================================
# Tests, Linting, Coverage
# =============================================================================
Expand Down
11 changes: 10 additions & 1 deletion docs/byte/api/lib/common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@ common

Common functions and classes used by the other modules.

.. automodule:: src.byte.lib.common
.. automodule:: src.byte.lib.common.assets
:members:

.. automodule:: src.byte.lib.common.colors
:members:

.. automodule:: src.byte.lib.common.guilds
:members:

.. automodule:: src.byte.lib.common.links
:members:
2 changes: 1 addition & 1 deletion docs/byte/api/lib/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ logging

Logging configuration for Byte

.. automodule:: src.byte.lib.logging
.. automodule:: src.byte.lib.log
:members:
6 changes: 0 additions & 6 deletions docs/byte/api/plugins/guild.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/byte/api/plugins/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ This includes things like commands, event handlers, and other features.
events
general
github
guild
testing
python
6 changes: 6 additions & 0 deletions docs/byte/api/plugins/python.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
======
python
======

.. automodule:: src.byte.plugins.python
:members:
8 changes: 8 additions & 0 deletions docs/byte/api/views/abstract.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
========
abstract
========

Abstract views to be inherited by other views.

.. automodule:: src.byte.views.abstract_views
:members:
8 changes: 8 additions & 0 deletions docs/byte/api/views/astral.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
======
astral
======

Astral Inc. views, for things like Ruff embeds

.. automodule:: src.byte.views.astral
:members:
3 changes: 3 additions & 0 deletions docs/byte/api/views/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ components for your bot.
:caption: Views

forums
astral
python
abstract
8 changes: 8 additions & 0 deletions docs/byte/api/views/python.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
======
python
======

Python views for things like PEP embeds.

.. automodule:: src.byte.views.python
:members:
18 changes: 18 additions & 0 deletions docs/byte/usage/byte.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
==========
About Byte
==========

The Discord side of Byte is utilizing the `discord.py <https://discordpy.readthedocs.io/en/latest/>`_. framework.

The structure of Byte is not too complex. There exists a ``bot.py`` file containing the main
:ref:`Byte` bot class, which includes some on-start utilities like loading cogs and ingesting
new guilds as they join into the database. The class is called via the :func:`run_bot` function
to start the bot.

The structure of Byte is not dissimilar to the structure of the server side; it has a ``lib/``
directory for common backend functionality like utilities, logging, and settings, a ``plugings/``
directory for the cogs, and a ``views/`` directory for the UI components inside of Discord.

For example, any functionality related to `Astral <https://astral.sh/>`_ is located in the
``plugins/astral/`` directory, such as ``ruff`` embeds, and it's related views are located in
``views/astral/``.
5 changes: 5 additions & 0 deletions docs/byte/usage/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
=====
Usage
=====

.. toctree::
:titlesonly:
:caption: Byte Usage Documentation

byte
starting
5 changes: 5 additions & 0 deletions docs/byte/usage/starting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
=============
Starting Byte
=============

.. todo:: This section needs to be written.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx configuration."""

from __future__ import annotations

import importlib.metadata
Expand Down
2 changes: 1 addition & 1 deletion docs/web/api/domain/db/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ API Reference
Model Reference
---------------

.. sqla-model:: server.domain.db.models.GuildConfig
.. sqla-model:: server.domain.db.models.Guild

.. sqla-model:: server.domain.db.models.GitHubConfig

Expand Down
8 changes: 8 additions & 0 deletions docs/web/api/domain/github/helpers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=======
helpers
=======

Helper functions for the GitHub domain.

.. automodule:: src.server.domain.github.helpers
:members:
11 changes: 11 additions & 0 deletions docs/web/api/domain/github/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
======
github
======

.. toctree::
:titlesonly:
:caption: GitHub Domain API Reference
:glob:
:hidden:

*
8 changes: 8 additions & 0 deletions docs/web/api/domain/guilds/controllers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
===========
controllers
===========

Controllers for the guilds domain.

.. automodule:: src.server.domain.guilds.controllers
:members:
8 changes: 8 additions & 0 deletions docs/web/api/domain/guilds/dependencies.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
============
dependencies
============

Dependencies for the guilds domain.

.. automodule:: src.server.domain.guilds.dependencies
:members:
8 changes: 8 additions & 0 deletions docs/web/api/domain/guilds/helpers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=======
helpers
=======

Helper functions for the guilds domain.

.. automodule:: src.server.domain.guilds.helpers
:members:
11 changes: 11 additions & 0 deletions docs/web/api/domain/guilds/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
======
guilds
======

.. toctree::
:titlesonly:
:caption: Guild Domain API Reference
:glob:
:hidden:

*
8 changes: 8 additions & 0 deletions docs/web/api/domain/guilds/schemas.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=======
schemas
=======

Schemas for the system domain.

.. automodule:: src.server.domain.guilds.schemas
:members:
8 changes: 8 additions & 0 deletions docs/web/api/domain/guilds/services.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
========
services
========

Service declaration for the guilds domain.

.. automodule:: src.server.domain.guilds.services
:members:
8 changes: 8 additions & 0 deletions docs/web/api/domain/guilds/urls.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
====
urls
====

URL declarations for the guilds domain routes.

.. automodule:: src.server.domain.guilds.urls
:members:
2 changes: 2 additions & 0 deletions docs/web/api/domain/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ domain
init
urls
system/index
guilds/index
github/index
web/index
db/index
8 changes: 8 additions & 0 deletions docs/web/api/domain/system/dtos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
====
dtos
====

DTOs for the system domain.

.. automodule:: src.server.domain.system.dtos
:members:
8 changes: 8 additions & 0 deletions docs/web/api/domain/system/helpers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=======
helpers
=======

Helper functions for the system domain.

.. automodule:: src.server.domain.system.helpers
:members:
6 changes: 6 additions & 0 deletions docs/web/api/lib/constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
=========
constants
=========

.. automodule:: src.server.lib.constants
:members:
8 changes: 8 additions & 0 deletions docs/web/api/lib/dependencies.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
============
dependencies
============

Dependency management

.. automodule:: src.server.lib.dependencies
:members:
10 changes: 10 additions & 0 deletions docs/web/api/lib/dtos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
====
dtos
====

DTOs for the server.


.. automodule:: src.server.lib.dto
:members:
:noindex:
Loading
Loading