Skip to content

Add versionHeightOffsetAppliesTo property to version.json #1278

@AArnott

Description

@AArnott

The versionHeightOffset property in version.json is typically a bandaid to a problem that only applies till the version property in that file changes, such that the version height would reset to 0 anyway. But it often happens that people miss the opportunity to reset that offset to 0 in the exact same commit as the one that bumps the version property, such that the offset repeatedly persists longer than it should.

Let's add a versionHeightOffsetAppliesTo property that takes a version (like the version property itself) and when the version property changes such that NB.GV would reset the version height, it will consider the new applies-to property to be a mismatch, and therefore will disregard the versionHeightOffset property from then on, until that property is removed or the applies to property is updated.

At that point, removing versionHeightOffset and versionHeightOffsetAppliesTo properties from a version.json file that are no longer needed or applicable will be safe to do in any commit, as it won't impact the computed version height to do so.

This will allow version height offsets to implicitly reset as intended, without having to remember to remove versionHeightOffset from all version-inheriting version.json files in the repo in the same commit.

The nbgv tool's set-version command should also be updated to remove these two properties when they are deemed to not be needed any more, per the above rules.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions