Skip to content

Clean up version warning#5183

Open
SirTyson wants to merge 1 commit intostellar:masterfrom
SirTyson:version-warning-fix
Open

Clean up version warning#5183
SirTyson wants to merge 1 commit intostellar:masterfrom
SirTyson:version-warning-fix

Conversation

@SirTyson
Copy link
Contributor

Description

Resolves #4882

Written by our dear friend gpt 5.4

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Stellar Core’s “major version vs protocol” identity check to better recognize packaged release version strings and to emit warnings via the logging system rather than std::cerr, addressing the incorrect “non-release version” warning seen in captive-core.

Changes:

  • Extend getStellarCoreMajorReleaseVersion() to accept packaged version strings like stellar-core X.Y.Z (<commit-hash>).
  • Replace the std::cerr non-release warning with LOG_WARNING in main.
  • Add regression tests for the packaged-version parsing and for a git-describe-like string that should remain nullopt.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/main/test/ApplicationUtilsTests.cpp Adds test coverage for packaged-version parsing and ensures git-describe strings still return nullopt.
src/main/main.cpp Rewords the version-format comment and switches the non-release warning from cerr to structured logging.
src/main/ApplicationUtils.cpp Expands major-version parsing regex to recognize packaged build version strings.

Comment on lines +280 to +281
LOG_WARNING(DEFAULT_LOG, "Running non-release version {} of "
"stellar-core",
Comment on lines +1197 to 1201
if (std::regex_match(vstr, match, releaseTagRe) ||
std::regex_match(vstr, match, packagedReleaseRe))
{
uint32_t vers = stoi(match.str(1));
return std::make_optional<uint32_t>(vers);
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.

Incorrect warning to std err

2 participants