Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 9, 2025

Implementation Plan for versionHeightOffsetAppliesTo

  • Add versionHeightOffsetAppliesTo property to VersionOptions class
  • Add backing field and JSON property for the new field
  • Update copy constructor to copy the new field
  • Update equality comparer to include the new field
  • Add property to version.schema.json for JSON schema validation
  • Implement logic to check if offset applies to current version
  • Update ReleaseManager to clear both properties when version resets
  • Add serialization rule for the new property
  • Add unit tests for the new functionality
  • Update documentation in versionJson.md
  • Test the implementation end-to-end with a real repository
  • Fix version height offset logic to work correctly in all contexts
  • Address code review feedback
  • Add documentation callout for version inheritance use case

Summary

This implementation adds the versionHeightOffsetAppliesTo property to version.json, which allows version height offsets to automatically reset when the version changes. This eliminates the need to manually remove offset properties from all version.json files in a repository when the version is bumped.

The documentation now includes a callout highlighting the particularly useful scenario where a version.json file uses "inherit": true to get the version from a parent file, making offset management even more seamless in multi-file configurations.

All tests pass and the implementation is ready for review.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add versionHeightOffsetAppliesTo property to version.json</issue_title>
<issue_description>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.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #1278


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@AArnott
Copy link
Collaborator

AArnott commented Oct 9, 2025

@copilot We should be sure to update the json schema file and update the markdown documents to describe this new property alongside versionHeightOffset.

Copilot AI changed the title [WIP] Add versionHeightOffsetAppliesTo property to version.json Add versionHeightOffsetAppliesTo property to version.json Oct 9, 2025
Copilot finished work on behalf of AArnott October 9, 2025 17:12
Copilot AI requested a review from AArnott October 9, 2025 17:12
@AArnott AArnott marked this pull request as ready for review October 9, 2025 23:05
@AArnott AArnott enabled auto-merge October 9, 2025 23:10
Copilot AI requested a review from AArnott October 9, 2025 23:11
Copilot finished work on behalf of AArnott October 9, 2025 23:11
@AArnott AArnott added this pull request to the merge queue Oct 9, 2025
Merged via the queue into main with commit ead5232 Oct 9, 2025
12 checks passed
@AArnott AArnott deleted the copilot/add-version-height-offset-property branch October 9, 2025 23:46
@AArnott AArnott added this to the v3.9 milestone Oct 10, 2025
This was referenced Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add versionHeightOffsetAppliesTo property to version.json

2 participants