Skip to content

Commit a687209

Browse files
authored
Add additional check before removing unreleased dependency tag (#45481)
1 parent e1b5d39 commit a687209

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

eng/versioning/utils.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,18 @@ def load_version_map_from_file(the_file, version_map: Dict[str, CodeModule], aut
200200
raise ValueError('Version file: {0} does not contain a non-beta or non-unreleased entry for beta_/unreleased_ library: {1}'.format(the_file, module.name))
201201

202202
# Unreleased dependencies have a few additional checks.
203-
# 1. If 'auto_increment_version' is true, check if the version matches the dependency version of the library.
204-
# If the unreleased dependency version is the same as the dependency version, flag the unreleased dependency for replacement.
205-
# This flag will indicate to the update script that the 'unreleased_*' tag should be replaced with just '*', ex 'unreleased_core' -> 'core'.
203+
# 1. If 'auto_increment_version' is true, check if the version matches the non-unreleased dependency
204+
# version of the library and that the dependency version doesn't the current version.
205+
# If that check passes, flag the unreleased dependency for replacement.
206+
# This is to allow the update script to replace the 'unreleased_*' tag with just '*', ex 'unreleased_core' -> 'core'.
207+
# When the non-unreleased dependency versions match this is an indication that the library has never
208+
# been released and there is a library outside the /sdk/<group> directory that has a development
209+
# on it.
206210
# 2. Check to see that the version matches the current version of the library.
207211
# If it isn't raise an error as unreleased dependencies should match the current version of the library.
208212
if is_unreleased:
209213
non_unreleased_module = version_map[tempName]
210-
if auto_increment_version and module.dependency == non_unreleased_module.dependency:
214+
if auto_increment_version and module.dependency == non_unreleased_module.dependency and non_unreleased_module.current != non_unreleased_module.dependency:
211215
module.replace_unreleased_dependency = True
212216
file_changed = True
213217
elif module.dependency != non_unreleased_module.current:

0 commit comments

Comments
 (0)