Get Concourse Resource Version at a specific Job in Pipeline

I posted this question on Stackoverflow (link) as well but figured I might get better support here.

Is it possible to get a resource version at a specific job in a pipeline? There is a “resource-versions” command but it gets me the latest resource versions. I would like to be able to specify a Job so I can get a resource version as it gets updated when passed through jobs.

A command as fly -t my_team resource-versions -r pipeline/job/resource, if this is just not implemented yet, I am up to contribute but just want to verify that this is an okay thought and ask.

Hello, I don’t fully understand the question. Could you make an example?

Nothing like that currently exists as part of Concourse. We made stopover to accomplish what I think you’re trying to do.

Depending on the resource type, the implicit get after a put often has some kind of version file written that you could also consume assuming you are putting the resource(s) you care about.

1 Like

Thanks! This is basically what I am asking for, wish there was a native way but thank you for making this into a resource.

An example would be as such:

Let’s say I have a resource named my_resource and 3 jobs in a pipeline, named j1, j2, and j3. My_resource is the trigger for j1, which gets passed as a input resource to j2, which gets passed as a input resource to p3.

There could be a scenario where j1 passes, j2 is triggered, and j3 is idle and waiting. The resource version of j1 and j2 of my_resource is the same, but j3 is still the previous resource version of my_version.

I am asking to be able to get what the resource version at a specific job is.

Visual:

–(my_resource: v2)–> [j1] --(my_resource: v2)–> [j2] --(my_resource: v1)–> [j3]

A command like the following with --in or --out (potential arg) could produce:
fly resource-versions -r pipeline/j1/my_resource [--in/--out] = v2
fly resource-versions -r pipeline/j3/my_resource [--in/--out] = v1

Ah, now I understand. Then I have a question to understand the final goal:

Say that fly had this feature you are proposing. How would you use it? I mean: it is a race, since j2 is running and soon j3 will. You risk to take a decision based on the output of fly that is actually outdated.

I have the impression that stopover (that I didn’t know before) would allow to have more control on what happens.

Or am I missing something?