Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return time.Duration from limits, instead of model.Duration #4420

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

pstibrany
Copy link
Member

What this PR does

This PR addresses comment #4385 (comment) from PR review. OutOfOrderTimeWindow was the only method in validation/limits.go returning model.Duration instead of time.Duration.

Checklist

  • Tests updated
  • [na] Documentation added
  • [na] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

I'm fine being consistent, but I suggest to add a CHANGELOG entry because after this change we're not going to accept anymore the extended duration units introduced by model.Duration (e.g. w, y, ...).

@56quarters
Copy link
Contributor

56quarters commented Mar 8, 2023

I'm fine being consistent, but I suggest to add a CHANGELOG entry because after this change we're not going to accept anymore the extended duration units introduced by model.Duration (e.g. w, y, ...).

We will, the type in validation.Limits is still a model.Duration (and so we can still use the extended units in YAML). We just return time.Duration from the limits.OutOfOrderTimeWindow(userID) method which is called internally.

@pracucci
Copy link
Collaborator

pracucci commented Mar 8, 2023

I'm fine being consistent, but I suggest to add a CHANGELOG entry because after this change we're not going to accept anymore the extended duration units introduced by model.Duration (e.g. w, y, ...).

We will, the type in validation.Limits is still a model.Duration (and so we can still use the extended units in YAML). We just return time.Duration from the limits.OutOfOrderTimeWindow(userID) method which is called internally.

🤦 You're right. I looked at this too quickly.

@pstibrany pstibrany merged commit 44aad50 into main Mar 9, 2023
@pstibrany pstibrany deleted the use-time-duration-from-limits branch March 9, 2023 08:13
osg-grafana pushed a commit that referenced this pull request Mar 9, 2023
…4420)

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
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.

None yet

3 participants