-
-
Notifications
You must be signed in to change notification settings - Fork 878
Description
Resource config scopes was introduced to allow for resources to have a unique version history after global resources was introduced. For example, time resources cannot share versions because each resource will have different versions with their versions being dynamically created depending on when the resource was set and the interval configured. The way that it is implemented involves a join table with the resources and resource configs to determine each scope. Resource versions will then point to that resource config scope join table.
With the later introduction of spaces and resources V2 #2651, there will be another layer in the database model between resources and its versions where each resource can have multiple spaces. If we implement spaces ontop of scopes, we will need a database lifecycle that is similar to each resource points to a scope that points to multiple spaces that produces versions. Can we simplify this?
We were thinking that we could remove scopes and replace it with hashing the source hash of each resource config that uses a resource type that needs unique versioning. This was originally our first approach for allowing for unique version history, but we ended up not implementing it because of the fact that we wanted to feature flag global resources, it would have resulted in a check container per resource and it seemed sort of hacky (unique version resources would not be as obvious in the database model). But now we're planning to do #3079 anyway so that won't matter. And we're thinking we can remove this in the future by converting the time resource to a notification resource instead (concourse/rfcs#10), so at that point we can remove this hack.
Implementation details:
- As it is now, we will keep the unique version history emitted by the resource_metadata json for the time resource and you can also configure it on the resource type in the pipeline config
- If unique version history = true, hash the resource config source with the resource id
- Remove global resources feature flag
cc @vito