From 6403cf63af296bb7e262f13919417b7ce3423ef7 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Wed, 22 Jan 2025 15:26:32 -0800 Subject: [PATCH 1/3] Add GitHub Actions workflows for quality and security checks\n\n- Add quality.yml for code style and formatting checks\n- Add security.yml for security scanning with Bandit\n- Mirror pre-commit configuration in both workflows\n- Set up dependency caching for faster runs\n\nFixes #4 --- .github/workflows/quality.yml | 46 ++++++++++++++++++++++++++++++++++ .github/workflows/security.yml | 29 +++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/quality.yml create mode 100644 .github/workflows/security.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 00000000..8614362a --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,46 @@ +name: Quality Checks + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + quality: + name: Code Quality + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install poetry + poetry install --with dev + + - name: Check trailing whitespace and file endings + uses: pre-commit/action@v3.0.1 + with: + extra_args: trailing-whitespace end-of-file-fixer --all-files + + - name: Run isort + run: poetry run isort . --check-only --diff --profile black + + - name: Run Black + run: poetry run black . --check --diff + + - name: Run Flake8 + run: | + poetry run flake8 . \ + --max-line-length=100 \ + --extend-ignore=E203,W503 \ + --exclude=.git,__pycache__,build,dist \ + --per-file-ignores="__init__.py:F401 tests/*:D100,D101,D102,D103" \ + --docstring-convention=google diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 00000000..5a3b44e7 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,29 @@ +name: Security Checks + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + security: + name: Security Scan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install poetry + poetry install --with dev + + - name: Run Bandit + run: poetry run bandit -c pyproject.toml -r . -ll From 070ef9860ea79325f6067ded57957c8cf080514b Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Wed, 22 Jan 2025 15:33:21 -0800 Subject: [PATCH 2/3] Use config for quality tools instead of hard code switches --- .github/dependabot.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/quality.yml | 25 +++++++------------------ 2 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..8410b079 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,33 @@ +version: 2 +updates: + # Python dependencies + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + open-pull-requests-limit: 10 + groups: + dev-dependencies: + patterns: + - "black" + - "isort" + - "flake8*" + - "bandit" + - "pre-commit" + - "pytest*" + versioning-strategy: "lockfile-only" + labels: + - "dependencies" + - "python" + + # GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + open-pull-requests-limit: 10 + labels: + - "dependencies" + - "github-actions" diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 8614362a..8d5a5598 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -25,22 +25,11 @@ jobs: pip install poetry poetry install --with dev - - name: Check trailing whitespace and file endings - uses: pre-commit/action@v3.0.1 - with: - extra_args: trailing-whitespace end-of-file-fixer --all-files - - - name: Run isort - run: poetry run isort . --check-only --diff --profile black - - - name: Run Black - run: poetry run black . --check --diff - - - name: Run Flake8 + - name: Check file formatting run: | - poetry run flake8 . \ - --max-line-length=100 \ - --extend-ignore=E203,W503 \ - --exclude=.git,__pycache__,build,dist \ - --per-file-ignores="__init__.py:F401 tests/*:D100,D101,D102,D103" \ - --docstring-convention=google + # Check for files that would be reformatted by black + poetry run black . --check --diff + # Check import sorting + poetry run isort . --check-only --diff + # Check code style + poetry run flake8 . From 6528f6bac753610e6f74447aaf8d00c390786634 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Wed, 22 Jan 2025 16:30:06 -0800 Subject: [PATCH 3/3] Add project docs --- CHANGELOG.md | 9 +++++++++ LICENSE | 7 +++++++ README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 4 ++-- 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..83065ac5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## [1.0.0] - 2025-01-22 + +Initial release: + +- Download JIRA tickets to local filesystem +- Maintain hierarchy (initiatives -> epics -> stories) +- Support for single ticket or recursive downloads diff --git a/LICENSE b/LICENSE index e69de29b..31bcdba9 100644 --- a/LICENSE +++ b/LICENSE @@ -0,0 +1,7 @@ +# MIT License + +Copyright 2025 Brad Edwards + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index e69de29b..076d74d9 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,42 @@ +[![Quality Checks](https://github.com/KeplerOps/Ground-Control/actions/workflows/quality.yml/badge.svg)](https://github.com/KeplerOps/Ground-Control/actions/workflows/quality.yml) +[![Security Checks](https://github.com/KeplerOps/Ground-Control/actions/workflows/security.yml/badge.svg)](https://github.com/KeplerOps/Ground-Control/actions/workflows/security.yml) + +# Ground Control + +Download JIRA tickets to your filesystem. Keeps the hierarchy (initiatives -> epics -> stories) intact. + +## Setup + +1. Create a JIRA API token + +2. Set environment variables: + +```bash +JIRA_URL=https://your-org.atlassian.net +JIRA_PROJECT=YOUR-PROJECT +JIRA_USERNAME=your.email@example.com +JIRA_API_TOKEN=your-token +``` + +## Install + +```bash +pip install poetry +poetry install +``` + +## Usage + +```bash +# Download all tickets +poetry run ground-control + +# Download a specific ticket +poetry run ground-control PROJ-123 + +# Download a ticket and its children +poetry run ground-control PROJ-123 -r + +# Use a different output directory +poetry run ground-control -o /path/to/dir +``` diff --git a/pyproject.toml b/pyproject.toml index 84d4575a..d6f9e925 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,9 +4,9 @@ build-backend = 'setuptools.build_meta' [tool.poetry] name = "ground-control" -version = "0.1.0" +version = "1.0.0" description = "A tool for syncing Jira tickets with local files" -authors = ["Your Name "] +authors = ["Brad Edwards "] [tool.poetry.dependencies] python = "^3.12"