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

Support fractional keep_jobs times #55313

Merged
merged 3 commits into from
Dec 6, 2022

Conversation

squidpickles
Copy link
Contributor

What does this PR do?

Adds support for fractional keep_jobs interval times, so that times less than an hour can be specified.

What issues does this PR fix or reference?

See #55295

Previous Behavior

Times specified are converted to ints.

New Behavior

The time is now a float, so smaller / more precise intervals can be specified. Still using hours, rather than integer minutes or seconds, to preserve backwards compatibility.

Tests written?

Existing tests apply appear to pass

Commits signed with GPG?

Yes

@squidpickles squidpickles requested a review from a team as a code owner November 14, 2019 23:29
@ghost ghost requested a review from twangboy November 14, 2019 23:29
Copy link
Contributor

@dwoz dwoz left a comment

Choose a reason for hiding this comment

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

@squidpickles If we're going down this path, I think it'd make more sense to define keep_jobs in seconds. This would however require a depreciation path but could be implemented behind a feature flag.

@squidpickles
Copy link
Contributor Author

@dwoz Yes, I had that thought, but wasn't sure how much backwards compatibility factored in. If you can describe how this project makes breaking changes, I would be happy to implement it.

Copy link
Contributor

@twangboy twangboy left a comment

Choose a reason for hiding this comment

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

This needs a testcase and a changelog. This will also need to be rebased and conflicts fixed.

@Ch3LL
Copy link
Contributor

Ch3LL commented Nov 3, 2022

ping @squidpickles this is the documentation on how to deprecate code: https://docs.saltproject.io/en/latest/topics/development/deprecations.html

Are you willing to come back to this PR and fix up the merge conflicts and resolve the requested feedback?

@squidpickles
Copy link
Contributor Author

ping @squidpickles this is the documentation on how to deprecate code: https://docs.saltproject.io/en/latest/topics/development/deprecations.html

Are you willing to come back to this PR and fix up the merge conflicts and resolve the requested feedback?

Ah, that is helpful. Yes, I can do this. It may take me a few days to get to it, but happy to use integer seconds with a new field name.

@squidpickles
Copy link
Contributor Author

Not sure about all the tests failing above. Is that common? I can't see any obvious errors in the (truncated) log output

@Ch3LL Ch3LL requested a review from dwoz November 7, 2022 20:24
@Ch3LL
Copy link
Contributor

Ch3LL commented Nov 7, 2022

It looks like the job failures are related to this change. Its getting a keyerror in one of the tests because its expecting keep_jobs to exist.

I've also asked for @dwoz feedback on this PR

dwoz
dwoz previously approved these changes Nov 21, 2022
Copy link
Contributor

@dwoz dwoz left a comment

Choose a reason for hiding this comment

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

Approved, assuming we fix the tests.

@@ -0,0 +1 @@
renamed `keep_jobs`, specifying job cache TTL in hours, to `keep_jobs_seconds`, specifying TTL in seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a small request. Can you change the filename to .deprecated. We have not changed anything yet, because you can still use keep_jobs so the describption should reflect that keep_jobs is on a deprecation path and will be removed in favor of keep_jobs_seconds in the Chlorine release.

@Ch3LL Ch3LL added the Sulfur v3006.0 release code name and version label Nov 22, 2022
@Ch3LL
Copy link
Contributor

Ch3LL commented Dec 2, 2022

I went ahead and change the filename and I updated the release to Argon. I was wrong in recommending Chlorine as we need to ensure the deprecation is in two releases before removing

@squidpickles
Copy link
Contributor Author

I went ahead and change the filename and I updated the release to Argon. I was wrong in recommending Chlorine as we need to ensure the deprecation is in two releases before removing

Thanks for that. Makes sense.

Not sure about tests passing or not -- I have fixed the KeyError at any rate

@Ch3LL Ch3LL merged commit b7da9d2 into saltstack:master Dec 6, 2022
@welcome
Copy link

welcome bot commented Dec 6, 2022

Congratulations on your first PR being merged! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sulfur v3006.0 release code name and version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants