Skip to content

Conversation

@jakebrady5
Copy link
Contributor

bug described in #451

end
end

context 'when base interval validation type is not hourly' do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we describe the scenario instead of the implementation please?

Something like: "with an hour of day that is misaligned to the start time", or similar if I'm understanding the whole issue here. You can run rspec --format=doc on this file and see what makes sense here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated language somewhat. The more I dig into this, the more niche this bug seems.

  • schedule with both weekly intervals and hour of day rules to trigger the base_interval_validation.type mismatch
  • a start_time that is misaligned with the day rule so that start_time modification due to spans: true is not defaulted back to start_time

I can perhaps nest more contexts if that would be preferred?

It's also a bit tricky as to where exactly this spec should exist. The change was made in hour_of_day, so I'm happy to relocate it there if that feels more relevant.

The discovery process was very much outside-in, so apologies for any extra confusion.

context 'when base interval validation type is not hourly' do
let(:start_time) { Time.utc(2018, 8, 7, 7, 0, 0) }
let(:end_time) { Time.utc(2018, 8, 7, 15, 0, 0) }
let(:biweekly) { IceCube::Rule.weekly(2).day(:saturday).hour_of_day(10) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are both day and hour_of_day needed for this scenario? I'd like to keep this isolated to the single issue at hand if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on wanting to simplify the scenario. I was unable to reproduce this bug without both validation requirements also being present.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it only affects weekly schedules, then I think it belongs here.

Copy link
Collaborator

@avit avit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for digging into this!

context 'when base interval validation type is not hourly' do
let(:start_time) { Time.utc(2018, 8, 7, 7, 0, 0) }
let(:end_time) { Time.utc(2018, 8, 7, 15, 0, 0) }
let(:biweekly) { IceCube::Rule.weekly(2).day(:saturday).hour_of_day(10) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it only affects weekly schedules, then I think it belongs here.

@avit avit merged commit fb6c657 into ice-cube-ruby:master Oct 31, 2018
@pacso pacso mentioned this pull request Mar 2, 2022
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.

3 participants