Skip to content

refactor: extract require_config, add pagination cap, env token, and shared test support#12

Merged
ankarhem merged 3 commits intomainfrom
refactor/code-quality-safety
Apr 27, 2026
Merged

refactor: extract require_config, add pagination cap, env token, and shared test support#12
ankarhem merged 3 commits intomainfrom
refactor/code-quality-safety

Conversation

@ankarhem
Copy link
Copy Markdown
Member

Summary

  • M1+M2: Extract require_config() private method in service.rs, replacing 5 duplicate config-loading blocks
  • H1: Add MAX_ALL_PAGES_MESSAGES = 10_000 safety cap in paginated search
  • H2: Add env = "GRAYLOG_TOKEN" to AuthArgs.token for token-from-env support
  • L1: Set 0o600 file permissions on cache JSON files in config_store.rs
  • L3: Extract shared FakeCacheStore to src/application/test_support.rs (deduplicated from service.rs and updater_service.rs tests)
  • L5: Add #[arg(help = "...")] to all 8 positional CLI arguments
  • L4: Skipped — only 2 call sites using different normalizers, not worth extracting

Test plan

  • cargo check passes
  • All 205 existing tests pass
  • Zero LSP errors on changed files

… perms, shared test support

- M1+M2: Extract require_config() private method, replacing 5 duplicate config-loading blocks in service.rs
- H1: Add MAX_ALL_PAGES_MESSAGES (10,000) safety cap in execute_paginated_search
- H2: Add env = "GRAYLOG_TOKEN" to AuthArgs.token (requires clap env feature)
- L1: Set 0o600 file permissions on cache JSON files in config_store.rs
- L3: Extract shared FakeCacheStore to src/application/test_support.rs
- L4: Skipped - only 2 call sites with different normalizers, not worth extracting
- L5: Add help text to 8 positional CLI arguments in cli.rs
@ankarhem ankarhem force-pushed the refactor/code-quality-safety branch from 133d2a0 to 123a641 Compare April 27, 2026 06:23
@ankarhem ankarhem merged commit 99100ab into main Apr 27, 2026
7 checks passed
@ankarhem ankarhem deleted the refactor/code-quality-safety branch April 27, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant