Commit Graph

621 Commits

Author SHA1 Message Date
Jeremiah Russell
cb53faf3b3 feat(rules): support multiple actions per label
- support trash and delete actions for the same label
- add `run_rules_for_action` function to filter rules by action
- update `get_rules_by_label` to `get_rules_by_label_for_action`
- update `find_label` to return a vector of rule ids
- update `remove_rule_by_label` to remove all rules with the label
2025-10-30 12:26:12 +00:00
Jeremiah Russell
afe798dae0 📝 docs(rule_processor): clarify Gmail API scope requirement
- refine the documentation for batch_delete and call_batch_delete functions
- specify the exact `https://mail.google.com/` scope needed
2025-10-30 10:40:29 +00:00
Jeremiah Russell
cc57a6aec8 ♻️ refactor(gmail): consolidate batch processing logic
- introduce process_in_chunks for DRY principle
- remove redundant chunking logic from batch_delete
- update documentation for API scope requirements
2025-10-30 10:40:29 +00:00
Jerus Bot
99d9c09aa1 chore: update prlog for pr 2025-10-30 10:40:29 +00:00
Jeremiah Russell
fc85f46e80 ♻️ refactor(rule_processor): enhance Gmail message handling with chunk processing
- introduce `process_in_chunks` for batch operations to respect API limits
- refactor `batch_trash` to use `process_in_chunks` for efficient trashing
- add documentation for `process_in_chunks` explaining chunking and API limits
2025-10-30 10:40:29 +00:00
Jeremiah Russell
01c337d94c 📝 docs(rules): clarify scope usage for Gmail operations
- correct grammar in scope description
2025-10-30 10:40:29 +00:00
Jeremiah Russell
23ea5a82b0 feat(rule_processor): implement batch operations for message deletion and trashing
- introduce `call_batch_delete` to permanently delete messages in chunks
- introduce `call_batch_trash` to move messages to trash in chunks
- refactor `batch_delete` and `batch_trash` to use chunking for large lists
- add constants for `INBOX_LABEL` for clarity
- update documentation to reflect the new chunking approach and api requirements
2025-10-30 10:40:29 +00:00
Jerus Bot
1a7d1f950c chore: update prlog for pr 2025-10-29 13:56:02 +00:00
Jeremiah Russell
83a5c45cb5 🐛 fix(gmail): use GMAIL_DELETE_SCOPE for batch delete
- use GMAIL_DELETE_SCOPE instead of GMAIL_MODIFY_SCOPE for batch delete operation
- GMAIL_DELETE_SCOPE is required for batch delete to work
2025-10-29 13:56:02 +00:00
Jerus Bot
4d3b554309 chore: update prlog for pr 2025-10-29 13:51:18 +00:00
Jeremiah Russell
a3623d560d 🐛 fix(cli): correct logging level
- remove redundant check for logging level
2025-10-29 13:51:18 +00:00
Jeremiah Russell
357da7f23b 🐛 fix(eol_rule): correct calculate_for_date and add logging
- Fix the EOL date calculation by using checked_sub_signed to prevent panics
- Add debug logging to track message age, delta, and deadline calculations
- Corrected test case to account for new calculation and added logger to test
2025-10-29 13:51:18 +00:00
Jeremiah Russell
4f87647339 🐛 fix(rules): correct grammar and improve date calculation
- correct a grammatical error in a comment
- add logging for debugging date calculations
- add a new test case for 1032 days to ensure correct calculation
2025-10-29 13:51:18 +00:00
Jerus Bot
1e5336619b chore: update prlog for pr 2025-10-29 07:20:20 +00:00
Jeremiah Russell
f493dfae04 🐛 fix(gmail): handle batch delete errors
- fix batch delete failure by logging the response before returning
- handle batch delete errors and prevent program termination
2025-10-29 07:20:20 +00:00
Jerus Bot
b8aacb8998 chore: update prlog for pr 2025-10-28 16:50:30 +00:00
Jeremiah Russell
bf65721cec ♻️ refactor(core): rename initialise_message_list to initialise_lists
- rename initialise_message_list to initialise_lists for clarity
- update all references to the function with the new name
- the function now initialises both message and label lists
2025-10-28 16:50:30 +00:00
Jerus Bot
ed0d7e6bf3 chore: update prlog for pr 2025-10-28 16:37:31 +00:00
Jeremiah Russell
4749e83cf3 feat(rule_processor): add initialise_message_list to processor
- add initialise_message_list fn to RuleProcessor trait and impl
- ensure rule is only processed on in-scope messages
- call initialise_message_list before processing any labels
2025-10-28 16:37:31 +00:00
Jerus Bot
ef0c9ebd89 chore: Release cull-gmail v0.0.15 2025-10-26 09:23:39 +00:00
Jerus Bot
8da4a11dd9 chore: update prlog for pr 2025-10-25 22:58:36 +01:00
Jeremiah Russell
03b6bdfaa6 📝 docs(cli): improve config subcommand documentation
- clarify the purpose of the config subcommand
- correct spelling error: "behaviour"
2025-10-25 22:58:36 +01:00
Jeremiah Russell
dcfae4517b 🐛 fix(cli): fix log messages with empty arguments
- fix log messages with empty arguments
2025-10-25 22:58:36 +01:00
Jeremiah Russell
50335ca38e 🐛 fix(cli): prevent dry-run from crashing
- prevent dry-run crashing by calling log messages function
2025-10-25 22:58:36 +01:00
Jeremiah Russell
50beaeaef4 🐛 fix(rule_processor): fix batch_trash and batch_delete signatures
- change &self to &mut self for batch_trash and batch_delete functions
- add logging for messages being trashed and deleted
2025-10-25 22:58:36 +01:00
Jeremiah Russell
e106455953 ♻️ refactor(message_list): allow pre/post text in log_messages
- allow `log_messages` to take `pre` and `post` parameters
- this will allow calling functions to format the log output
- add documentation for parameters
2025-10-25 22:58:36 +01:00
Jerus Bot
54cf711420 chore: Release cull-gmail v0.0.14 2025-10-23 13:01:46 +00:00
Jerus Bot
2e39dd87c3 chore: update prlog for pr 2025-10-23 13:00:21 +01:00
Jeremiah Russell
f07f0e8f5b 🐛 fix(config): reduce log verbosity
- change log level from info to trace to reduce verbosity
2025-10-23 13:00:21 +01:00
Jerus Bot
19fa3ba966 chore: update prlog for pr 2025-10-23 12:09:04 +01:00
Jeremiah Russell
7bbc41e1c3 🔧 chore(vscode): update cspell dictionary
- add "creds", "tokencache", and "trdir" to cspell dictionary
2025-10-23 12:09:04 +01:00
Jeremiah Russell
6d24a0175c feat(cli): add token and auth uri config options
- allow users to configure token_uri and auth_uri in config file
- add default values for token_uri and auth_uri
2025-10-23 12:09:04 +01:00
Jeremiah Russell
15599e2258 🧹 Refactor: add run_init_basic helper to eliminate command duplication 2025-10-23 11:16:25 +01:00
Jerus Bot
47a9233856 chore: update prlog for pr 2025-10-23 11:16:25 +01:00
Jeremiah Russell
4550ffca92 🧹 Refactor: eliminate test duplication with helper functions 2025-10-23 11:16:25 +01:00
Jeremiah Russell
5228a24b32 📝 Update documentation for --skip-rules flag 2025-10-23 11:16:25 +01:00
Jeremiah Russell
cc8259bd6a Add integration tests for --skip-rules 2025-10-23 11:16:25 +01:00
Jeremiah Russell
e33c0320a0 Add unit tests for --skip-rules functionality 2025-10-23 11:16:25 +01:00
Jeremiah Russell
c39e64f0ac Implement core logic for --skip-rules in init 2025-10-23 11:16:25 +01:00
Jeremiah Russell
0b24767065 Add --skip-rules flag to init command 2025-10-23 11:16:25 +01:00
Jerus Bot
79e0de72e6 chore: update prlog for pr 2025-10-23 07:37:30 +01:00
Jeremiah Russell
05b4a968f7 🐛 fix(config): improve config logging format
- use pretty format for config logging to enhance readability
2025-10-23 07:37:30 +01:00
Jerus Bot
c3d2f818b8 chore: update prlog for pr 2025-10-23 06:52:46 +01:00
Jeremiah Russell
89fce9792e feat(config): load application secret with logging
- add logging to indicate the source of the application secret
- log the configuration root to aid in debugging credential file loading
2025-10-23 06:52:46 +01:00
Jerus Bot
2ec8e00119 chore: Release cull-gmail v0.0.13 2025-10-22 16:37:03 +00:00
Jerus Bot
33710e48c1 chore: update prlog for pr 2025-10-22 17:35:43 +01:00
Jeremiah Russell
c1f7cf859a 🐛 fix(cli): load config file only if it exists
- only load config file if it exists
- prevents error when config file is not present
2025-10-22 17:35:43 +01:00
Jeremiah Russell
2af6df145f 🐛 fix(cli): fix config file loading
- remove unnecessary config_file.required(false)
2025-10-22 17:35:43 +01:00
Jeremiah Russell
825f2de316 🐛 fix(client_config): print config for debugging
- add log to print config for debugging
2025-10-22 17:35:43 +01:00
Jeremiah Russell
4aef4608fc feat(cli): enhance configuration loading with logging
- add logging to display the config file being loaded
2025-10-22 17:35:43 +01:00