diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..94d05f7 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,38 @@ +Bugsink is a Django-based error tracker. It's maintained by one developer and favors simple, predictable code over +abstract generality. Python 3.12 is the standard environment. + +## Coding Guidance + +* Keep it clear and simple. +* Avoid overly clever or verbose code — this isn't Java. +* Use Django idioms: models, views, middleware, etc. +* Follow PEP8 and ensure `flake8` passes (CI ignores E127, E741, E501, E731). +* Use descriptive names, short functions, minimal boilerplate. + +## Tests + +* Prefer a few focused unit tests around testable logic. +* Broader integration tests are fine to exercise key flows. +* It's OK to generate simple coverage-style tests — just mark them with: + `# LLM-generated test for coverage` + +### Further details + +##### Database + +* Bugsink assumes a single-writer DB model (no write concurrency). +* Keep writes short +* Use `bugsink/transaction.py` helpers like `@durable_atomic` etc. + +##### Frontend (Tailwind) + +* Bugsink doesn't have a backend/frontend split: "classic django instead" +* Bugsink uses Tailwind via `django-tailwind` +* Before committing, build the CSS and add it: + `python manage.py tailwind build && git add theme/static/css/dist/styles.css` + +##### Other + +* Use function-based views by default. +* Use `python manage.py runserver` (uses `bugsink.settings.development`) +* The default SQLite setup should work out of the box. diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 0000000..4d95dac --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,44 @@ +name: "Copilot Setup Steps" +on: + push: + paths: + - ".github/workflows/copilot-setup-steps.yml" + workflow_dispatch: + # The "on" section defines when this workflow runs independently. + # It has no effect on Copilot itself — Copilot runs this job on demand + # if the job name is exactly "copilot-setup-steps". + # These triggers just let us test the workflow manually if needed. + +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + permissions: + contents: read + env: + DJANGO_SETTINGS_MODULE: bugsink.settings.development + SAMPLES_DIR: ${{ github.workspace }}/event-samples + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements.development.txt + # We install directly from source using pip — no wheels, no Docker. + # This keeps the setup fast and simple for Copilot. + # To ensure correctness for more complex scenarios (e.g. multiple DBs), + # we rely on the actual CI pipeline. + + - name: Fetch event-samples data + uses: actions/checkout@v4 + with: + repository: bugsink/event-samples + path: event-samples +