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

Add a UUID to injected metadata #31

Closed
jchesterpivotal opened this issue Sep 10, 2018 · 1 comment
Closed

Add a UUID to injected metadata #31

jchesterpivotal opened this issue Sep 10, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@jchesterpivotal
Copy link
Owner

The problem

Currently, the resource injects 4 metadata (its release version, its git ref, the timestamp and the remote Concourse version).

It injects these into all of the JSON files it produces. This makes it easy to get basic provenance of a record inserted into a database.

What I would like to have is a trustworthy unique identity for any particular get. None of the existing metadata, singly or in combination, is able to do this. In particular there's a temptation to assume that together they will be unique, but that's not true: I could be running jobs in parallel. Or I might be running the resource in multiple places and pooling the data.

A solution

To guarantee uniqueness, add a UUID to the injected metadata. This simplifies insert logic and lets me tie together all the information ever retrieved on a particular occasion.

@jchesterpivotal jchesterpivotal added this to the v0.10.0 milestone Sep 10, 2018
@jchesterpivotal jchesterpivotal self-assigned this Sep 10, 2018
jchesterpivotal added a commit that referenced this issue Sep 11, 2018
jchesterpivotal added a commit that referenced this issue Sep 11, 2018
jchesterpivotal added a commit that referenced this issue Sep 11, 2018
The perils of overmocking meant that while the 'in' pkg knew about
get_uuid, the 'in' cmd was not yet injecting it.

[#31]

Signed-off-by: Jacques Chester <[email protected]>
jchesterpivotal added a commit that referenced this issue Sep 11, 2018
Should enable easier visual comparison and also, weirdly, the
ability for concourse-build-resource to grok jobs which involve
other concourse-build-resource instances.

[#31]

Signed-off-by: Jacques Chester <[email protected]>
jchesterpivotal added a commit that referenced this issue Sep 11, 2018
jchesterpivotal added a commit that referenced this issue Sep 11, 2018
Not that I am super happy to give up my safety blanket, but it's
not really going to be easy to maintain _and_ have sensible CI.

So for now I choose CI.

[#28]
[#31]

Signed-off-by: Jacques Chester <[email protected]>
@jchesterpivotal
Copy link
Owner Author

I also added it to the version metadata, but I am having second thoughts. This value will change every time the resource runs, but in theory, the build it refers to does not. So in fact changing the version metadata with an ever-changing UUID really creates a new version, which I don't want.

But the UUID for the rest of this stuff seems quite sound.

jchesterpivotal pushed a commit that referenced this issue Sep 11, 2018
This reverts commit 18712d2.

It turns out, this was a bad idea. Version metadata should be stable,
but creating a new UUID each time is not intended to be even remotely
stable.

[#31]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant