Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .act.secrets.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Secrets para act (CI local) — AppLogger
# Copiar este archivo: cp .act.secrets.example .act.secrets
# NUNCA commitear .act.secrets (está en .gitignore)
#
# Estos valores se inyectan como variables de entorno en el contenedor
# Docker cuando corres: act push -W .github/workflows/ci.yml --job <nombre>
#
# Para obtener los valores reales, ver: docs/ES/paquete/publishing.md

# ── Supabase (requerido para el job e2e, opcional para lint/test) ──
APPLOGGER_SUPABASE_URL=https://hqvkrsmlphjnkefpfpzg.supabase.co
APPLOGGER_SUPABASE_ANON_KEY=
APPLOGGER_SUPABASE_SERVICE_KEY=

# ── Codecov (opcional, el job no falla si no está) ──
CODECOV_TOKEN=
26 changes: 26 additions & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .actrc — Configuración de act para el proyecto AppLogger
# Ref: https://nektosact.com/usage/index.html#configuration-file
#
# act ejecuta GitHub Actions localmente usando Docker.
# USO HABITUAL (desde la raíz del repo):
# act push -W .github/workflows/ci.yml --job lint
# act push -W .github/workflows/ci.yml --job test
#
# NOTA: Las acciones compuestas (setup-java, setup-gradle) pueden
# requerir acceso a internet la primera vez. Después quedan en caché.

# Imagen Docker para ubuntu-latest
# - catthehacker/ubuntu:act-latest (~500MB) incluye las herramientas
# necesarias para bootstrap de la mayoría de actions.
# - Alternativa full (~17GB): ghcr.io/catthehacker/ubuntu:full-latest
# (incluye Android SDK, Java, etc. sin necesidad de setup-java)
-P ubuntu-latest=catthehacker/ubuntu:act-latest
-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
-P ubuntu-20.04=catthehacker/ubuntu:act-20.04

# Secrets — archivo local con variables de entorno para el CI local
# Crear el archivo: cp .act.secrets.example .act.secrets (NO commitear)
--secret-file .act.secrets

# Usar la working directory correcta del monorepo
--env GRADLE_OPTS=-Xmx2g
43 changes: 43 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# .gitattributes — Normalización de line endings para el proyecto AppLogger
# Garantiza que los shell scripts tengan LF independientemente del OS del desarrollador.
# Ref: https://git-scm.com/docs/gitattributes

# Comportamiento por defecto: normalizar a LF en el repo, checkout según OS
* text=auto

# ── Shell scripts: siempre LF (incluso en Windows) ───────────
*.sh text eol=lf
*.bash text eol=lf
gradlew text eol=lf
gradlew.bat text eol=crlf

# ── Git hooks ─────────────────────────────────────────────────
.githooks/* text eol=lf

# ── Kotlin / Java / Gradle ────────────────────────────────────
*.kt text eol=lf
*.kts text eol=lf
*.java text eol=lf
*.gradle text eol=lf
*.properties text eol=lf
*.xml text eol=lf
*.json text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
*.md text eol=lf
*.toml text eol=lf

# ── iOS / Swift ───────────────────────────────────────────────
*.swift text eol=lf
*.podspec text eol=lf
Package.swift text eol=lf

# ── Binarios: no tocar ────────────────────────────────────────
*.jar binary
*.zip binary
*.png binary
*.jpg binary
*.ico binary
*.aar binary
*.framework binary
*.xcframework binary
64 changes: 64 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/sh
# pre-push hook - AppLogger SDK
#
# Ejecuta verificaciones locales antes de hacer push a origin.
# Bloquea el push si alguna verificacion falla.
#
# Para saltear: git push --no-verify
# Para instalar: git config core.hooksPath .githooks

set -e

GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
RESET='\033[0m'

SDK_DIR="sdk"

# On Windows Git Bash (MINGW), JAVA_HOME may not be set in bash env.
# Use cygpath to convert the Windows JAVA_HOME to a Unix-style path.
if [ -z "$JAVA_HOME" ]; then
WIN_JAVA_HOME=$(cmd.exe /c 'echo %JAVA_HOME%' 2>/dev/null | tr -d '\r\n')
if [ -n "$WIN_JAVA_HOME" ]; then
export JAVA_HOME="$(cygpath -u "$WIN_JAVA_HOME" 2>/dev/null || echo "$WIN_JAVA_HOME")"
export PATH="$JAVA_HOME/bin:$PATH"
fi
fi

if [ ! -d "$SDK_DIR" ]; then
echo "${RED}ERROR: ejecuta este hook desde la raiz del repo.${RESET}"
exit 1
fi

# Read ANDROID_HOME from sdk/local.properties if not already set
if [ -z "$ANDROID_HOME" ] && [ -f "$SDK_DIR/local.properties" ]; then
SDK_LOCATION=$(grep '^sdk.dir=' "$SDK_DIR/local.properties" | cut -d'=' -f2- | tr -d '\r')
if [ -n "$SDK_LOCATION" ]; then
export ANDROID_HOME="$SDK_LOCATION"
fi
fi

echo ""
echo "${CYAN}AppLogger - Pre-Push Checks${RESET}"
echo ""

# 1. Detekt
echo "${YELLOW}[1/2] Detekt (analisis estatico)...${RESET}"
if ! (cd "$SDK_DIR" && ./gradlew detekt --quiet); then
echo "${RED}x Detekt fallo. Corrige los errores antes de hacer push.${RESET}"
exit 1
fi
echo "${GREEN}OK Detekt: OK${RESET}"
echo ""

# 2. Tests JVM
echo "${YELLOW}[2/2] Tests unitarios JVM...${RESET}"
if ! (cd "$SDK_DIR" && ./gradlew :logger-core:jvmTest :logger-test:jvmTest --quiet); then
echo "${RED}x Tests fallaron. Corrige antes de hacer push.${RESET}"
exit 1
fi
echo "${GREEN}OK Tests: OK${RESET}"
echo "${GREEN}Todas las verificaciones pasaron. Push permitido.${RESET}"
echo ""
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
pull_request:
branches: [ main, develop ]
branches: [ main, dev ]
push:
branches: [ main, develop ]
branches: [ main, dev ]

defaults:
run:
Expand Down Expand Up @@ -125,6 +125,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
security-events: write
contents: write
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -155,7 +156,9 @@ jobs:
category: /language:java-kotlin

- name: Dependency Submission
continue-on-error: true
uses: mikepenz/gradle-dependency-submission@v1
with:
gradle-build-module: ':'
gradle-build-configuration: 'compileClasspath'
gradle-project-path: sdk
gradle-build-module: ':logger-core'
gradle-build-configuration: 'jvmCompileClasspath'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local.properties
*.pem
*.gpg
*.keystore
.act.secrets

# KMP / iOS
*.xcodeproj/
Expand Down
31 changes: 13 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,15 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and

## [Unreleased]

### Added
- **Exponential backoff with jitter** — transport retries use `base * 2^attempt` capped at 30s.
- **Dead Letter Queue** — events that exhaust retries are preserved for inspection.
- **Health Check API** — `AppLoggerHealth.snapshot()` returns SDK internal state.
- **Certificate pinning support** — `SupabaseTransport` accepts a custom `HttpClient`.
- **KDoc** — comprehensive English documentation on all 19 public API files.
- **iOS distribution** — `Package.swift` (SPM) and `AppLogger.podspec` (CocoaPods).
- **XCFramework** task in `sdk/logger-core/build.gradle.kts`.
- **Dokka** — API docs generation configured with CI upload.
- **Conventional Commits** — git hook enforcer in `.githooks/commit-msg`.
- **CodeQL security scanning** in CI workflow.
- **Dependency submission** to GitHub for vulnerability alerts.
- **Detekt** static analysis with SARIF reports.
- **JaCoCo** code coverage with Codecov integration.
- **Dependabot** for Gradle and GitHub Actions dependencies.
- **ProGuard/R8 consumer rules** for `logger-core` and `logger-transport-supabase`.
- **`.editorconfig`** for consistent code formatting.
### Planned
- `logger-transport-firebase` module — transport to Firebase Realtime Database
- Support for `logger-transport-grpc` — direct delivery via gRPC to a custom server
- Wear OS support in `PlatformDetector`
- Web dashboard for real-time log visualization

---

## [0.1.1] — 2026-03-17
## [0.1.0-alpha.1] — 2026-03-17

### Added
- **`AppLogger` interface** — unified logging contract for Kotlin (Android / JVM / iOS).
Expand Down Expand Up @@ -58,8 +46,15 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and
- **Complete documentation**: `docs/ES/desarrollo/`, `docs/ES/paquete/`.
- **SQL migrations**: `docs/ES/migraciones/001` a `docs/ES/migraciones/005` for PostgreSQL / Supabase.
- **CI/CD with GitHub Actions**: test workflows on PRs and automated release on tags.
- **Monorepo structure**: `sdk/`, `docs/ES/`, `docs/EN/`, `frontend/`, `cli/`.
- **JitPack publication**: all 3 modules with 6 KMP platform variants.
- **GitHub Packages publication**: automated via `release.yml` workflow on `v*` tags.
- **Professional README**: configuration guide, CI/CD docs, branching model.
- **`local.properties.example`**: onboarding template for new contributors.

### Security
- API keys never hardcoded: injected via `BuildConfig` from `local.properties` or CI env vars.
- Row Level Security in Supabase: `anon` role only has `INSERT` permission on `app_logs`.
- Production endpoint requires `https://` — validated at `Config` build time.
- **CodeQL security scanning** in CI workflow.
- **Dependency submission** to GitHub for vulnerability alerts.
Loading
Loading