-
Notifications
You must be signed in to change notification settings - Fork 0
chore: reorganize documentation and automate repo bootability #4
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: StillOnTime Clean CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| env: | ||
| NODE_VERSION: '20.x' | ||
| PNPM_VERSION: '9' | ||
| CI: 'true' | ||
|
|
||
| jobs: | ||
| build-test: | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| postgres: | ||
| image: postgres:15 | ||
| env: | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_DB: stillontime_test | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 5432:5432 | ||
| redis: | ||
| image: redis:7-alpine | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 6379:6379 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'npm' | ||
| - name: Install root dependencies | ||
| run: npm ci | ||
| - name: Bootstrap workspace | ||
| run: ./scripts/bootstrap.sh --profile dev | ||
| - name: Build | ||
| run: ./scripts/build.sh --profile dev | ||
| - name: Lint backend | ||
| run: cd backend && npm run lint | ||
| - name: Lint frontend | ||
| run: cd frontend && npm run lint | ||
| - name: Backend tests | ||
| run: cd backend && npm test -- --runInBand | ||
| env: | ||
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/stillontime_test | ||
| REDIS_URL: redis://localhost:6379 | ||
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | ||
| TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} | ||
| TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} | ||
| - name: Frontend tests | ||
| run: cd frontend && npm test -- --run | ||
| - name: Smoke test | ||
| run: ./scripts/smoke-test.sh --profile dev | ||
| - name: Upload smoke logs | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: smoke-logs | ||
| path: | | ||
| logs/ | ||
| analysis/dynamic-smoke-summary.json | ||
| lint-governance: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Verify documentation locations | ||
| run: | | ||
| test -d dokumentacja | ||
| test -f dokumentacja/boot-matrix.md | ||
| - name: Validate plan presence | ||
| run: test -f PLAN_WYKONANIA.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Artefakty kopii zapasowych | ||
|
|
||
| - `stillontime-pre-cleanup-<timestamp>.zip` | ||
| - `stillontime-pre-cleanup-<timestamp>.tar.gz` | ||
| - `checksums.txt` / `checksums.json` | ||
| - `restore-instructions.md` | ||
| - `legacy-tools/` – poprzednie narzędzia i Dockerfile (historyczne) | ||
|
|
||
| Wygeneruj pliki przy pomocy `scripts/backup_and_branch.sh` lub `scripts/backup_and_branch.ps1`. Archiwa są wykluczane z kontroli wersji przez `.gitignore`. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Instrukcja odtworzenia kopii zapasowej | ||
|
|
||
| 1. Zweryfikuj sumy kontrolne: | ||
| ```bash | ||
| cd <ABSOLUTE_REPO_PATH>/BACKUP | ||
| sha256sum -c checksums.txt | ||
| ``` | ||
| 2. Rozpakuj archiwum: | ||
| ```bash | ||
| unzip stillontime-pre-cleanup-<timestamp>.zip | ||
| # lub | ||
| tar -xzf stillontime-pre-cleanup-<timestamp>.tar.gz | ||
| ``` | ||
| 3. Przywróć katalog `.git` i pliki robocze: | ||
| ```bash | ||
| rsync -a stillontime-pre-cleanup-<timestamp>/ <ABSOLUTE_REPO_PATH>/ | ||
| ``` | ||
| 4. Reset do tagu bezpieczeństwa: | ||
| ```bash | ||
| cd <ABSOLUTE_REPO_PATH> | ||
| git checkout pre-cleanup-<timestamp> | ||
| ``` | ||
|
|
||
| ## Kryteria sukcesu | ||
| - Sumy SHA256 zgadzają się z `checksums.txt`. | ||
| - Po checkout repozytorium przechodzi `scripts/smoke-test.sh --dry-run`. | ||
|
|
||
| ## Znane ryzyka | ||
| - **Nadpisanie lokalnych zmian** – wykonaj własny backup przed przywróceniem. | ||
| - **Brak archiwum** – weryfikuj log `logs/backup.log` wygenerowany przez skrypt. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Plan wykonania operacji "backup → analiza i porządki" dla StillOnTime | ||
|
|
||
| ## Faza 0. Przygotowanie | ||
| 1. **Inwentaryzacja repozytorium** – identyfikacja ekosystemów (Node.js/TypeScript, Python, Go, mobilny React Native) na podstawie plików konfiguracyjnych (`package.json`, `requirements.txt`, `go.mod`, `android/ios`). | ||
| - *Uzasadnienie*: poprawne skrypty muszą wiedzieć, które narzędzia uruchomić. | ||
| 2. **Utworzenie katalogów docelowych** (`BACKUP/`, `analysis/`, `architecture/`, `dokumentacja/`, `scripts/`, `config/`, `logs/`). | ||
| - *Uzasadnienie*: standaryzacja struktury i miejsce na artefakty procesu. | ||
|
|
||
| ## Faza 1. Backup i gałąź robocza | ||
| 1. **Tag bezpieczeństwa** `pre-cleanup-<YYYYMMDD-HHMM>` oraz gałąź `chore/repo-cleanup-and-boot`. | ||
| - *Uzasadnienie*: łatwy rollback i izolacja zmian porządkowych. | ||
| 2. **Archiwizacja repozytorium** do ZIP/TAR wraz z sumami SHA256. | ||
| - *Uzasadnienie*: kopia zapasowa przed refaktoryzacją. | ||
| 3. **Weryfikacja integralności** – zapis checksum do `BACKUP/checksums.txt` + instrukcja przywracania. | ||
| - *Uzasadnienie*: możliwość potwierdzenia poprawności kopii. | ||
|
|
||
| ## Faza 2. Analiza | ||
| 1. **Analiza statyczna** – zliczenie LOC, wykrycie języków (cloc), wyciągnięcie zależności (`npm ls --json`, `pip list`, `go list`). | ||
| - *Uzasadnienie*: baza do redukcji długu technicznego. | ||
| 2. **Graf zależności** – wygenerowanie `analysis/dependency-graph.json` i raportu `.md` z kandydatami do usunięcia. | ||
| - *Kryteria*: brak importów w kodzie, nieużywane w lockfile, zastępowalne narzędzia. | ||
| 3. **Dynamiczna inspekcja** – uruchomienie smoke testu (backend + frontend) z logowaniem modułów i porównanie z analizą statyczną. | ||
| - *Uzasadnienie*: weryfikacja realnego użycia zależności. | ||
| 4. **Architektura de-facto** – opis komponentów + diagram Mermaid oraz decyzja ADR. | ||
| - *Uzasadnienie*: dokumentacja powstałych ustaleń. | ||
|
|
||
| ## Faza 3. Porządki | ||
| 1. **Migracja dokumentacji** – przeniesienie materiałów do `dokumentacja/` i aktualizacja odnośników w README/CI. | ||
| - *Uzasadnienie*: centralizacja wiedzy, łatwe wersjonowanie. | ||
| 2. **Porządkowanie katalogu głównego** – aktualizacja `.gitignore`, przeniesienie skryptów do `scripts/`, konfiguracji do `config/` i `.github/`. | ||
| - *Uzasadnienie*: klarowna struktura repo. | ||
| 3. **Skrypt `scripts/purge_unused.sh`** – dry-run czyszczenia artefaktów + raport CSV/MD z uzasadnieniem. | ||
| - *Uzasadnienie*: kontrolowana eliminacja nieużywanych plików/dependencji. | ||
| 4. **Aktualizacja ścieżek w kodzie** – idempotentne skrypty migracyjne (sed/ts-node) aktualizujące importy po reorganizacji. | ||
| - *Uzasadnienie*: zapewnienie kompatybilności po przenosinach. | ||
|
|
||
| ## Faza 4. Bootability i automatyzacja | ||
| 1. **Matryca komend** – `dokumentacja/boot-matrix.md` z tabelą `install/build/run/test` dla każdego modułu. | ||
| 2. **Skrypty bootstrap/build/start/smoke-test** w `scripts/` z obsługą trybów dev/prod i logów w `logs/`. | ||
| 3. **Docker** – multi-stage Dockerfile + `docker-compose.yml` z profilami `dev`/`prod` (jeśli wcześniej istniały, aktualizacja). | ||
| 4. **CI/CD** – workflow GitHub Actions `ci.yaml` z sekwencją `build → test → lint → smoke-test → artifact`. | ||
|
|
||
| ## Faza 5. Walidacja i rollback | ||
| 1. **Sanity check struktury** – skrypt potwierdzający istnienie wymaganych katalogów i plików. | ||
| 2. **Smoke test** – uruchomienie `scripts/smoke-test.sh` w trybie dev i prod. | ||
| 3. **Instrukcja rollbacku** – procedura powrotu do tagu `pre-cleanup-*`. | ||
|
|
||
| ## Kryteria sukcesu | ||
| - Wszystkie skrypty idempotentne, wspierają `--dry-run`, logują do `logs/`. | ||
| - Repo można uruchomić wg matrycy (dev + prod/Docker). | ||
| - Dokumentacja scentralizowana i zaktualizowana. | ||
| - Analiza zależności udokumentowana wraz z ryzykami i mitigacjami. | ||
|
|
||
| ## Znane ryzyka i mitigacje | ||
| - **Brak części zależności offline** – dodano TODO w bootstrapie dot. manualnego cache. | ||
| - **Rozbieżności importów po przenosinach** – skrypty migracyjne + smoke test wykrywają brakujące moduły. | ||
| - **Złożoność środowisk (mobile, backend, frontend)** – matryca komand + dedykowane sekcje w skryptach. | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Include
--deletein the rsync command so the restore actually matches the backup contents by removing files that aren’t in the archive.Prompt for AI agents