-
Notifications
You must be signed in to change notification settings - Fork 39
Make the application run: repair backend boot, frontend build, and 20 dead endpoints; add Android app #952
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
base: main
Are you sure you want to change the base?
Changes from all commits
3077fb8
cbc1a79
391f6cc
58dd4bc
e2e8224
8053119
6fbb240
e0566ec
8a70abd
f7835df
7f76d61
92b9a4d
3d36fa9
b9fff8f
4807022
53a0d50
92a6213
6f889d3
5b4b91c
78e56ef
3d7eaa3
6e88b0a
08d05d4
b3f80e6
9add48a
76409c0
cc3325e
5355375
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,31 @@ | ||
| # Keep the build context small and secrets out of the image. | ||
| .git | ||
| .github | ||
| .venv | ||
| venv | ||
| node_modules | ||
| frontend | ||
| android | ||
| docs | ||
| documents | ||
| tests | ||
| scripts | ||
| assets | ||
|
|
||
| *.md | ||
| !README.md | ||
|
|
||
| .env | ||
| *.keystore | ||
| *.jks | ||
|
|
||
| __pycache__ | ||
| *.py[cod] | ||
| .pytest_cache | ||
| .ruff_cache | ||
| htmlcov | ||
| .coverage | ||
|
|
||
| data/uploads/* | ||
| data/*.db | ||
| backend/data/*.db |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| name: Android | ||
|
|
||
| # Builds the Capacitor Android app. | ||
| # | ||
| # Pull requests get an unsigned debug APK so packaging breakage is caught before | ||
| # merge. Tags and manual runs produce a signed release bundle for Play Console. | ||
| # | ||
| # VITE_API_URL must be an absolute https:// URL. Inside a WebView there is no | ||
| # Vite dev proxy and no Netlify redirect, so a relative /api path has nothing to | ||
| # resolve against, and Android blocks cleartext http:// by default from API 28. | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'frontend/**' | ||
| - '.github/workflows/android.yml' | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
| inputs: | ||
| version_name: | ||
| description: 'Version name, e.g. 1.2.0' | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: android-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build ${{ (github.event_name == 'pull_request') && 'debug APK' || 'release AAB' }} | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| cache: npm | ||
| cache-dependency-path: frontend/package-lock.json | ||
|
|
||
| # Capacitor 8's Android tooling requires JDK 21. | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: '21' | ||
|
|
||
| - uses: android-actions/setup-android@v3 | ||
|
|
||
| - uses: gradle/actions/setup-gradle@v4 | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: frontend | ||
| run: npm ci | ||
|
|
||
| - name: Verify the API base URL is absolute | ||
| env: | ||
| VITE_API_URL: ${{ vars.VITE_API_URL }} | ||
| run: | | ||
| if [ -z "$VITE_API_URL" ]; then | ||
| echo "::error::VITE_API_URL repository variable is not set. A packaged app cannot reach a relative /api path." | ||
| exit 1 | ||
| fi | ||
| case "$VITE_API_URL" in | ||
| https://*) ;; | ||
| *) echo "::error::VITE_API_URL must start with https:// (got '$VITE_API_URL'). Android blocks cleartext traffic."; exit 1 ;; | ||
| esac | ||
|
|
||
| - name: Build web bundle and sync to Android | ||
| working-directory: frontend | ||
| env: | ||
| VITE_API_URL: ${{ vars.VITE_API_URL }} | ||
| run: npm run mobile:sync | ||
|
|
||
| - name: Decode signing keystore | ||
| if: github.event_name != 'pull_request' | ||
| env: | ||
| KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | ||
| run: | | ||
| if [ -z "$KEYSTORE_BASE64" ]; then | ||
| echo "::error::ANDROID_KEYSTORE_BASE64 secret is not set; a release build cannot be signed." | ||
| exit 1 | ||
| fi | ||
| echo "$KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/release.keystore" | ||
| echo "ANDROID_KEYSTORE_PATH=$RUNNER_TEMP/release.keystore" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Build debug APK | ||
| if: github.event_name == 'pull_request' | ||
| working-directory: frontend/android | ||
| run: ./gradlew --no-daemon assembleDebug | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: The Android job cannot run either build because Prompt for AI agents |
||
|
|
||
| - name: Build release bundle | ||
| if: github.event_name != 'pull_request' | ||
| working-directory: frontend/android | ||
| env: | ||
| ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | ||
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | ||
| ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | ||
| # Monotonic per run, which Play Console requires for every upload. | ||
| ANDROID_VERSION_CODE: ${{ github.run_number }} | ||
| ANDROID_VERSION_NAME: ${{ inputs.version_name || github.ref_name }} | ||
| run: ./gradlew --no-daemon bundleRelease | ||
|
|
||
| - name: Confirm the bundle is signed | ||
| if: github.event_name != 'pull_request' | ||
| run: | | ||
| BUNDLE=frontend/android/app/build/outputs/bundle/release/app-release.aab | ||
| test -f "$BUNDLE" || { echo "::error::No bundle produced at $BUNDLE"; exit 1; } | ||
| # A v2-signed artifact carries META-INF/*.RSA (or .EC); its absence | ||
| # means Gradle silently fell back to the debug signing config. | ||
| if ! unzip -l "$BUNDLE" | grep -qE 'META-INF/.*\.(RSA|EC|DSA)'; then | ||
| echo "::error::Bundle is not signed with the release key." | ||
| exit 1 | ||
| fi | ||
| echo "Signed bundle: $(du -h "$BUNDLE" | cut -f1)" | ||
|
|
||
| - name: Upload debug APK | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: vishwaguru-debug-apk | ||
| path: frontend/android/app/build/outputs/apk/debug/*.apk | ||
| retention-days: 7 | ||
|
|
||
| - name: Upload release bundle | ||
| if: github.event_name != 'pull_request' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: vishwaguru-release-aab | ||
| path: frontend/android/app/build/outputs/bundle/release/*.aab | ||
| retention-days: 30 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,29 @@ | ||
| name: Automated CI/CD Pipeline | ||
|
|
||
| # DISABLED daily cron on 2026-08-19. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: This workflow is kept "for manual dispatch only, for the deployment steps," but the retained Prompt for AI agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: This workflow is kept "for manual dispatch only, for the deployment steps," but the retained Prompt for AI agents |
||
| # | ||
| # This workflow ran vishwaguru_pipeline.py, which squash-merges open pull | ||
| # requests through the GitHub API. Its gate did not check what it appeared to: | ||
| # | ||
| # * quality check = PR title >= 5 characters and body >= 10 characters | ||
| # * security check = grep the diff for a keyword list | ||
| # * "run tests" = `npm test` against the ROOT package.json, whose script is | ||
| # `jest tests/`. That collects one TypeScript file. It never ran the backend | ||
| # pytest suite or the frontend Jest suite. | ||
| # * "deploy and health check" = no docker-compose.yml and no manage.py exist, | ||
| # so it fell through to `python -m http.server`, then confirmed that static | ||
| # file server answered 200 -- and treated that as the application being | ||
| # healthy. | ||
| # | ||
| # So it merged to main daily on evidence that proved nothing. Together with | ||
| # auto-merge-jules.yml (deleted in the same pass) this is how the repository | ||
| # reached a state where the backend could not import, the frontend could not | ||
| # build, and 15 endpoints the frontend called did not exist. | ||
| # | ||
| # Merges now go through .github/workflows/ci.yml and human review. This is kept | ||
| # for manual dispatch only, for the deployment steps. | ||
|
|
||
| on: | ||
| schedule: | ||
| # Trigger at 2 AM UTC daily | ||
| - cron: '0 2 * * *' | ||
| # Allow manual triggering | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: The Android job cannot run either build because
frontend/android/gradlewis not executable in Git. Mark the wrapper executable in the repository (preferred), or invokebash ./gradlewin both build steps.Prompt for AI agents