-
Notifications
You must be signed in to change notification settings - Fork 32
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
Make time resource versions more predictable #45
Comments
If interval is 3m, last version emitted at 1:40:00, and check runs at 1:45:00, what version should be emitted? |
Would be emitted by the current time resource? Or should be emitted, as proposed by this issue? Currently it would emit 1:45:00. |
I am also facing same issue and its very unpredictable sometimes it works correctly and trigger it once but sometimes it triggers job twice. do we know what is causing this unpredictable behavior and ETA on fix? |
So, I started hacking away at this yesterday, but came across some key questions. Below are the assumptions that I've started running with. A1: When provided with a previous version, The assumption here is to strictly adhere to the contract for implementing a resource and that anyone who wants to trigger jobs for every version can configure the pipeline to do just that. Example:
A2: When defining an The assumption here is to essentially "reset" the interval calculation each day. This ensures consistency for situations where the specified interval doesn't divide evenly in to a 24 hour period or where there aren't 24 hours in a day (switching to/from daylight saving time). Example:
The above configuration would generate the following versions every day (note that these are the versions generated, not when the versions are generated).
A3: Implementing this kind of consistency only applies when an If an |
@owenfarrell Awesome - happy to see this being worked on! A1 and A2 make sense to me. For A3, to be honest I'm having a hard time interpreting what |
tl;dr I think there are legitimate use cases for the existing validation logic ( Our use case was specifically to trigger infrequent jobs that don't have strict timing requirements (3rd party repository checks, key rotations, etc.).
True story. In our scenario, we care that a new version is generated, but we don't particularly care what the version actually is. Given the interval for our jobs, we don't want to burden Concourse with the management/overhead of running So our approach relies on |
@owenfarrell Gotcha. In that case having it just return the start time (once it's elapsed) sounds reasonable to me. Though maybe we should rename it to So there would be 3 use cases:
How does that sound? |
@vito That makes sense to me. I have a draft PR out there which addresses the original report (but not Any initial feedback would be appreciated! |
@vito - I could use a bit of guidance on one more scenario that I've run in to (and it relates to @xtremerui's question on #51).
One implication of this assumption is that versions being generated out in the wild today will no longer be valid in the new implementation since start times are defined down to minute-level precision. There are a couple of knock-on implications that come about as a result:
Before I go any further down this rabbit hole (which is going to have a significant impact on the unit tests for Thoughts? |
@owenfarrell Those both sound like what I would expect. I appreciate the detailed thoughts on this! 🙂 |
Hello all, We are also facing the same issue. |
What challenge are you facing?
Right now time resource versions are unpredictable. The resource
check
will output the current timestamp after itsinterval
has elapsed (or whatever other configuration is used). However, if thecheck
gets delayed then the gap between versions is unpredictable.What would make this better?
Make time resource versions more predictable. Instead of emitting the current timestamp, emit versions at set times based on the interval specified. This means that if the last version emitted was
1:42:05
and the interval was1m
then if the check runs at say1:45:30
the following versions would be emitted:1:43:05
,1:44:05
,1:45:05
. This way regardless of when the check actually runs, we end up with a deterministic set of versions.The text was updated successfully, but these errors were encountered: