Skip to content

Conversation

@yungwine
Copy link
Collaborator

@yungwine yungwine commented Jan 9, 2026

No description provided.

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

This PR updates the clang version requirement from 16 to 21 and adds a new Ubuntu version warning to alert users when they're not running on Ubuntu 22.04 or 24.04.

Key changes:

  • Increased required clang version from 16 to 21 with updated documentation URL
  • Refactored get_clang_major_version() function from mytonctrl.py to utils.py for better code organization
  • Added new get_os_version() utility function and check_ubuntu_version() warning function
  • Added Ubuntu version warning translation strings in English, Russian, and Chinese

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
mytonctrl/mytonctrl.py Updated CLANG_VERSION_REQUIRED constant to 21, added check_ubuntu_version function, refactored get_clang_major_version to utils.py, updated warning URL
mytonctrl/utils.py Added get_clang_major_version and get_os_version utility functions
mytonctrl/resources/translate.json Added ubuntu_version_warning translation strings
tests/integration/test_basic_commands.py Updated test mocks to use clang version 21 instead of 16
tests/integration/test_preup.py New test file for testing Ubuntu version warnings
tests/conftest.py Renamed MyMyPyConsole to TestMyPyConsole and added run_pre_up method for testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

def test_warnings(cli, monkeypatch, mocker: MockerFixture):
monkeypatch.setattr(mytonctrl, 'CheckMytonctrlUpdate', lambda *_: None)
monkeypatch.setattr(mytonctrl, 'check_installer_user', lambda *_: None)
monkeypatch.setattr(mytonctrl, 'check_installer_user', lambda *_: None)
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The function 'check_installer_user' is being monkeypatched twice with the same lambda. This is redundant - one of these lines should be removed.

Suggested change
monkeypatch.setattr(mytonctrl, 'check_installer_user', lambda *_: None)

Copilot uses AI. Check for mistakes.
Comment on lines 34 to 35
VERSION="20.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The VERSION field in the mock data shows "20.04.4 LTS (Jammy Jellyfish)" but Jammy Jellyfish is the codename for Ubuntu 22.04, not 20.04. Ubuntu 20.04 is "Focal Fossa". This should be corrected to maintain accurate test data.

Suggested change
VERSION="20.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
VERSION="20.04.4 LTS (Focal Fossa)"
VERSION_CODENAME=focal

Copilot uses AI. Check for mistakes.
Comment on lines 34 to 35
VERSION="20.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Similarly, the VERSION_CODENAME shows "jammy" but should be "focal" for Ubuntu 20.04.

Suggested change
VERSION="20.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
VERSION="20.04.4 LTS (Focal Fossa)"
VERSION_CODENAME=focal

Copilot uses AI. Check for mistakes.
if distro == 'ubuntu':
if ver not in ['22.04', '24.04']:
warning = local.translate("ubuntu_version_warning").format(ver)
print_warning(local, warning)
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The 'check_ubuntu_version' function is missing an #end define comment that is used consistently throughout the rest of the file. For consistency, it should be added.

Suggested change
print_warning(local, warning)
print_warning(local, warning)
#end define

Copilot uses AI. Check for mistakes.
local.try_function(check_slashed, args=[local, ton])
#end define

local.try_function(check_ubuntu_version, args=[local])
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The 'warnings' function is missing an #end define comment that is used consistently throughout the rest of the file. For consistency, it should be added.

Suggested change
local.try_function(check_ubuntu_version, args=[local])
local.try_function(check_ubuntu_version, args=[local])
#end define

Copilot uses AI. Check for mistakes.
output = cli.run_pre_up()
assert 'Ubuntu' not in output

# todo: other warnings No newline at end of file
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The test file is named 'test_preup.py' and tests the warnings function, but it only tests Ubuntu version warnings. The PR title mentions "add clang and ubuntu versions warnings" but there are no tests for clang version warnings. Consider adding test coverage for clang version checks to match the PR's stated purpose.

Copilot uses AI. Check for mistakes.
"ubuntu_version_warning": {
"en": "{{red}}Ubuntu version must be 22.04 or 24.04. Found {0}. {{endc}}",
"ru": "{{red}}Версия Ubuntu должна быть 22.04 или 24.04. Найдена {0}. {{endc}}",
"zh_TW": "{{red}}Ubuntu 版本必须是 22.04 或 24.04。找到 {0}。{{endc}}"
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The zh_TW (Traditional Chinese) translation contains simplified Chinese characters "必须" which should be "必須" (traditional). The word "找到" should also be verified for consistency with Traditional Chinese standards.

Suggested change
"zh_TW": "{{red}}Ubuntu 版本必须是 22.04 或 24.04。找到 {0}。{{endc}}"
"zh_TW": "{{red}}Ubuntu 版本必須是 22.04 或 24.04。找到 {0}。{{endc}}"

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 2
import builtins

Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Import of 'builtins' is not used.

Suggested change
import builtins

Copilot uses AI. Check for mistakes.
@yungwine yungwine merged commit a2e5ec5 into ton-blockchain:dev Jan 9, 2026
6 checks passed
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.

1 participant