concourse / time-resource

a resource for triggering on an interval
Apache License 2.0
44 stars 33 forks source link

Add support for "initial_version" to allow auto-populating the first version #63

Closed lrstanley closed 2 years ago

lrstanley commented 2 years ago

This PR adds support for optionally generating the first version initially (when using start and stop), even if it hasn't gone into the first time window yet. This is very helpful for adding the ability to manually run the job, as Concourse does not let you run a job when it has an input that's set to trigger: true and an input with no versions yet.

Does it make more sense to output something like time.Time{}, as that obviously is more obvious that it's some kind of default timestamp -- or, output the current time like I'm doing now? I.e. if the user did set initial_version, it's not inherently obvious if other people look at the pipeline and the time resource versions, that it was due to this new field.

I'm not 100% sure this is the overall best solution, but to me it seems like the most straightforward way until there are enhancements to Concourse itself.

xtremerui commented 2 years ago

LGTM! Thank you for the detail documentation.