Skip to content

Commit 02f398d

Browse files
authored
Merge pull request #34 from opus-codium/ingest-use-deduplication-window
2 parents d2f7d09 + cab5847 commit 02f398d

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- "3.1"
3434
- "3.2"
3535
- "3.3"
36+
- "3.4"
3637
name: Ruby ${{ matrix.ruby }}
3738
steps:
3839
- uses: actions/checkout@v5
@@ -41,13 +42,5 @@ jobs:
4142
with:
4243
ruby-version: ${{ matrix.ruby }}
4344
bundler-cache: true
44-
- name: Run tests without uploading code coverage
45-
if: ${{ matrix.ruby != '3.0' }}
45+
- name: Run tests
4646
run: bundle exec rake
47-
- name: Run tests and upload coverage to Code Climate
48-
if: ${{ matrix.ruby == '3.0' }}
49-
uses: paambaati/[email protected]
50-
env:
51-
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }}
52-
with:
53-
coverageCommand: bundle exec rake

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ AllCops:
44
TargetRubyVersion: 2.6
55
NewCops: enable
66

7-
require:
7+
plugins:
88
- rubocop-rake
99
- rubocop-rspec
1010

email-report-processor.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
3030
spec.require_paths = ['lib']
3131

3232
spec.add_dependency 'activesupport'
33+
spec.add_dependency 'datemath'
3334
spec.add_dependency 'mail'
3435
spec.add_dependency 'opensearch-ruby-cli'
3536
spec.add_dependency 'rexml'

exe/email-report-processor

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require 'email_report_processor'
66
require 'opensearch/cli'
77
require 'faraday/net_http_persistent'
88

9+
require 'datemath'
910
require 'openssl'
1011
require 'optparse'
1112

@@ -93,6 +94,8 @@ end
9394
message_reader = EmailReportProcessor::MessageReader.new
9495
report_processor = EmailReportProcessor::ReportProcessor.new(client: cli.client, options: options)
9596

97+
accepted_dates = Datemath::Parser.new(options[:deduplicate_since]).parse..Datemath::Parser.new(options[:deduplicate_until]).parse
98+
9699
if ARGV.empty?
97100
mail = Mail.new($stdin.read)
98101
report_processor.send_report(message_reader.process_message(mail))
@@ -103,13 +106,17 @@ else
103106
m = EmailReportProcessor::Mbox.new(filename)
104107

105108
while (mail = m.next_message)
109+
next unless accepted_dates.cover?(mail.date)
110+
106111
report_processor.send_report(message_reader.process_message(mail))
107112
p.step
108113
end
109114
elsif options[:maildir]
110115
m = EmailReportProcessor::MailDir.new(filename)
111116

112117
while (mail = m.next_message)
118+
next unless accepted_dates.cover?(mail.date)
119+
113120
report_processor.send_report(message_reader.process_message(mail))
114121
p.step
115122
end

0 commit comments

Comments
 (0)