I'm taking a stab at this. I don't know how GoCD internally does it, but based 
on my experience writing the GitHub PR plugin it looks like it stores all 
versions we emit and always considers something new for versions that it has 
not seen before. 

Consider the case of git hashes. There isn't any timestamp or ordering defined 
in the hashes. As soon as a new (or set of new) version(s) are available it 
would trigger the respective pipelines or do whatever that needs to be done.

We also have a timestamp field that we emit as part of the response to this 
plugin method. Since GoCD batches scm updates it might be sorting the revisions 
based on the timestamp to denote the latest revision on pipeline trigger.

So to summarise my understanding is, GoCD uses set of all versions to identify 
if a version is new or not. Based on the fact if it has seen it or not. And 
optionally might use the timestamp field for ordering the revisions when 
batching the updates.

Would love to hear from the core team on how it is actually implemented under 
the hood.

Text by Ashwanth, typos by Lumia

-----Original Message-----
From: "David Delger" <[email protected]>
Sent: ‎19-‎10-‎2017 04:49
To: "go-cd" <[email protected]>
Subject: [go-cd] How is package material plugin latest version determined?

I've created a custom package material plugin. However today I saw some strange 
results when the material was bumped but later reverted to a lower version. I'm 
trying to understand what the documentation means when it says the following.


https://developer.gocd.org/current/writing_go_plugins/package_material/version_1_0/latest_revision_since.html


"The difference here, is that it needs to find a revision of the package which 
is greater than the one specified in the request."


How does it determine greater? Timestamp? String compare on the revision field?
-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to