Let dev builds use future spec versions #4266
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
The
spec_version
metadata property defines the earliest version of the CKAN client that can properly handle a given module. As of #4155 it is populated programmatically based on analysis of the fields that are present or absent in a module. The CKAN client ignores modules with "future" spec versions indicating that it can't handle them properly.When we add a new feature, it goes into the dev build immediately. So at any stage of development, all of the next release's functionality is already present in the dev build. But dev builds have a version that corresponds to the same spec version as the current release (but with an odd patch version), so they'll ignore modules with higher spec versions that they can in fact handle properly.
Motivation
#4260 updated the spec version analyzer to use
v1.36
for modules withrelease_status
set to something other thanstable
, to hide them from old clients. This has also hidden them from the dev build, which means it cannot be used for piloting the pre-release functionality from that PR. This defeats the purpose of having dev builds with respect to such changes.Changes
Meta.SpecVersion
is a static readonly field that represents the next highest minor version for dev builds and is the same asMeta.ReleaseVersion
otherwise (thanks to regex magic)CkanModule.IsSpecSupported
compares modules' spec versions toMeta.SpecVersion
instead ofMeta.ReleaseVersion
Meta.GetProductName()
is replaced by a static readonly fieldMeta.ProductName
so we don't have to keep recalculating its value with reflectionMeta.IsNetKAN
is a static readonly field so we don't have to keep recalculating its value with reflection