Skip to content

[已重新提PR,待Review] feat: 1) support length_not_equal comparison; 2) All length comparators support numbers#5207

Closed
wangliang181230 wants to merge 18 commits into1Panel-dev:v2from
wangliang181230:PR/feat-newCompare-len-not-eq
Closed

[已重新提PR,待Review] feat: 1) support length_not_equal comparison; 2) All length comparators support numbers#5207
wangliang181230 wants to merge 18 commits into1Panel-dev:v2from
wangliang181230:PR/feat-newCompare-len-not-eq

Conversation

@wangliang181230
Copy link
Copy Markdown
Contributor

@wangliang181230 wangliang181230 commented Apr 29, 2026

What this PR does / why we need it?

feat: 1) support length_not_equal comparison; 2) All length comparators support numbers

Summary of your change

  1. 判断器的条件,添加 长度不等于 (len_not_eq) 比较
  2. 所有长度比较器都支持数字的长度比较
  3. 封装及复用长度计算方法 compute_length(source_value, target_value)

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 29, 2026

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 29, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wangliang181230 wangliang181230 changed the title feat: support length_not_equal comparison feat: 1) support length_not_equal comparison; 2) All length comparators support length comparison of numbers Apr 29, 2026
@wangliang181230 wangliang181230 changed the title feat: 1) support length_not_equal comparison; 2) All length comparators support length comparison of numbers feat: 1) support length_not_equal comparison; 2) All length comparators support numbers Apr 30, 2026
source_length = len(source_value) if source_value is not None else 0
except Exception:
# 可计算数字长度
source_length = len(str(source_value))
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 30, 2026

Choose a reason for hiding this comment

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

  1. 优化:封装 compute_length 方法
  2. 新特性2:所有长度比较器,都支持比较数字的长度了

# 长度不等于 比较
return source_length != target_length
except Exception:
return False
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

新特性1:新增长度不等于 len_not_eq 比较器

@shaohuzhang1
Copy link
Copy Markdown
Contributor

感谢你的贡献!为了保证提交历史的整洁与可追溯性,项目要求每个 Pull Request 只包含一个 commit

当前 PR 包含了多个 commit,暂时无法合并。请按以下方式修整后重新提交:

  1. 在本地分支执行 git rebase -i main(或目标分支),将多个 commit 压缩为一个;
  2. 然后 git push --force-with-lease 更新此 PR;
  3. 或者你也可以新开一个 PR,只附带一个干净的 commit。

我们期待你的更新,感谢理解和配合!

@wangliang181230
Copy link
Copy Markdown
Contributor Author

wangliang181230 commented Apr 30, 2026

有点搞不懂哦,Github的Merge功能,是会自动压缩PR为一个commit的啊。
你们直接 Files changed 里查看文件变更不就行了吗?

@shaohuzhang1
Copy link
Copy Markdown
Contributor

感谢你的 PR!由于本次提交包含了多个 commit,审核时需要在多个 commit 之间跳转、拼凑完整的改动逻辑,这极大增加了代码审核的难度和时间成本

为了保证审核质量和效率,本项目要求一个 PR 只包含一个 commit。请将本次改动压缩(squash)为一个 commit 后重新推送,我们会尽快完成审核。感谢你的理解和配合!

@wangliang181230
Copy link
Copy Markdown
Contributor Author

已经 rebase 了

@wangliang181230 wangliang181230 changed the title feat: 1) support length_not_equal comparison; 2) All length comparators support numbers [已重新提PR,待Review] feat: 1) support length_not_equal comparison; 2) All length comparators support numbers May 6, 2026
@wangliang181230
Copy link
Copy Markdown
Contributor Author

see #5218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants