Skip to content
This repository was archived by the owner on Jan 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4ff208f
Add initial implementation of foo function
May 25, 2025
fa4a584
Fix workflow trigger to ensure it only runs on the main branch for pu…
May 25, 2025
f9ccbe4
Update workflows to trigger on push events and set permissions
May 25, 2025
9950868
Remove 'master' branch from workflow triggers in devcontainer verific…
May 25, 2025
c7bde40
Change workflow triggers from push to pull_request for version enforc…
May 25, 2025
88c3789
Implement foo function to print "bar"
May 25, 2025
9725a3d
Update paths in suggest_version_bump workflow to use paths-ignore syn…
May 25, 2025
4d71f4c
Remove unused foo function from new_function.py
May 25, 2025
6011a61
Add bar function to return "bar"
May 25, 2025
2591901
Fix quoting in workflow scripts for environment variable assignments
May 25, 2025
c8efb37
Add workflows for version enforcement, suggestion, and unit testing
May 25, 2025
ce83fe5
Refactor workflow configurations for consistency and clarity
May 25, 2025
919d2a5
Update suggest-version workflow to detect changed folders and restore…
May 25, 2025
0828819
Set fetch-depth to 0 for checkout steps in version enforcement and su…
May 25, 2025
bc1efe6
Add job summary reporting for suggested version bumps
May 25, 2025
3e3229d
Fix pull_request trigger to prevent unintended workflow runs
May 25, 2025
ffbe803
Fix quoting for GITHUB_STEP_SUMMARY in suggest-version workflow
May 26, 2025
2ce0ffe
Remove unused bar function from foo.py
May 26, 2025
bde7fa9
Refactor API structure and update dependencies; remove unused files a…
May 26, 2025
aa87567
Update .gitignore to include .pyc files and remove compiled Python by…
May 26, 2025
f0aa7bb
Update Python version to 3.13 in Dockerfile and unit-tests.yml; refac…
May 26, 2025
c008aee
Add docstrings to main API files and enhance test coverage for home e…
May 26, 2025
5361a61
Enhance documentation and improve linter configuration; update test c…
May 26, 2025
2efc8e2
Remove redundant docstring from v1 routes and add it to v2 routes for…
May 26, 2025
1608202
Fix label retrieval in PR workflow to join labels into a single string
May 26, 2025
8e4954a
Update version comment in main.py to indicate future GitHub Actions i…
May 26, 2025
7810dd1
Refactor GitHub Actions workflows: consolidate version detection and …
May 26, 2025
524cb75
Update permissions and add checkout step in get-pr-labels workflow
May 26, 2025
b34b549
Refactor workflow jobs: rename detect job for clarity and update depe…
May 26, 2025
3607e7c
Update workflows: change permissions to write and enhance step names …
May 26, 2025
b1762a4
Update devcontainer-verification and enforce-version workflows: add p…
May 26, 2025
0085003
Fix output references in detect-changed-versions workflow for consist…
May 26, 2025
67e1fa5
Fix description quotes in workflow outputs for consistency
May 26, 2025
fa478da
Update suggest-version-bump workflow: add pull-requests permission
May 26, 2025
189bd80
Remove TODO comment for version update in main.py
May 26, 2025
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
36 changes: 36 additions & 0 deletions .github/workflows/detect-changed-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Detect Changed Versions

permissions:
contents: read
statuses: read

on:
workflow_call:
outputs:
versions:
description: 'Changed version folders'
value: ${{ jobs.detect-changed-versions.outputs.versions }}

jobs:
detect-changed-versions:
name: Detect Changed Versions
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.list-folders.outputs.versions }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changed version folders
id: list-folders
run: |
git fetch origin main
BASE_SHA=$(git merge-base HEAD origin/main)

CHANGED=$(git diff --name-only "$BASE_SHA"...HEAD | grep '^routes/v[0-9]\+/.*\.py$' | grep -v 'test' || true)
VERSIONS=$(echo "$CHANGED" | sed -n 's|^routes/\(v[0-9]\+\)/.*|\1|p' | sort -u | tr '\n' ' ')
echo "versions=$VERSIONS" >> "$GITHUB_OUTPUT"
3 changes: 2 additions & 1 deletion .github/workflows/devcontainer-verification.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
name: Scan Devcontainer Image

permissions:
actions: read
contents: read
security-events: write

on:
push:
branches:
- main
- master
pull_request: null

jobs:
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/enforce-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Enforce Correct Version Update

permissions:
contents: read
statuses: write

on:
pull_request:
branches:
- main
paths:
- '**/*.py'
- '!**/tests/**'

jobs:
version-check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changed version folders and main.py
id: detect
run: |
echo "🔍 Checking changed versioned folders and main.py..."

git fetch origin main
BASE_SHA=$(git merge-base HEAD origin/main)

# List changed Python files (excluding tests)
CHANGED=$(git diff --name-only "$BASE_SHA"...HEAD | grep '\.py$' | grep -v 'test' || true)
echo "$CHANGED"

# Extract unique version folders like v1, v2
VERSIONS=$(echo "$CHANGED" | sed -n 's|^app/routes/\(v[0-9]\+\)/.*|\1|p' | sort -u | tr '\n' ' ')
echo "Detected version folders with changes: $VERSIONS"
echo "VERSIONS=$VERSIONS" >> "$GITHUB_ENV"

# Check if main.py was modified
MAIN_CHANGED=$(echo "$CHANGED" | grep '^app/main.py$' || true)
echo "MAIN_CHANGED=$MAIN_CHANGED" >> "$GITHUB_ENV"

- name: Verify version changes and summarize
run: |
echo "📋 Running version change checks..."

git fetch origin main
BASE_SHA=$(git merge-base HEAD origin/main)

REPORT=""
EXIT_CODE=0

# Check version folders
for v in $VERSIONS; do
echo "➡ Checking app/routes/$v/__init__.py"
VERSION_CHANGED=$(git diff "$BASE_SHA"...HEAD -- "app/routes/$v/__init__.py" | grep '__version__ = ' || true)

if [ -z "$VERSION_CHANGED" ]; then
REPORT+="🛑 Version $v was modified, but __version__ was not updated in app/routes/$v/__init__.py\n"
EXIT_CODE=1
else
REPORT+="✅ app/routes/$v/__init__.py includes a version change.\n"
fi
done

# Check main.py
if [ -n "$MAIN_CHANGED" ]; then
echo "➡ Checking app/main.py"
VERSION_CHANGED=$(git diff "$BASE_SHA"...HEAD -- "app/main.py" | grep '__version__ = ' || true)

if [ -z "$VERSION_CHANGED" ]; then
REPORT+="🛑 main.py was modified, but __version__ was not updated in app/main.py\n"
EXIT_CODE=1
else
REPORT+="✅ app/main.py includes a version change.\n"
fi
fi

echo -e "\n==== Version Check Report ===="
echo -e "$REPORT"
echo "================================"

exit $EXIT_CODE
50 changes: 0 additions & 50 deletions .github/workflows/enforce_correct_version_update.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/get-pr-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Get PR Labels

permissions:
contents: read
statuses: read
pull-requests: read

on:
workflow_call:
outputs:
labels:
description: 'Labels on the pull request'
value: ${{ jobs.get-labels.outputs.labels }}

jobs:
get-labels:
name: Get PR Labels
runs-on: ubuntu-latest
outputs:
labels: ${{ steps.labels.outputs.labels }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get PR labels
id: labels
run: |
LABELS=$(gh pr view "${{ github.event.pull_request.number }}" --json labels --jq '[.labels[].name] | join(" ")')
echo "labels=$LABELS" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
47 changes: 47 additions & 0 deletions .github/workflows/suggest-version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Suggest Version Bump

permissions:
contents: read
statuses: read
pull-requests: read

on:
pull_request:
branches: [main]
paths:
- '**/*.py'
- '!**/tests/**'

jobs:
suggest:
uses: ./.github/workflows/detect-changed-versions.yml
labels:
uses: ./.github/workflows/get-pr-labels.yml

analyze:
name: Analyze Changes and Suggest Bumps
needs:
- suggest
- labels
runs-on: ubuntu-latest

steps:
- name: Determine bump type
id: bump
run: |
LABELS="${{ needs.labels.outputs.labels }}"
BUMP="patch"
echo "$LABELS" | grep -q 'type: feature' && BUMP="minor"
echo "$LABELS" | grep -q 'type: security' && BUMP="minor"
# ... other types
echo "bump=$BUMP" >> "$GITHUB_OUTPUT"

- name: Report summary
if: needs.suggest.outputs.versions != ''
run: |
{
echo "### 🚀 Suggested Version Bumps"
for v in ${{ needs.suggest.outputs.versions }}; do
echo "- \`routes/$v/\`: **${{ steps.bump.outputs.bump }}**"
done
} >> "$GITHUB_STEP_SUMMARY"
52 changes: 0 additions & 52 deletions .github/workflows/suggest_version_bump.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
push:
branches:
- main
- master
pull_request: null

jobs:
Expand All @@ -24,9 +23,11 @@ jobs:
with:
fetch-depth: 0

- name: Super-linter
- name: Run Super Linter
uses: super-linter/super-linter@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: false
FILTER_REGEX_EXCLUDE: "(.devcontainer/Dockerfile|.github/pull_request_template.md|.github/ISSUE_TEMPLATE/*.md)"
FILTER_REGEX_EXCLUDE: '(.devcontainer/Dockerfile|.github/pull_request_template.md|.github/ISSUE_TEMPLATE/*.md)'
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_MYPY: false
Loading