-
Notifications
You must be signed in to change notification settings - Fork 0
api: add CSV include_header flag + tests #26
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
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
8d4ab62
feat(category): restore management page import flow; use dry-run prev…
zensgit 8cef9ac
feat(api): templates list pagination (page/per_page) + ETag support (…
zensgit 091c8d3
feat(templates): add ETag + pagination fetch (client) and result wrapper
zensgit d6b01d4
fix: 修复Flutter编译错误和Provider缺失问题
zensgit 23e1ab0
Merge branch 'main' into pr/templates-etag-frontend
zensgit 4260fce
feat(ui): template import dialog — add ETag pagination (Load more) us…
zensgit b8dcfea
feat(api): dry_run details — predicted rename, existing category summ…
zensgit 74aa573
feat(ui): dry-run preview renders server details (predicted rename / …
zensgit 87e8ef8
chore(api,flutter,ci): align ImportActionDetail; clippy green; make l…
zensgit 38e5a17
chore(docs): add PR drafts for demo feature-gate and Flutter analyzer…
zensgit e092ff2
Merge pull request #20 from zensgit/chore/lint-ci-import-detail
zensgit ffec566
chore(api): feature-gate demo endpoints; align local CI clippy mode (…
zensgit 704f66d
chore(flutter): analyzer cleanup phase 1 (#22)
zensgit 0810240
chore(flutter): run local analyzer, groundwork for bulk cleanup (no b…
zensgit 3161342
chore(flutter): analyzer cleanup tools (unused imports parser + mater…
zensgit 825607a
chore(flutter): analyzer cleanup phase 1.2 execution
zensgit 55392eb
fix(flutter): Phase 1.2 syntax fixes (transaction_card, budget_summary)
zensgit f72c2da
chore(flutter): analyzer cleanup phase 1.2 - batch remove unused imports
zensgit 9a0a688
fix(flutter): resolve analyzer syntax issues and remove invalid const…
zensgit 5972089
chore: trigger CI run
zensgit c2c2c05
chore(flutter): Phase 1.3 unblock — strip invalid const from Text/Ico…
zensgit cc3a42c
chore: trigger CI after const fixes
zensgit 0745f62
fix(flutter): resolve build_runner blockers — rename broken identifie…
zensgit 9a3a5e7
fix(flutter): clean all broken '*const*' identifiers (Icon/Text varia…
zensgit 2520aa0
Add stub files for missing dependencies - Phase 1.3
zensgit 37a3052
chore(flutter): add minimal stubs and path-forwarders to unblock unde…
zensgit 98107da
Add missing service method stubs - Phase 1.3 continued
zensgit e1506a8
fix: Phase 1.3 continued - Fix isSuperAdmin and updateTemplate issues
zensgit f69a887
fix: Phase 1.3 continued - Fix AuditService parameters and AuditActio…
zensgit 33cb211
fix: Phase 1.3 continued - Add missing methods and fix undefined errors
zensgit 9970b83
fix: Phase 1.3 continued - Const error fix script and improvements
zensgit 94f4cdf
fix: Phase 1.3 - Manual const error fixes
zensgit 71a5de5
fix: Phase 1.4 - Fix undefined_identifier errors
zensgit 9fc5055
Phase 1.5: Fix undefined_getter errors
zensgit 80d9075
fix(ci): separate rust-api-clippy job from field-compare
zensgit 48b34a0
chore: CI fixes and Flutter analyzer cleanup phase 1.2 execution
zensgit cd2fbc3
api: update SQLx offline cache and fix clippy warnings
zensgit 59a9497
api: cleanup SQLx cache - remove .gitkeep and obsolete query
zensgit 65f63c0
fix: Flutter test failures - add dispose method to CurrencyNotifier
zensgit b07d686
fix: Flutter test navigation failure - simplified test to avoid Hive …
zensgit e2588d2
fix: Disable core_export feature in CI to avoid jive-core compilation…
zensgit 17f78dc
fix: Conditionally compile audit handler imports to fix clippy warnings
zensgit c96c51b
ci: add SQLx diff PR comment; docs: add CI badge and SQLx offline guide
zensgit f186ad1
devx: add api-sqlx-prepare-local target; README tips; PR checklist te…
zensgit a94dd3e
feat: CI hardening and test improvements
zensgit 3f1ba79
Merge branch 'main' into feat/ci-hardening-and-test-improvements
zensgit ce977dd
fix: Remove new test files causing CI failures
zensgit eb51808
test(api): add CSV newline/CRLF and empty optional fields assertions
zensgit 1c1c336
api: add CSV include_header flag + tests; core: add CsvExportConfig::…
zensgit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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,7 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "[pre-commit] Running API lint (SQLx check + Clippy)..." | ||
| make api-lint | ||
| echo "[pre-commit] OK" | ||
|
|
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,135 @@ | ||
| # CODEOWNERS file for Jive Money project | ||
| # This file defines code review assignments for different parts of the codebase | ||
| # See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | ||
|
|
||
| # Global fallback - all files require review from project maintainer | ||
| * @huazhou | ||
|
|
||
| # Rust API backend code | ||
| /jive-api/ @huazhou | ||
| /jive-core/ @huazhou | ||
|
|
||
| # Rust specific configurations | ||
| *.toml @huazhou | ||
| Cargo.lock @huazhou | ||
| /deny.toml @huazhou | ||
|
|
||
| # Flutter frontend code | ||
| /jive-flutter/ @huazhou | ||
| /jive-flutter/lib/ @huazhou | ||
| /jive-flutter/pubspec.yaml @huazhou | ||
| /jive-flutter/pubspec.lock @huazhou | ||
|
|
||
| # Database and migration files | ||
| /database/ @huazhou | ||
| **/migrations/ @huazhou | ||
| *.sql @huazhou | ||
|
|
||
| # CI/CD and deployment configuration | ||
| /.github/ @huazhou | ||
| /.github/workflows/ @huazhou | ||
| /.github/dependabot.yml @huazhou | ||
| /docker-compose*.yml @huazhou | ||
| /Dockerfile* @huazhou | ||
| *.dockerfile @huazhou | ||
|
|
||
| # Documentation files (require careful review) | ||
| *.md @huazhou | ||
| /docs/ @huazhou | ||
| /README.md @huazhou | ||
| /CLAUDE.md @huazhou | ||
|
|
||
| # Security-sensitive files | ||
| /jive-api/src/auth/ @huazhou | ||
| /jive-api/src/middleware/ @huazhou | ||
| /jive-api/src/security/ @huazhou | ||
| **/auth_* @huazhou | ||
| **/security_* @huazhou | ||
|
|
||
| # Configuration files | ||
| *.env* @huazhou | ||
| *.config.* @huazhou | ||
| /config/ @huazhou | ||
|
|
||
| # Test files (require review to ensure proper coverage) | ||
| **/tests/ @huazhou | ||
| **/*_test.* @huazhou | ||
| **/*_test_* @huazhou | ||
| /jive-flutter/test/ @huazhou | ||
| /jive-api/tests/ @huazhou | ||
|
|
||
| # Build and deployment scripts | ||
| *.sh @huazhou | ||
| *.py @huazhou | ||
| /scripts/ @huazhou | ||
| /Makefile @huazhou | ||
| **/Makefile @huazhou | ||
|
|
||
| # Package management files | ||
| /package*.json @huazhou | ||
| /yarn.lock @huazhou | ||
| /pnpm-lock.yaml @huazhou | ||
|
|
||
| # Git configuration and workflow files | ||
| /.gitignore @huazhou | ||
| /.gitattributes @huazhou | ||
| /.git* @huazhou | ||
|
|
||
| # IDE and editor configurations | ||
| /.vscode/ @huazhou | ||
| /.idea/ @huazhou | ||
| *.code-workspace @huazhou | ||
|
|
||
| # Docker and containerization | ||
| /*docker* @huazhou | ||
| /docker/ @huazhou | ||
|
|
||
| # API routes and handlers (critical for security) | ||
| /jive-api/src/routes/ @huazhou | ||
| /jive-api/src/handlers/ @huazhou | ||
| /jive-api/src/controllers/ @huazhou | ||
|
|
||
| # Database models and schema | ||
| /jive-api/src/models/ @huazhou | ||
| /jive-api/src/schema/ @huazhou | ||
| /jive-flutter/lib/models/ @huazhou | ||
|
|
||
| # Service layer (business logic) | ||
| /jive-api/src/services/ @huazhou | ||
| /jive-flutter/lib/services/ @huazhou | ||
|
|
||
| # Provider layer (state management) | ||
| /jive-flutter/lib/providers/ @huazhou | ||
|
|
||
| # UI components and screens (require UX review) | ||
| /jive-flutter/lib/screens/ @huazhou | ||
| /jive-flutter/lib/widgets/ @huazhou | ||
| /jive-flutter/lib/ui/ @huazhou | ||
|
|
||
| # Theme and styling | ||
| /jive-flutter/lib/theme/ @huazhou | ||
| /jive-flutter/lib/core/theme/ @huazhou | ||
|
|
||
| # Networking and API client code | ||
| /jive-flutter/lib/core/network/ @huazhou | ||
| /jive-api/src/client/ @huazhou | ||
|
|
||
| # Storage and database adapters | ||
| /jive-flutter/lib/core/storage/ @huazhou | ||
| /jive-api/src/db/ @huazhou | ||
|
|
||
| # External integrations and third-party code | ||
| /jive-api/src/integrations/ @huazhou | ||
| /jive-flutter/lib/integrations/ @huazhou | ||
|
|
||
| # Utility and helper functions | ||
| /jive-api/src/utils/ @huazhou | ||
| /jive-flutter/lib/utils/ @huazhou | ||
|
|
||
| # Localization and internationalization | ||
| /jive-flutter/lib/l10n/ @huazhou | ||
| /jive-flutter/assets/i18n/ @huazhou | ||
|
|
||
| # Assets and static files | ||
| /jive-flutter/assets/ @huazhou | ||
| /jive-flutter/web/ @huazhou | ||
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,45 @@ | ||
| # PR: API CSV gating + currency fixes + SQLx diff artifact | ||
|
|
||
| ## 1) Purpose | ||
| - Fix API compile errors spotted in CI (Option handling in currency modules). | ||
| - Gate CSV streaming export under `core_export` the same way as POST export, avoiding missing-local-helper errors when core path is active. | ||
| - Improve CI debuggability by uploading SQLx offline cache diff on prepare --check failure. | ||
|
|
||
| ## 2) Approach | ||
| - Handlers | ||
| - `jive-api/src/handlers/transactions.rs`: Stream CSV path now mirrors POST path. | ||
| - `core_export` ON → `jive-core` `ExportService::generate_csv_simple`. | ||
| - `core_export` OFF → local safe CSV writer (`csv_escape_cell`). | ||
| - Currency modules | ||
| - `jive-api/src/services/currency_service.rs`: `base_currency` uses Option fallback; fixed `effective_date`/`created_at` mapping for history rows. | ||
| - `jive-api/src/handlers/currency_handler_enhanced.rs`: handle optional `created_at` before `.naive_utc()`. | ||
| - CI | ||
| - `.github/workflows/ci.yml`: on SQLx prepare --check failure, regenerate cache to a temp location, produce diff patch and tarballs, upload artifact `api-sqlx-diff`, then fail the job (remains strict). | ||
| - Docs/Tools | ||
| - `AGENTS.md`: added “CSV export feature gating” notes. | ||
| - `Makefile`: added `hooks` target to enable pre-commit (`make api-lint`). | ||
|
|
||
| ## 3) Affected layers | ||
| - API only, plus CI workflow. No schema changes. | ||
|
|
||
| ## 4) Testing evidence | ||
| - Local: `make api-lint` reaches SQLx check; build succeeds until cache check (expected to fail if `.sqlx` stale). Currency compile errors reproduced by CI are resolved locally. | ||
| - Feature note: we intentionally keep CI without `core_export` to avoid pulling unfinished `jive-core/db` modules. | ||
|
|
||
| ## 5) Migration notes | ||
| - None. No changes under `migrations/`. | ||
|
|
||
| ## 6) Rollback plan | ||
| - Revert this PR. No data migrations to undo. | ||
|
|
||
| ## 7) Follow-ups | ||
| - If CI uploads `api-sqlx-diff`, apply the patch to `.sqlx/` and re-run. | ||
| - After 1–2 green runs, flip Rust API clippy to blocking (`-D warnings`). | ||
| - Consider later decoupling CSV generation in `jive-core` from `db` feature so `core_export` can be enabled in CI without DB modules. | ||
|
|
||
| --- | ||
| Checklist | ||
| - [ ] CI run completed and artifacts reviewed | ||
| - [ ] Apply `api-sqlx-diff` if present, re-run CI | ||
| - [ ] Switch clippy to blocking after observation window | ||
| - [ ] Enable pre-commit locally: `make hooks` |
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,23 @@ | ||
| ## PR Checklist | ||
|
|
||
| - [ ] SQLx offline cache up to date (`jive-api/.sqlx`) | ||
| - [ ] `make api-lint` passes locally (SQLx check + Clippy -D warnings) | ||
| - [ ] Tests relevant to this change pass locally | ||
| - [ ] Secrets not committed; new env vars documented in `.env.example` | ||
|
|
||
| ## Purpose | ||
| Describe the problem and the high-level approach. | ||
|
|
||
| ## Changes | ||
| - Files/areas touched and why | ||
| - Feature flags or conditional paths (if any) | ||
|
|
||
| ## Testing | ||
| - Commands run and results | ||
| - Screenshots/logs (if UI/API visible behavior) | ||
|
|
||
| ## Migration Notes (if any) | ||
| - DB migrations, data backfills, roll-forward/rollback steps | ||
|
|
||
| ## Rollback Plan | ||
| - How to revert safely if issues arise |
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,127 @@ | ||
| version: 2 | ||
| updates: | ||
| # Rust dependencies for jive-api | ||
| - package-ecosystem: "cargo" | ||
| directory: "/jive-api" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| time: "09:00" | ||
| timezone: "UTC" | ||
| open-pull-requests-limit: 5 | ||
| reviewers: | ||
| - "huazhou" | ||
| assignees: | ||
| - "huazhou" | ||
| commit-message: | ||
| prefix: "cargo" | ||
| include: "scope" | ||
| labels: | ||
| - "dependencies" | ||
| - "rust" | ||
| - "jive-api" | ||
| ignore: | ||
| # Ignore major version updates for stable dependencies | ||
| - dependency-name: "tokio" | ||
| update-types: ["version-update:semver-major"] | ||
| - dependency-name: "sqlx" | ||
| update-types: ["version-update:semver-major"] | ||
| - dependency-name: "axum" | ||
| update-types: ["version-update:semver-major"] | ||
|
|
||
| # Rust dependencies for jive-core | ||
| - package-ecosystem: "cargo" | ||
| directory: "/jive-core" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| time: "09:30" | ||
| timezone: "UTC" | ||
| open-pull-requests-limit: 3 | ||
| reviewers: | ||
| - "huazhou" | ||
| assignees: | ||
| - "huazhou" | ||
| commit-message: | ||
| prefix: "cargo(core)" | ||
| include: "scope" | ||
| labels: | ||
| - "dependencies" | ||
| - "rust" | ||
| - "jive-core" | ||
|
|
||
| # Flutter/Dart dependencies | ||
| - package-ecosystem: "pub" | ||
| directory: "/jive-flutter" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "tuesday" | ||
| time: "09:00" | ||
| timezone: "UTC" | ||
| open-pull-requests-limit: 5 | ||
| reviewers: | ||
| - "huazhou" | ||
| assignees: | ||
| - "huazhou" | ||
| commit-message: | ||
| prefix: "flutter" | ||
| include: "scope" | ||
| labels: | ||
| - "dependencies" | ||
| - "flutter" | ||
| - "dart" | ||
| ignore: | ||
| # Ignore major Flutter SDK updates (handle manually) | ||
| - dependency-name: "flutter" | ||
| update-types: ["version-update:semver-major"] | ||
| # Ignore breaking changes in UI libraries | ||
| - dependency-name: "provider" | ||
| update-types: ["version-update:semver-major"] | ||
|
|
||
| # GitHub Actions dependencies | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "monthly" | ||
| day: "first-monday" | ||
| time: "10:00" | ||
| timezone: "UTC" | ||
| open-pull-requests-limit: 3 | ||
| reviewers: | ||
| - "huazhou" | ||
| assignees: | ||
| - "huazhou" | ||
| commit-message: | ||
| prefix: "ci" | ||
| include: "scope" | ||
| labels: | ||
| - "dependencies" | ||
| - "github-actions" | ||
| - "ci" | ||
|
|
||
| # Docker dependencies | ||
| - package-ecosystem: "docker" | ||
| directory: "/jive-api" | ||
| schedule: | ||
| interval: "monthly" | ||
| day: "second-monday" | ||
| time: "10:00" | ||
| timezone: "UTC" | ||
| open-pull-requests-limit: 2 | ||
| reviewers: | ||
| - "huazhou" | ||
| assignees: | ||
| - "huazhou" | ||
| commit-message: | ||
| prefix: "docker" | ||
| include: "scope" | ||
| labels: | ||
| - "dependencies" | ||
| - "docker" | ||
| ignore: | ||
| # Ignore PostgreSQL major version updates (handle manually) | ||
| - dependency-name: "postgres" | ||
| update-types: ["version-update:semver-major"] | ||
| # Ignore Redis major version updates (handle manually) | ||
| - dependency-name: "redis" | ||
| update-types: ["version-update:semver-major"] |
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.
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.
This
CODEOWNERSfile is overly verbose and difficult to maintain. Since all paths are assigned to the same owner (@huazhou), a single line* @huazhouwould have the same effect and be much cleaner. The current file adds a lot of noise without providing any additional granularity in ownership.