fix: remove redundant global flags from dsettings config#444
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR cleans up the dsettings configuration for org.deepin.dde.lastore by removing redundant "flags": ["global"] entries from multiple configuration keys to simplify and clarify how settings are applied. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
CLA Assistant Lite bot: |
The "flags": ["global"] entries were redundant across multiple dsettings keys (use-dsettings, version, system-sources, delivery limit configs, etc.). Remove them to simplify the configuration. Bug: https://pms.uniontech.com/bug-view-368375.html
c891afb to
981a6e8
Compare
deepin pr auto review★ 总体评分:20分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 建议回退删除操作,保留白名单校验逻辑,并在结构体中增加废弃警告注释
type Config struct {
// ... 其他字段
// Deprecated: AllowInstallRemovePkgExecPaths is deprecated for removal in next major release.
// Use new security module instead.
AllowInstallRemovePkgExecPaths []string
AutoInstallUpdates bool
AutoInstallUpdateType system.UpdateType
// ...
}
const (
// ...
dSettingsKeyAllowInstallRemovePkgExecPaths = "allow-install-remove-pkg-exec-paths"
// ...
)
// getConfigFromDSettings 中恢复白名单解析并增加类型断言保护
v, err = c.dsLastoreManager.Value(0, dSettingsKeyAllowInstallRemovePkgExecPaths)
if err != nil {
logger.Warningf("failed to get allow install remove pkg exec paths: %v", err)
} else {
if variants, ok := v.Value().([]dbus.Variant); ok {
for _, s := range variants {
if path, ok := s.Value().(string); ok {
c.AllowInstallRemovePkgExecPaths = append(c.AllowInstallRemovePkgExecPaths, path)
}
}
}
}
// json2DSettings 中恢复配置迁移
_ = c.SetAllowInstallRemovePkgExecPaths(append(oldConfig.AllowInstallRemovePkgExecPaths, c.AllowInstallRemovePkgExecPaths...))
// 恢复 Setter 方法
func (c *Config) SetAllowInstallRemovePkgExecPaths(paths []string) error {
c.AllowInstallRemovePkgExecPaths = paths
return c.save(dSettingsKeyAllowInstallRemovePkgExecPaths, paths)
} |
|
@qiuzhiqian: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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/test-infra repository. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: qiuzhiqian, zhaohuiw42 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
The "flags": ["global"] entries were redundant across multiple dsettings keys (use-dsettings, version, system-sources, delivery limit configs, etc.). Remove them to simplify the configuration.
Bug: https://pms.uniontech.com/bug-view-368375.html
Summary by Sourcery
Bug Fixes: