12 Commits

Author SHA1 Message Date
Petrus Han d06ab44e52 Feature Architecture & CI Improvements (#4)
* chore: 升级 tj-actions/changed-files 到 v46.0.1

* Add feature-based architecture for version-specific config

Introduces a feature registry and auto-discovery system under modules/features/ to manage version-specific configuration logic. Adds base classes and decorators for feature registration, semantic version comparison, and applies features in global, infrastructure, plugins, and services modules. Implements features for trigger worker, plugin metrics, and external Prometheus (3.7.0+). Updates i18n translations and documentation to reflect the new architecture and configuration options. Includes tests for feature registration, version parsing, and applicability.

* Add Docker registry secret generator and secret utils

Added generate-image-repo-secret.sh for interactively creating Kubernetes imagePullSecret for private Docker registries. Updated .gitignore to better exclude sensitive files. Added utils/secrets.py for secret key generation. Updated README files with instructions for using the new secret generator script.

* ci: add unit tests and module validation

- Add test job to validate all Python module imports
- Add feature tests, services tests, and S3 config tests
- Add shell script validation with shellcheck
- Update actions to v4/v5 versions
- Add CI integration test plan documentation

* ci: skip interactive tests in CI environment

test_services.py and test_s3_config.py require interactive input,
skip them until --ci mode is implemented

* chore: add PR template

* feat: add --ci non-interactive mode for CI testing

- Add set_ci_mode() and is_ci_mode() to config.py
- Add --ci flag to generate-values-prd.py
- Update utils/prompts.py to return defaults in CI mode
- Update i18n/language.py to use English in CI mode
- Update utils/downloader.py to use latest version in CI mode
- Update version_manager.py to avoid variable shadowing
- Enable CI mode in test files for non-interactive testing
2026-02-04 15:19:36 +09:00
Petrus Han 412a630b46 Enhance Helm chart handling and i18n messages
Improves user feedback and control when handling local values.yaml and Helm chart extraction. Adds new internationalized messages for chart directory management, including prompts for overwriting or using existing directories, and displays more detailed information about expected file locations. Updates logic in generate-values-prd.py and downloader.py to utilize these new messages and provide a better user experience.
2025-11-24 13:59:26 +08:00
Petrus Han 0d02b4ec9d Update project to Dify EE (Enterprise Edition) branding
Renamed all references from 'Dify Helm Chart Values Generator' to 'Dify EE (Enterprise Edition) Helm Chart Values Generator' across documentation, code comments, and metadata. Updated documentation to clarify that Helm is now a required dependency, improved instructions for using local values.yaml with version detection, and revised output file naming conventions. Enhanced CLI and i18n support for version handling and language selection.
2025-11-24 13:50:36 +08:00
Petrus Han 6f7d4e6b68 fix: 修复版本选择逻辑,使用实际选择的版本号
- 当用户选择最新版本时,返回实际的版本号(如 3.6.0-beta.1)而不是 None
- 确保下载的 values.yaml 和 Chart 版本一致"
2025-11-24 12:53:47 +08:00
Petrus Han e7ca90d266 fix: 移除版本列表末尾的多余空行 2025-11-24 11:33:58 +08:00
Petrus Han 0f3abe6ee4 fix: 修复 Helm Chart 下载错误和版本提取问题
- 修复 get_or_download_values 返回类型,返回 (file_path, version) 元组
- 使用临时目录解压 Chart,避免目录冲突
- 改进错误信息显示,显示实际的 stderr 输出
- 修复版本提取逻辑,使用实际选择的版本而不是从缓存文件名提取
2025-11-24 11:32:24 +08:00
Petrus Han 538284da0b feat: 完善 Helm Chart 下载和解压功能
- 优化版本提取逻辑
- 完善错误处理
2025-11-24 11:29:56 +08:00
Petrus Han 01cf94c830 feat: 实现 Helm Chart 下载和解压功能
- 新增 download_and_extract_chart() 函数
- 使用 helm pull --untar 下载并解压 Chart
- 解压到 dify-{version} 目录
- 自动检测已存在的目录,避免重复下载
2025-11-24 11:27:39 +08:00
Petrus Han cd3eab8754 feat: 添加 Helm Chart 下载和解压功能
- 新增 download_and_extract_chart() 函数
- 用户选择版本后自动下载并解压 Chart 到 dify-{version} 目录
- 更新 .gitignore 忽略 dify-*/ 目录
- 添加相关翻译键
2025-11-24 11:26:13 +08:00
Petrus Han 1479adb672 feat: 添加版本来源选择功能
- 用户可以选择查看'已发布版本'或'所有版本'
- 默认选择'已发布版本'(使用 Helm 命令)
- '所有版本'直接从 index.yaml 获取
- 新增 get_published_versions() 函数用于获取已发布版本列表
2025-11-24 11:22:50 +08:00
Petrus Han 03d399690b refactor: 优化版本获取流程
- 查看所有版本:直接下载 index.yaml(更快、更可靠)
- 查询已发布版本:使用 Helm 命令(确保版本可用性)

分离两个函数:
- get_helm_chart_versions(): 用于显示版本列表,直接下载 index.yaml
- get_published_version(): 用于下载 values.yaml,使用 Helm 命令验证版本
2025-11-24 11:21:40 +08:00
Petrus Han 0871e8ace3 feat: 完成 i18n 国际化、配置常量提取和版本选择功能
主要变更:
- 实现完整的 i18n 国际化系统,支持中英文双语
- 提取所有硬编码配置为全局常量(config.py)
- 添加 Helm Chart 版本选择功能,支持从 index.yaml 获取版本列表
- 实现倒序版本显示(最旧版本编号最大,最新版本编号为1)
- 修复 Helm 命令构建问题(--version 参数作为独立参数)
- 所有代码注释改为英文
- 模块化重构,提高代码可维护性

新增文件:
- config.py: 全局配置常量
- i18n/: 国际化模块
- modules/: 配置模块
- utils/: 工具模块
- docs/: 文档目录
- version_manager.py: 版本管理模块

修改文件:
- generate-values-prd.py: 主入口,添加语言和版本选择
- generator.py: 核心生成器类
- .gitignore: 更新忽略规则
2025-11-24 11:14:19 +08:00