Skip to content

Commit

Permalink
Mute the minor version warning #18096
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 676149826
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Sep 18, 2024
1 parent f84a208 commit 363de2d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,6 @@ private static void validateProtobufGencodeVersionImpl(
"Detected incompatible Protobuf Gencode/Runtime versions when loading %s: gencode %s,"
+ " runtime %s. Runtime version cannot be older than the linked gencode version.",
location, gencodeVersionString, VERSION_STRING));
} else if ((MINOR > minor || PATCH > patch) && minorWarningLoggedCount < MAX_WARNING_COUNT) {
logger.warning(
String.format(
" Protobuf gencode version %s is older than the runtime version %s at %s. Please"
+ " avoid checked-in Protobuf gencode that can be obsolete.",
gencodeVersionString, VERSION_STRING, location));
minorWarningLoggedCount++;
}

// Check that runtime version suffix is the same as the gencode version suffix.
Expand Down
8 changes: 0 additions & 8 deletions python/google/protobuf/runtime_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ def ValidateProtobufRuntimeVersion(
f' {location}: gencode {gen_version} runtime {version}. Runtime version'
f' cannot be older than the linked gencode version. {error_prompt}'
)
elif MINOR > gen_minor or PATCH > gen_patch:
if _warning_count < _MAX_WARNING_COUNT:
warnings.warn(
'Protobuf gencode version %s is older than the runtime version %s at'
' %s. Please avoid checked-in Protobuf gencode that can be obsolete.'
% (gen_version, version, location)
)
_warning_count += 1

if gen_suffix != SUFFIX:
_ReportVersionError(
Expand Down

0 comments on commit 363de2d

Please sign in to comment.