Commit Graph

664 Commits

Author SHA1 Message Date
Jerus Bot
0a9ab6d164 chore: update prlog for pr 2025-10-20 13:46:10 +01:00
Jeremiah Russell
13351fe3f9 👷 ci(nextest): configure nextest for CI environment
- disable fail-fast to ensure all tests are executed
- generate junit.xml report for test results
2025-10-20 13:46:10 +01:00
Jeremiah Russell
edb98980c7 👷 ci(circleci): fix store test results path
- correct indentation for `store_test_results` step in `circleci/config.yml`
2025-10-20 13:46:10 +01:00
Jeremiah Russell
82c920390c 👷 ci(circleci): improve test runner condition logic
- correct condition logic for test runner parameter in circleci config
2025-10-20 13:46:10 +01:00
Jeremiah Russell
c64898d6c2 👷 ci(circleci): use cargo as default test runner
- set default test runner to cargo
- remove test option from enum
2025-10-20 13:46:10 +01:00
Jeremiah Russell
aa342eab49 feat(test): add junit report
- add nextest.toml for generating junit report
2025-10-20 13:46:10 +01:00
Jeremiah Russell
9a2e6e1dd0 feat(ci): introduce nextest test runner
- Adds a new command `cargo_nextest` to run tests using the nextest test runner.
- Introduces a `test_runner` parameter to the `common_tests` job, allowing users to choose between `test` and `nextest`.
- Adds a `nextest_profile` parameter to the `common_tests` job to specify the nextest profile to use.
- Configures the CI workflow to use nextest for running tests.
- Adds junit report output for nextest
2025-10-20 13:46:10 +01:00
Jerus Bot
580a3bdb19 chore: update prlog for pr 2025-10-20 12:00:17 +01:00
Jeremiah Russell
f95ac2f1ff 🐛 fix(rule_processor): correct spelling of "behaviour"
- correct spelling of "behaviour" in comment for consistency
2025-10-20 12:00:17 +01:00
Jeremiah Russell
b26887e05a 🎨 style: fix clippy warnings and clean up test code 2025-10-20 12:00:17 +01:00
Jeremiah Russell
084a643b74 🧪 test(gmail_client): add unit tests with comprehensive coverage for MessageSummary and public API 2025-10-20 12:00:17 +01:00
Jeremiah Russell
9bf69f3624 📝 docs(gmail_client): add comprehensive rustdoc with examples and guidance 2025-10-20 12:00:17 +01:00
Jeremiah Russell
cd907882ae 🧪 test(message-list): add edge-case tests (empty first page, no next_page_token despite pages > 1) 2025-10-20 08:16:45 +01:00
Jeremiah Russell
34125e7d5c 🧪 test(message-list): add test-only GmailService mock and end-to-end pagination test (no network) 2025-10-20 08:16:45 +01:00
Jeremiah Russell
4c5378c90b ♻️ refactor(message-list): introduce GmailService abstraction and refactor to use it; fix borrows and lifetimes 2025-10-20 08:16:45 +01:00
Jeremiah Russell
161710e1f9 ♻️ refactor(message-list): extract helper to append messages from ListMessagesResponse and add unit test 2025-10-20 08:16:45 +01:00
Jeremiah Russell
d0b1391738 fix(message-list): improve idioms (avoid redundant clone, extend labels, safer message extraction) 2025-10-20 08:16:45 +01:00
Jeremiah Russell
12344c123e 📝 docs(readme): move integration test instructions to docs/readme/head.md per release process 2025-10-20 08:16:45 +01:00
Jeremiah Russell
862f926bd5 📝 docs: document how to run the ignored Gmail integration test locally 2025-10-20 08:16:45 +01:00
Jeremiah Russell
ebecd60dc7 🧪 test(message-list): add optional ignored integration test for Gmail API 2025-10-20 08:16:45 +01:00
Jeremiah Russell
1fd9c29ead 🧹 chore(message-list): enable missing_docs lint for module 2025-10-20 08:16:45 +01:00
Jerus Bot
a5b068933d chore: update prlog for pr 2025-10-20 08:16:45 +01:00
Jeremiah Russell
b878ff6152 🎨 style(message-list): apply rustfmt to satisfy CI fmt check 2025-10-20 08:16:45 +01:00
Jeremiah Russell
0042ba271f fix(clippy): move tests module to file end to satisfy items_after_test_module lint 2025-10-20 08:16:45 +01:00
Jeremiah Russell
e48535c623 🎨 style: format codebase with cargo fmt 2025-10-20 08:16:45 +01:00
Jeremiah Russell
3d16bd22d1 🧪 test(message-list): add unit tests for trait behavior using mock implementation 2025-10-20 08:16:45 +01:00
Jeremiah Russell
501d8a5830 📝 docs(message-list): document trait and public methods with examples and error semantics 2025-10-20 08:16:45 +01:00
Jeremiah Russell
257caf55ab 📝 docs(message-list): add module-level rustdoc with overview and usage example 2025-10-20 08:16:45 +01:00
Jerus Bot
b650e507f7 chore: update prlog for pr 2025-10-19 09:51:56 +01:00
Jeremiah Russell
06d63fbd03 🎨 style(rule_processor): apply rustfmt and resolve clippy warnings 2025-10-19 09:51:56 +01:00
Jeremiah Russell
f16eb0a768 🧪 test(rule_processor): add passing rustdoc examples and validate with doc tests 2025-10-19 09:51:56 +01:00
Jeremiah Russell
1012047d89 🧪 test(rule_processor): add comprehensive unit tests for orchestration and state setters 2025-10-19 09:51:56 +01:00
Jeremiah Russell
992414e0b9 ♻️ refactor(rule_processor): extract process_label and add internal ops trait for unit testing 2025-10-19 09:51:56 +01:00
Jeremiah Russell
d91b3e3b92 ♻️ refactor(rule_processor): add TRASH_LABEL, correct Gmail scopes, early returns, and improve idioms 2025-10-19 09:51:56 +01:00
Jeremiah Russell
ea948eda27 📝 docs(rule_processor): add module and method docs with safety notes and doctest examples 2025-10-19 09:51:56 +01:00
Jerus Bot
099a074a61 chore: update prlog for pr 2025-10-19 08:52:23 +01:00
Jeremiah Russell
2b420e53cb style: format code with rustfmt 2025-10-19 08:52:23 +01:00
Jeremiah Russell
8f908df8f3 refactor(rules): apply idiomatic patterns and resolve clippy warnings
- Change add_rule parameter from Option<&String> to Option<&str> for better ergonomics
- Use iterator methods (flat_map, any) instead of manual loops and collections
- Collapse nested if conditions using let-else patterns
- Use format string interpolation instead of separate arguments
- Avoid unnecessary String allocations in label comparisons
- Update CLI code to use as_deref() for Option<String> to Option<&str> conversion
- Update all documentation examples and tests to match new API
- All functionality preserved; API is more idiomatic and efficient
2025-10-19 08:52:23 +01:00
Jeremiah Russell
a43eb9e4a2 refactor(rules): replace unwrap() with explicit error handling and propagate errors safely
- Replace Option::unwrap() with pattern matching in add_rule label check
- Handle home directory resolution failures with proper Error types
- Add directory creation in save() to ensure parent directories exist
- Replace chrono unwraps with ? operator for date calculations
- Use unwrap_or with sensible defaults for parsing edge cases
- Keep unwrap in test code where immediate failure is desired
- All existing functionality preserved; no API changes
2025-10-19 08:52:23 +01:00
Jeremiah Russell
74512bdea3 test(rules): add unit tests covering all public methods and edge cases
- Add comprehensive test coverage for all Rules public methods
- Test both success and error paths with proper assertions
- Add PartialEq derive to EolAction to enable comparisons in tests
- Include edge cases like duplicate labels and nonexistent IDs
- Mark file system integration tests as ignore to avoid interference
2025-10-19 08:52:23 +01:00
Jeremiah Russell
222bd87415 docs(rules): add comprehensive documentation and usage examples for Rules and its methods 2025-10-19 08:52:23 +01:00
Jeremiah Russell
724c930234 docs(eol_rule): add comprehensive documentation and examples 2025-10-19 08:52:23 +01:00
Jerus Bot
329fa677c9 chore: update prlog for pr 2025-10-19 07:54:12 +01:00
Jeremiah Russell
8fbe12346f 🐛 fix(retention): fix debug string formatting in retention struct
- change format macro to resolve cargo clippy warning
2025-10-19 07:54:12 +01:00
Jeremiah Russell
051507856a feat(retention): enhance message age with parsing and validation
- add `TryFrom<&str>` implementation for `MessageAge`
  - allows creating `MessageAge` from string slices
  - returns `Error` for invalid formats
- improve `MessageAge::new` to return a `Result`
  - changes error type to `Error` enum
- add `Error::InvalidMessageAge` for specific message age errors
- mark `MessageAge::parse` and other methods as `must_use`
- use byte string literals for character matching in `parse`
- update error messages to include the invalid input value
- add `#[derive(Hash)]` to `MessageAge`
2025-10-19 07:54:12 +01:00
Jeremiah Russell
5c2124ead4 🐛 fix(cli): correct error mapping in add_cli
- fix error mapping for message age creation
- use direct error propagation instead of config error mapping
2025-10-19 07:54:12 +01:00
Jeremiah Russell
1448c791d9 feat(retention): implement retention policy configuration
- define struct for retention policy with message age and label generation
- add methods to create, access, and modify retention policies
- implement default values, cloning, equality, and debug formatting
2025-10-19 07:54:12 +01:00
Jeremiah Russell
32db9cb51a feat(error): add invalid message age error
- add `InvalidMessageAge` error variant to the `Error` enum
- include a message parameter to provide details about the invalid age
2025-10-19 07:54:12 +01:00
Jeremiah Russell
c40e4dfa86 feat(retention): introduce message age specification
- introduces `MessageAge` enum to represent retention periods
- supports days, weeks, months, and years
- adds parsing and formatting for `MessageAge` instances
- includes label generation for categorization
2025-10-19 07:54:12 +01:00
Jeremiah Russell
dd16da8740 🐛 fix(rules): handle message age creation error
- handle the error when creating MessageAge and return a ConfigError::Message
2025-10-19 07:54:12 +01:00