-
Notifications
You must be signed in to change notification settings - Fork 0
chore: streaming no-header test + password rehash design + verification report update #43
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
Conversation
…erification report
Summary of ChangesHello @zensgit, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the system's robustness and security posture by introducing a new integration test for a feature-gated streaming export, documenting a strategy for upgrading password hashing algorithms, and updating the comprehensive verification report to reflect these and other recent changes. The modifications are limited to tests and documentation, ensuring no impact on existing production runtime logic. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Pull Request Overview
This PR adds documentation and testing improvements for the jive-api project, including a streaming export integration test, password rehashing design documentation, and a comprehensive verification report.
- Streaming export test that validates CSV export without headers when
include_header=false - Password rehash design document outlining migration strategy from bcrypt to Argon2id
- Detailed verification report documenting system health checks, performance testing, and production readiness
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| jive-api/tests/integration/transactions_export_stream_no_header_test.rs | Integration test for streaming CSV export without headers |
| docs/PASSWORD_REHASH_DESIGN.md | Design document for migrating password hashes from bcrypt to Argon2id |
| VERIFICATION_REPORT_2025_09_25.md | Comprehensive verification report with health checks and performance metrics |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| sqlx::query("INSERT INTO accounts (id,ledger_id,name,account_type,currency,current_balance,created_at,updated_at) VALUES ($1,$2,'NoHdrAcc','cash','CNY',0,NOW(),NOW())") | ||
| .bind(account_id).bind(ledger_id.0).execute(&pool).await.expect("account"); | ||
| sqlx::query("INSERT INTO transactions (id,ledger_id,account_id,transaction_type,amount,currency,transaction_date,description,created_at,updated_at) VALUES ($1,$2,$3,'expense',18,'CNY',CURRENT_DATE,'NoHdrTxn',NOW(),NOW())") | ||
| .bind(Uuid::new_v4()).bind(ledger_id.0).bind(account_id).execute(&pool).await.expect("txn"); |
Copilot
AI
Sep 25, 2025
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.
Raw SQL strings make the test fragile and hard to maintain. Consider using a struct-based approach with sqlx macros or creating test helper functions for inserting test data.
Copilot uses AI. Check for mistakes.
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.
Code Review
This pull request introduces a new integration test for streaming exports, a design document for password rehashing, and an updated verification report. The changes are well-structured and primarily additive. The password rehash design is sound, and the new test is a valuable addition. I've provided a few suggestions to improve the clarity of the documentation and the robustness of the new test.
| cargo run --bin benchmark_export_streaming --features export_stream \ | ||
| -- --rows 5000 --database-url $DATABASE_URL |
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.
The cargo run command for the large-scale test appears to be missing the package specifier -p jive-money-api. To ensure the command runs correctly from the workspace root, it's recommended to explicitly specify the package, which also aligns with the comment in the benchmark_export_streaming.rs source file.
| cargo run --bin benchmark_export_streaming --features export_stream \ | |
| -- --rows 5000 --database-url $DATABASE_URL | |
| cargo run -p jive-money-api --bin benchmark_export_streaming --features export_stream \ | |
| -- --rows 5000 --database-url $DATABASE_URL |
|
|
||
| ### Pseudocode | ||
| ```rust | ||
| if hash.starts_with("$2") { // bcrypt branch success |
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.
The pseudocode uses hash.starts_with("$2") to detect bcrypt hashes. While this may work for many cases, it's a bit generic. The "Current State" section correctly identifies the prefixes as $2a, $2b, and $2y. To improve clarity and precision in the design, consider making the check more explicit to cover all specified bcrypt variants. This ensures the implementation detail is clearly captured in the design.
| if hash.starts_with("$2") { // bcrypt branch success | |
| if hash.starts_with("$2a$") || hash.starts_with("$2b$") || hash.starts_with("$2y$") { // bcrypt branch success |
| // Must NOT start with header prefix | ||
| assert!(!body_bytes.starts_with(b"Date,Description"), "Header unexpectedly present"); | ||
| // Should contain at least one newline (row) | ||
| assert!(body_bytes.windows(1).any(|b| b == b"\n"), "CSV content missing newline"); |
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.
The current assertion assert!(body_bytes.windows(1).any(|b| b == b"\n"), "CSV content missing newline"); only verifies that a newline character exists in the response. This is a weak check as it doesn't confirm that the actual transaction data was written to the stream. A more robust test would be to assert that the response body contains some unique data from the transaction created during the test setup, such as the description 'NoHdrTxn'.
| assert!(body_bytes.windows(1).any(|b| b == b"\n"), "CSV content missing newline"); | |
| assert!(String::from_utf8_lossy(&body_bytes).contains("NoHdrTxn"), "CSV content should contain transaction data"); |
Adds:
Notes: