已合并
fix: update UCG version parsing logic to support newer component versions #1198
wangjianming创建于 3月17日
fix: update UCG version parsing logic to support newer component versions #1198
已合并
wangjianming创建于 3月17日
wangjianming
3月17日

Motivation

The output format of the ucg_info -v command has changed in the new component version (26.0.RC1). The new output includes an additional "UCG abi version" line preceding the actual version string.
Previously, the code assumed the version string was always the first line matching "version" (index 0). With the new output, index 0 incorrectly captures the ABI version instead of the UCG version, causing version detection failures.

Changes

  • Modified the list indexing in the version detection logic from 0 to -1.
  • This ensures the script captures the last line containing "version", which corresponds to the actual UCG version in both old and new output formats.

Code Change

# Before
ucg_info = self.get_cmd_output("ucg_info -v |grep version")[0]

# After
ucg_info = self.get_cmd_output("ucg_info -v |grep version")[-1]

Verification

Tested against both old and new component versions to ensure backward compatibility.
Old Version Output (25.1.0):

$ ucg_info -v | grep version
# UCG version 25.1.0
# Result: Index -1 correctly captures "UCG version 25.1.0"

New Version Output (26.0.RC1):

$ ucg_info -v | grep version
# UCG abi version 1
# UCG version 26.0.RC1
# Result: Index -1 correctly captures "UCG version 26.0.RC1" (Index 0 would fail)

Checklist

  • Code passes existing tests
  • Verified compatibility with legacy versions
  • Verified compatibility with new versions
likedislike
Pull Request已成功合入, 合并人@openeuler-ci-bot
(感谢 wangjianming 的贡献)
Wwangjianming
3月17日 创建了 pull request,commit 012a475c
openeuler-ci-botopeneuler-ci-bot成员
3月17日 将iotwins设为审查人
openeuler-ci-botopeneuler-ci-bot成员
3月17日 添加了label:sig/sig-HPC
openeuler-ci-bot
openeuler-ci-bot成员
3月17日 评论:

Welcome To openEuler Community

Hey @wjm715 , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: sig-HPC ,
and any of the maintainers: @iotwins ,
and any of the committers: @dfrj, @iotwins, @lmy1016071721, @sunlock0653, @victorjin, @yyu497 .

likedislike
openeuler-ci-botopeneuler-ci-bot成员
3月17日 添加了label:openeuler-cla/yes
openeuler-ci-bot
openeuler-ci-bot成员
3月17日 评论:

CLA Signature Pass

wjm715, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
sunlock0653成员
3月19日 评论:

/lgtm
/approve

likedislike
openeuler-ci-bot
openeuler-ci-bot成员
3月19日 评论:

Review Code Feedback

  • The label lgtm was added to this pull request. It means that sunlock0653 reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
openeuler-ci-bot
openeuler-ci-bot成员
3月19日 评论:

Review Code Feedback

  • The label approved was added to this pull request. It means that sunlock0653 reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
openeuler-ci-botopeneuler-ci-bot成员
3月19日 添加了label:approvedlgtm
openeuler-ci-botopeneuler-ci-bot成员
3月19日 合入了pull request,合并节点 SHA:65e55f6cbc6994cc232dd240d60379ad40a43795