尧图网站设计 尧图网站设计YAOTU DESIGN
ARTICLE DETAIL

资讯详情

深耕网站设计与一线实操的经验洞察。

Self-Healing Configuration

Self-Healing Configuration Self-Healing Configuration【免费下载链接】nxThe Monorepo Platform that amplifies both developers and AI agents. Nx optimizes your builds, scales your CI, and fixes failed PRs automatically. Ship in half the time.项目地址: https://gitcode.com/GitHub_Trending/nx/nxConfidence RulesFixes involving test targets should require high confidenceFormatting fixes can be applied with medium confidenceOff-Limits Areas/src/generated/- auto-generated, do not modify/legacy/- requires manual reviewFix PreferencesPrefer updating ESLint rules over adding disable commentsFor type errors, prefer explicit types overanyContextSee ARCHICTECTURE.md for module boundaries.文档建议覆盖的五类内容 | 段落 | 用途 | 示例 | | --- | --- | --- | | **Confidence Rules** | 覆盖 AI 对失败严重程度的分级 | “**/migrations/** 中的失败应归类为 environment_state” | | **Off-Limits Areas** | agent 永远不应修改的目录或文件 | “/src/generated/ - auto-generated code” | | **Fix Preferences** | 指导 agent 处理常见问题的方式 | “Prefer updating ESLint rules over adding disable comments” | | **Predefined Fixes** | 为已知失败指定确定性解法 | “对 lint 失败先尝试运行 nx lint --fix” | | **Context** | 引用 agent 应阅读的其他文档 | “See ARCHITECTURE.md for module boundaries” | 如果仓库根目录已有 CLAUDE.mdagent 也会读取它两者同时存在时冲突指令以 **SELF_HEALING.md 优先**CLAUDE.md 中的通用上下文仍然可用。CI 专属指令应写在 SELF_HEALING.md 里。 ## 高级用 .nx/ci-config.yaml 做分支级覆盖 官方建议日常配置走工作区设置.nx/ci-config.yaml 中的覆盖项只用于**临时的、分支专属**的调整例如在敏感分支上临时关闭自愈或在把工作区设置定稿前试配置。在 .nx/ci-config.yaml 的 ai 段下可设置 | 键 | 说明 | 示例 | | --- | --- | --- | | fix-tasks-patterns | 覆盖哪些任务有资格被修复 | [*lint*, *test*] | | auto-apply-patterns | 覆盖哪些任务可被自动应用 | [*lint*] | yaml # .nx/ci-config.yaml ai: # 修复 lint 和 test 任务但从不修复 e2e fix-tasks-patterns: - *lint* - *test* - !*e2e* # 只自动应用 lint 修复 auto-apply-patterns: - lint模式使用 glob 语法匹配任务名!前缀表示取反。优先级规则当工作区设置和.nx/ci-config.yaml同时存在时.nx/ci-config.yaml对它设置的键优先未设置的键回落到工作区设置。完整的键说明见 CI Configuration File 参考。验证配置生效并处理修复CI 跑完后到 Nx Cloud 中打开对应的 pipeline executionCIPE有两个入口用于核对Configurations 标签页查看本次执行时相关的工作区设置、ci-config.yaml提供的值以及最终生效的配置如果创建了SELF_HEALING.md这里也能看到它是否被检测到并应用PR/MR 本身失败任务的修复会以 PR 评论形式出现包含推理摘要、diff 视图和 Apply/Reject 按钮安装了 Nx Console 的用户还能在 VS Code、Cursor 或 WebStorm 里直接收到修复通知。对一条具体修复应用与回滚都有明确路径直接应用在编辑器通知、PR/MR 评论或 Nx Cloud UI 的 diff 视图中点击 “Apply”本地微调如果修复只差一点在评论或 UI 中点 “Apply Locally”然后在终端运行给出的命令fix identifier 显示在 Nx Cloud UI 和 PR/MR 评论中nx apply-locally fix-identifier【免费下载链接】nxThe Monorepo Platform that amplifies both developers and AI agents. Nx optimizes your builds, scales your CI, and fixes failed PRs automatically. Ship in half the time.项目地址: https://gitcode.com/GitHub_Trending/nx/nx创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表