Skip to content

feat(instance): add environment field and deprecate business field #3004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2025

Conversation

winfredLIN
Copy link
Collaborator

@winfredLIN winfredLIN commented Apr 1, 2025

User description

关联的 issue

https://github.com/actiontech/sqle-ee/issues/2306
#3008

描述你的变更

  • 向数据源结构体添加环境字段。
  • 弃用数据源结构体中的业务字段及相关应用程序接口。
  • 添加按环境ID过滤的参数以取代按业务过滤。
  • 更新应用程序接口端点和文档以反映这些更改。
  • Add environment field to Instance struct
  • Deprecate business field in Instance struct and related APIs
  • Add filter_by_environment_id parameter to replace filter_by_business
  • Update API endpoints and documentation to reflect these changes

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc


Description

  • 添加环境字段

  • 弃用业务字段

  • 更新过滤参数

  • 修改API端点和文档


Changes walkthrough 📝

Relevant files
Enhancement
5 files
instance.go`
添加环境字段及弃用业务字段                                                                                       
instance_audit_plan.go`
添加环境字段及弃用业务字段                                                                                       
sql_manage.go`
添加环境字段及弃用业务字段                                                                                       
sql_manage.go`
添加环境字段及弃用业务字段                                                                                       
instance.go`
添加环境字段及弃用业务字段                                                                                       
Documentation
3 files
docs.go`
更新文档以弃用业务字段                                                                                           
swagger.json`
更新swagger文档以弃用业务字段                                                                             
swagger.yaml`
更新swagger文档以弃用业务字段                                                                             
Additional files
8 files
instance.go +4/-2     
instance_audit_plan.go +14/-8   
sql_manage.go +5/-1     
sql_manage.go +1/-1     
docs.go +13/-4   
swagger.json +13/-4   
swagger.yaml +15/-4   
instance.go +5/-3     

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • - Add environment field to Instance struct
    - Deprecate business field in Instance struct and related APIs
    - Add filter_by_environment_id parameter to replace filter_by_business
    - Update API endpoints and documentation to reflect these changes
    @actiontech-bot actiontech-bot requested a review from BugsGuru April 1, 2025 10:17
    Copy link

    github-actions bot commented Apr 1, 2025

    PR Reviewer Guide 🔍

    🎫 Ticket compliance analysis ✅

    2306 - Fully compliant

    Compliant requirements:

    • 向数据源结构体添加环境字段
    • 弃用数据源结构体中的业务字段及相关应用程序接口
    • 添加按环境ID过滤的参数以取代按业务过滤
    • 更新应用程序接口端点和文档以反映这些更改
    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    字段弃用

    确保弃用business字段不会影响现有功能,并正确替换为environment字段。

    FilterDBType string `json:"filter_db_type" query:"filter_db_type"`
    // TODO This parameter is deprecated and will be removed soon.
    FilterByBusiness         string `json:"filter_by_business" query:"filter_by_business"`
    FilterByEnvironmentID    uint   `json:"filter_by_environment_id" query:"filter_by_environment_id"`
    模型更新

    验证在数据模型中添加environment字段和弃用business字段是否符合预期,并确保相关数据库迁移正确。

    // TODO This parameter is deprecated and will be removed soon.
    Business      string `json:"business"`
    Environment   string `json:"environment"`
    EnableBackup  bool   `json:"enable_backup"`
    BackupMaxRows uint64 `json:"backup_max_rows"`

    Copy link

    github-actions bot commented Apr 1, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @BugsGuru BugsGuru merged commit 9340546 into main Apr 1, 2025
    4 checks passed
    @BugsGuru BugsGuru deleted the 2306 branch April 1, 2025 10:29
    @winfredLIN winfredLIN mentioned this pull request Apr 2, 2025
    6 tasks
    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.

    2 participants