-
Notifications
You must be signed in to change notification settings - Fork 2
π Merge devjules5 Advanced Features into dev #13
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
Changes from all commits
92e1f2e
b211fc1
4b15752
650d1a3
9c1a979
7a2c636
ccac96d
b939fb0
5310dd2
e87be51
2bd3bf5
9ab472f
4781cf3
3c706e3
2a57f3d
847aae5
3194f7b
6fa634f
8a5a136
0460af9
682ef85
41af30e
ab6428e
771bf0b
2421f9c
7aa4c48
2d42fe0
4d2da1e
9f045de
4af7030
9b77ea0
9ebde87
706438b
b48a8fb
8d3f8cf
15d6da2
9c88a1f
8c1b865
10d73fb
f7226d3
dd54229
9bbfb3c
f519ef4
2301ccf
fffaa59
830c305
1e15201
99b7a1f
e4af582
6094453
83b052b
2287413
05e372f
eb2b666
14ac34b
794e9e7
0dc7b1b
48d32fe
48642be
1f77d02
953467d
a532ccc
e325020
3028054
f86a398
cb4c687
2a8d70b
c2e2b39
0ca4c64
c502b01
0d0537e
a7b3fa8
9ee8cc4
3cbbe01
0c3381d
ac20eea
8b4f8d7
7d11aa2
44ed3a0
02f760e
669682c
2c5b6d0
a0c9011
939f481
aa1ee95
4820084
26211a7
f6d748e
0ab7782
43e3211
2a2d6b9
e99416a
ed96458
4c2402c
0497317
d278a53
ffed7df
8e3e225
d877162
3e56476
a47c9fe
9acaa7e
bf7ef8e
3e4dd2f
091e5e0
bd1b72e
eb4fe3c
3dbb9bb
34fde64
57a1dec
6c54d57
25359a3
8ee0fb4
85108c3
725c88f
9a7bdf7
9a5e2ab
ef8fd11
25bc687
01d9af7
66fb6ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # Git | ||
| .git | ||
| .gitignore | ||
| .gitattributes | ||
|
|
||
| # Python | ||
| __pycache__ | ||
| *.pyc | ||
| *.pyo | ||
| *.pyd | ||
| .Python | ||
| env | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
| .tox | ||
| .coverage | ||
| .coverage.* | ||
| .pytest_cache | ||
| htmlcov | ||
|
|
||
| # Virtual environments | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
|
|
||
| # IDEs | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| .DS_Store? | ||
| ._* | ||
| .Spotlight-V100 | ||
| .Trashes | ||
| ehthumbs.db | ||
| Thumbs.db | ||
|
|
||
| # Documentation | ||
| docs/_build/ | ||
| docs/build/ | ||
| *.md | ||
| !README.md | ||
|
|
||
| # Testing | ||
| .pytest_cache/ | ||
| .coverage | ||
| htmlcov/ | ||
| .tox/ | ||
| .cache | ||
|
|
||
| # Build artifacts | ||
| build/ | ||
| dist/ | ||
| *.egg-info/ | ||
|
|
||
| # Logs | ||
| *.log | ||
| logs/ | ||
|
|
||
| # Temporary files | ||
| tmp/ | ||
| temp/ | ||
| .tmp | ||
|
|
||
| # Docker | ||
| Dockerfile* | ||
| .dockerignore | ||
| docker-compose*.yml | ||
|
|
||
| # CI/CD | ||
| .github/ | ||
| .gitlab-ci.yml | ||
| .travis.yml | ||
| .circleci/ | ||
|
|
||
| # Data files (can be large) | ||
| *.csv | ||
| *.json | ||
| *.geojson | ||
| *.shp | ||
| *.dbf | ||
| *.shx | ||
| *.prj | ||
| *.cpg | ||
| *.tif | ||
| *.tiff | ||
| *.nc | ||
| *.h5 | ||
| *.hdf5 | ||
|
|
||
| # Cache directories | ||
| .cache/ | ||
| .mypy_cache/ | ||
| .ruff_cache/ | ||
|
|
||
| # Poetry - keep both files for reproducible builds | ||
| # poetry.lock - needed for reproducible builds | ||
| # pyproject.toml - needed for installation |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,31 @@ | ||
| data/** filter=lfs diff=lfs merge=lfs -text | ||
| # Set the default behavior, in case people don't have core.autocrlf set. | ||
| * text=auto | ||
|
|
||
| # Force LF line endings for source code and scripts. | ||
| *.py text eol=lf | ||
| *.sh text eol=lf | ||
| *.yml text eol=lf | ||
| *.yaml text eol=lf | ||
| *.md text eol=lf | ||
| *.toml text eol=lf | ||
|
|
||
| # Keep CRLF line endings for Windows batch files | ||
| *.bat text eol=crlf | ||
| *.cmd text eol=crlf | ||
|
|
||
| # Handle common binary files | ||
| *.png binary | ||
| *.jpg binary | ||
| *.jpeg binary | ||
| *.gif binary | ||
| *.ico binary | ||
| *.pdf binary | ||
| *.svg text | ||
|
|
||
| # Jupyter Notebooks (keep as text for easier diffs, but you can mark as binary if not collaborating on them) | ||
| *.ipynb text | ||
|
|
||
| # Prevent Git from guessing for these | ||
| *.zip binary | ||
| *.exe binary | ||
| *.dll binary |
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,33 +1,142 @@ | |||||||||||||||||||||||||||||||||||
| name: CI | |||||||||||||||||||||||||||||||||||
| on: [push, pull_request] | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| permissions: | |||||||||||||||||||||||||||||||||||
| contents: read | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| name: PyMapGIS CI/CD Pipeline | |||||||||||||||||||||||||||||||||||
| 'on': | |||||||||||||||||||||||||||||||||||
| push: | |||||||||||||||||||||||||||||||||||
| branches: | |||||||||||||||||||||||||||||||||||
| - main | |||||||||||||||||||||||||||||||||||
| - develop | |||||||||||||||||||||||||||||||||||
| pull_request: | |||||||||||||||||||||||||||||||||||
| branches: | |||||||||||||||||||||||||||||||||||
| - main | |||||||||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||||||||
| PYTHON_VERSION: '3.11' | |||||||||||||||||||||||||||||||||||
| POETRY_VERSION: 1.6.1 | |||||||||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||||||||
| test: | |||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||
| strategy: | |||||||||||||||||||||||||||||||||||
| matrix: | |||||||||||||||||||||||||||||||||||
| python-version: ["3.10", "3.11", "3.12"] | |||||||||||||||||||||||||||||||||||
| python-version: | |||||||||||||||||||||||||||||||||||
| - '3.10' | |||||||||||||||||||||||||||||||||||
| - '3.11' | |||||||||||||||||||||||||||||||||||
| - '3.12' | |||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | |||||||||||||||||||||||||||||||||||
| - uses: actions/setup-python@v4 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| python-version: ${{ matrix.python-version }} | |||||||||||||||||||||||||||||||||||
| - run: pip install poetry | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| - run: poetry install --with dev --no-interaction | |||||||||||||||||||||||||||||||||||
| - run: poetry run pytest -q || [ $? -eq 5 ] | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| lint: | |||||||||||||||||||||||||||||||||||
| - name: Checkout code | |||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||||||||
| - name: Set up Python | |||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v4 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| python-version: ${{ matrix.python-version }} | |||||||||||||||||||||||||||||||||||
| - name: Install Poetry | |||||||||||||||||||||||||||||||||||
| uses: snok/install-poetry@v1 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| version: ${{ env.POETRY_VERSION }} | |||||||||||||||||||||||||||||||||||
| - name: Configure Poetry | |||||||||||||||||||||||||||||||||||
| run: poetry config virtualenvs.create true | |||||||||||||||||||||||||||||||||||
| - name: Install dependencies | |||||||||||||||||||||||||||||||||||
| run: poetry install --with dev | |||||||||||||||||||||||||||||||||||
| - name: Run tests | |||||||||||||||||||||||||||||||||||
| run: poetry run pytest && poetry run mypy pymapgis/ && poetry run ruff check | |||||||||||||||||||||||||||||||||||
| pymapgis/ | |||||||||||||||||||||||||||||||||||
| - name: Upload coverage reports | |||||||||||||||||||||||||||||||||||
| uses: codecov/codecov-action@v3 | |||||||||||||||||||||||||||||||||||
| if: matrix.python-version == '3.11' | |||||||||||||||||||||||||||||||||||
| security: | |||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | |||||||||||||||||||||||||||||||||||
| - uses: actions/setup-python@v4 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| python-version: "3.12" | |||||||||||||||||||||||||||||||||||
| - run: pip install poetry | |||||||||||||||||||||||||||||||||||
| - run: poetry install --with dev --no-interaction | |||||||||||||||||||||||||||||||||||
| - run: poetry run ruff check | |||||||||||||||||||||||||||||||||||
| - run: poetry run black --check . | |||||||||||||||||||||||||||||||||||
| - name: Checkout code | |||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||||||||
| - name: Set up Python | |||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v4 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| python-version: ${{ env.PYTHON_VERSION }} | |||||||||||||||||||||||||||||||||||
| - name: Install Poetry | |||||||||||||||||||||||||||||||||||
| uses: snok/install-poetry@v1 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| version: ${{ env.POETRY_VERSION }} | |||||||||||||||||||||||||||||||||||
| - name: Configure Poetry | |||||||||||||||||||||||||||||||||||
| run: poetry config virtualenvs.create true | |||||||||||||||||||||||||||||||||||
| - name: Install dependencies | |||||||||||||||||||||||||||||||||||
| run: poetry install --with dev | |||||||||||||||||||||||||||||||||||
| - name: Run security scan with bandit | |||||||||||||||||||||||||||||||||||
| run: poetry run pip install bandit && poetry run bandit -r pymapgis/ -f json -o security-scan-results.json || true | |||||||||||||||||||||||||||||||||||
| - name: Run dependency check | |||||||||||||||||||||||||||||||||||
| run: poetry run pip install safety && poetry run safety check || true | |||||||||||||||||||||||||||||||||||
| build: | |||||||||||||||||||||||||||||||||||
| needs: | |||||||||||||||||||||||||||||||||||
| - test | |||||||||||||||||||||||||||||||||||
| - security | |||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||
| if: github.ref == 'refs/heads/main' | |||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||
| - name: Checkout code | |||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||||||||
| - name: Set up Docker Buildx | |||||||||||||||||||||||||||||||||||
| uses: docker/setup-buildx-action@v3 | |||||||||||||||||||||||||||||||||||
| - name: Check Docker credentials | |||||||||||||||||||||||||||||||||||
| id: docker-check | |||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||
| if [ -n "${{ secrets.DOCKER_USERNAME }}" ] && [ -n "${{ secrets.DOCKER_PASSWORD }}" ]; then | |||||||||||||||||||||||||||||||||||
| echo "has_credentials=true" >> $GITHUB_OUTPUT | |||||||||||||||||||||||||||||||||||
| else | |||||||||||||||||||||||||||||||||||
| echo "has_credentials=false" >> $GITHUB_OUTPUT | |||||||||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||||||||
| - name: Login to Docker Hub | |||||||||||||||||||||||||||||||||||
| if: steps.docker-check.outputs.has_credentials == 'true' | |||||||||||||||||||||||||||||||||||
| uses: docker/login-action@v3 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| username: ${{ secrets.DOCKER_USERNAME }} | |||||||||||||||||||||||||||||||||||
| password: ${{ secrets.DOCKER_PASSWORD }} | |||||||||||||||||||||||||||||||||||
| - name: Build and push Docker image | |||||||||||||||||||||||||||||||||||
| if: steps.docker-check.outputs.has_credentials == 'true' | |||||||||||||||||||||||||||||||||||
| uses: docker/build-push-action@v5 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| context: . | |||||||||||||||||||||||||||||||||||
| push: true | |||||||||||||||||||||||||||||||||||
| tags: | | |||||||||||||||||||||||||||||||||||
| pymapgis/pymapgis-app:latest | |||||||||||||||||||||||||||||||||||
| pymapgis/pymapgis-app:${{ github.sha }} | |||||||||||||||||||||||||||||||||||
| cache-from: type=gha | |||||||||||||||||||||||||||||||||||
| cache-to: type=gha,mode=max | |||||||||||||||||||||||||||||||||||
| - name: Build Docker image (local only) | |||||||||||||||||||||||||||||||||||
| if: steps.docker-check.outputs.has_credentials == 'false' | |||||||||||||||||||||||||||||||||||
| uses: docker/build-push-action@v5 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| context: . | |||||||||||||||||||||||||||||||||||
| push: false | |||||||||||||||||||||||||||||||||||
| tags: | | |||||||||||||||||||||||||||||||||||
| pymapgis/pymapgis-app:latest | |||||||||||||||||||||||||||||||||||
| pymapgis/pymapgis-app:${{ github.sha }} | |||||||||||||||||||||||||||||||||||
| cache-from: type=gha | |||||||||||||||||||||||||||||||||||
| cache-to: type=gha,mode=max | |||||||||||||||||||||||||||||||||||
| - name: Deployment status | |||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||
| if [ "${{ steps.docker-check.outputs.has_credentials }}" = "true" ]; then | |||||||||||||||||||||||||||||||||||
| echo "β Docker image built and pushed to Docker Hub successfully!" | |||||||||||||||||||||||||||||||||||
| echo "π Image: pymapgis/pymapgis-app:latest" | |||||||||||||||||||||||||||||||||||
| else | |||||||||||||||||||||||||||||||||||
| echo "βΉοΈ Docker image built locally (no registry push)" | |||||||||||||||||||||||||||||||||||
| echo "π To enable container registry push, see: docs/deployment/container-registry-setup.md" | |||||||||||||||||||||||||||||||||||
| echo "π§ Quick fix: Add DOCKER_USERNAME and DOCKER_PASSWORD secrets to enable Docker Hub push" | |||||||||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||||||||
| deploy-staging: | |||||||||||||||||||||||||||||||||||
| needs: | |||||||||||||||||||||||||||||||||||
| - build | |||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||
| environment: staging | |||||||||||||||||||||||||||||||||||
| if: github.ref == 'refs/heads/main' | |||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||
| - name: Deploy to staging | |||||||||||||||||||||||||||||||||||
| run: echo 'Deploying to staging environment' | |||||||||||||||||||||||||||||||||||
| - name: Run smoke tests | |||||||||||||||||||||||||||||||||||
| run: echo 'Running smoke tests' | |||||||||||||||||||||||||||||||||||
| deploy-production: | |||||||||||||||||||||||||||||||||||
|
Comment on lines
+122
to
+132
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Copilot AutofixAI 9 months ago To fix the issue, we will add a
The
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||
| needs: | |||||||||||||||||||||||||||||||||||
| - deploy-staging | |||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||
| environment: production | |||||||||||||||||||||||||||||||||||
| if: github.ref == 'refs/heads/main' | |||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||
| - name: Deploy to production | |||||||||||||||||||||||||||||||||||
| run: echo 'Deploying to production environment' | |||||||||||||||||||||||||||||||||||
| - name: Run health checks | |||||||||||||||||||||||||||||||||||
| run: echo 'Running health checks' | |||||||||||||||||||||||||||||||||||
|
Comment on lines
+133
to
+142
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Copilot AutofixAI 9 months ago To fix the issue, we will add a
We will also add specific permissions to individual jobs if they require additional privileges, such as
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 9 months ago
To fix the issue, we need to add a
permissionsblock to the workflow. This block should specify the least privileges required for each job. For example:contents: read.pull-requests: write.The
permissionsblock can be added at the root level of the workflow to apply to all jobs or within individual jobs for more granular control.