Skip to content

Commit

Permalink
Merge pull request #14 from MajidBenam/majid-qing-merge
Browse files Browse the repository at this point in the history
Majid qing merge 2
  • Loading branch information
MajidBenam authored Dec 3, 2024
2 parents f8642f2 + e80dc20 commit 4561973
Show file tree
Hide file tree
Showing 169 changed files with 46,730 additions and 1,005 deletions.
90 changes: 90 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: "🐛 Bug Report"
description: Report a bug on the Seshat Global History Databank website.
title: "🐛 [BUG] - <title>"
labels: [
"bug"
]
body:
- type: textarea
id: description
attributes:
label: "Description"
description: Please enter an explicit description of your issue
placeholder: Short and explicit description of your incident...
validations:
required: true
# - type: input
# id: reprod-url
# attributes:
# label: "Reproduction URL"
# description: Please enter your GitHub URL to provide a reproduction of the issue
# placeholder: ex. https://github.com/USERNAME/REPO-NAME
# validations:
# required: true
- type: textarea
id: reprod
attributes:
label: "Reproduction steps"
description: Please enter an explicit description of your issue
value: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
render: bash
validations:
required: true
- type: textarea
id: screenshot
attributes:
label: "Screenshots"
description: If applicable, add screenshots to help explain your problem.
value: |
![DESCRIPTION](LINK.png)
render: bash
validations:
required: false
- type: textarea
id: logs
attributes:
label: "Logs"
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: bash
validations:
required: false
- type: dropdown
id: browsers
attributes:
label: "Browsers"
description: What browsers are you seeing the problem on ?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Opera
validations:
required: false
- type: dropdown
id: os
attributes:
label: "OS"
description: What is the impacted environment ?
multiple: true
options:
- Windows
- Linux
- Mac
validations:
required: false
- type: checkboxes
id: definition-of-done
attributes:
label: Definition of Done
description:
Please confirm the following are completed before this issue can be closed.
options:
- label: A fix for the bug has been developed on a branch.
- label: The bug fix branch has been tested in the Staging website.
- label: A pull request has been created for the new branch to be merged into the dev branch.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/DOCS_IMPROVEMENT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: "📚 Documentation Improvement"

description: Suggest changes or improvements to the Seshat documentation.

title: "📚 [Documentation] - <title>"

labels: ["documentation"]

body:
- type: markdown
attributes:
value: |
## Documentation Improvement Request
Thank you for taking the time to help improve our documentation! Please provide the details of your suggestion below.
### Example
**Section of Documentation**: Installation Instructions
**Description of Improvement**: Add a troubleshooting guide for common installation issues on Windows.
**Benefits of Improvement**: Helps users resolve installation problems quickly, reducing frustration and support requests.
**Additional Context**: Based on frequent questions from users in the community forums.
- type: input
id: section
attributes:
label: Section of Documentation
description: Which section of the documentation does this improvement pertain to?
placeholder: "e.g., Installation Instructions, User Guide, API Reference"

- type: textarea
id: description
attributes:
label: Description of Improvement
description: Provide a detailed description of the improvement you are suggesting.
placeholder: "Describe the change or addition you would like to see."

- type: input
id: benefits
attributes:
label: Benefits of Improvement
description: Explain how this improvement will benefit users.
placeholder: "e.g., clearer instructions, easier navigation, more comprehensive coverage"

- type: textarea
id: context
attributes:
label: Additional Context
description: Add any other context or information related to this improvement request.
placeholder: "Include any relevant links, examples, or references."
- type: checkboxes
id: definition-of-done
attributes:
label: Definition of Done
description:
Please confirm the following are completed before this issue can be closed.
options:
- label: The documentation improvement has been developed on a branch.
- label: A pull request has been created for the new branch to be merged into the dev branch.
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "✨ Feature request"
description: Suggest a new feature for the Seshat website.
title: "✨ [Feature request] - <title>"
labels: ["feature-request"]
body:
- type: markdown
attributes:
value: |
Thank you for contributing an idea for a new feature! Please fill out the details below to help us understand your vision for the new feature.
- type: textarea
id: description
attributes:
label: Description of Improvement
description: Provide a detailed description of the improvement you are suggesting.
placeholder: "Describe the change or addition you would like to see."
validations:
required: true

- type: textarea
id: dependencies
attributes:
label: Dependencies
description: Are there any other tasks that need to be completed first?
placeholder: |
- [ ] Dependency 1 (include issue link)
- [ ] Dependency 2 (include issue link)
validations:
required: false

- type: textarea
id: technical-notes
attributes:
label: Technical Notes
description:
Any technical notes, potential challenges, or architectural
considerations for implementation?
placeholder: |
- Note 1
- Note 2
validations:
required: false

- type: checkboxes
id: definition-of-done
attributes:
label: Definition of Done
description:
Please confirm the following are completed before this issue can be closed.
options:
- label: The feature has been developed on a feature branch.
- label: The feature branch has been tested in the Staging website.
- label: A pull request has been created for the feature branch to be merged into the dev branch.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: build_docker_image

on:
push:
branches: [dev]
paths:
- 'Dockerfile'
- 'requirements.txt'
- '.github/workflows/build.yml'
pull_request:
branches: [dev]
paths:
- 'Dockerfile'
- 'requirements.txt'
- '.github/workflows/build.yml'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to GitHub Packages
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: docker.pkg.github.com/seshat-global-history-databank/seshat/tests-image:latest
42 changes: 42 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: docs
on:
push:
branches:
- dev
paths:
- 'docs/**'
pull_request:
branches:
- dev
paths:
- 'docs/**'
workflow_dispatch:
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
concurrency:
group: docs
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8.13
- name: "Upgrade pip"
run: pip install --upgrade pip
- name: "Install docs requirements"
run: pip install -r docs/requirements.txt
- name: "Run sphinx"
run: sphinx-build -b html docs/source docs/_build/
# Note that we're adding deployment for dev branch here.
# In the future, we may want to add a separate workflow for dev branch.
- name: "Deploy"
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docs' || github.ref == 'refs/heads/dev') }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/
force_orphan: true
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: test_code

on:
push:
branches: [dev]
pull_request:
branches: [dev]

jobs:
test_core:
runs-on: ['ubuntu-latest']
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Packages
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Pull and run Docker image
run: |
docker pull docker.pkg.github.com/seshat-global-history-databank/seshat/tests-image:latest
docker run -d -p 5432:5432 -v ${{ github.workspace }}:/seshat -e DJANGO_SETTINGS_MODULE=seshat.settings.local -e POSTGRES_PASSWORD=postgres -e PGDATA=/var/lib/postgresql/data/db-files/ -e GITHUB_ACTIONS='true' --name seshat_testing docker.pkg.github.com/seshat-global-history-databank/seshat/tests-image:latest
- name: Sleep, then check PostgreSQL connectivity
run: |
sleep 10
docker exec seshat_testing psql -h localhost -U postgres -c 'SELECT 1'
- name: Run tests
run: |
docker exec seshat_testing python3 /seshat/manage.py test seshat.apps.core
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,15 @@ cython_debug/
#.idea/

# End of https://www.toptal.com/developers/gitignore/api/django

# Ed's bits
data
database_dumps
seshat/staticfiles
pulumi/logs
pulumi/Pulumi.seshat.yaml
scripts
.DS_Store

docs/source/api/seshat/
docs/source/api/custom_filters/
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM postgis/postgis

# Update the package lists for upgrades for packages that need upgrading, as well as new packages that have just come to the repositories.
RUN apt-get update -y

# Install the packages
RUN apt-get install -y gdal-bin libgdal-dev libgeos++-dev libgeos-c1v5 libgeos-dev libgeos-doc

# Install pip
RUN apt-get install -y python3-pip

# Upgrade pip
RUN python3 -m pip install --upgrade pip

# Copy requirements.txt file into the Docker image
COPY requirements.txt .

# Install Python dependencies
RUN pip install -r requirements.txt

# Install django-geojson
RUN pip install "django-geojson[field]"
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@

This repo contains the necessary Django Python code to host the [Seshat](http://seshat-db.com/) website and interact with the backend PostgreSQL database.

## Documentation

Project documentation can be accessed at https://seshat-global-history-databank.github.io/seshat/

You can generate these docs locally with Python:

```bash
pip install -r docs/requirements.txt
cd docs
make html
```
Loading

0 comments on commit 4561973

Please sign in to comment.