Auto: 标签创建添加不需要的默认标签

创建于 2021-04-22  ·  15评论  ·  资料来源: intuit/auto

描述错误
当我运行npx auto create-labels并在我的 package.json 中定义了给定的标签配置时,我希望只创建这些标签,而不是由 auto 定义的其他默认标签。 曾经是这种情况,但沿线的某个地方停止正常工作。

再现

使用以下配置:

"auto": {
    "baseBranch": "master",
    "prereleaseBranches": [
      "next"
    ],
    "plugins": [
      [
        "npm",
        {
          "legacyAuth": true,
          "setRcToken": false
        }
      ],
      "released",
      "microsoft-teams"
    ],
    "shipit": {
      "noChangelog": true
    },
    "labels": [
      {
        "name": "breaking",
        "changelogTitle": "🚨  Breaking Changes",
        "description": "Backwards incompatible enhancement or feature.",
        "releaseType": "major",
        "color": "#c5000b"
      },
      {
        "name": "feature",
        "changelogTitle": "🚀  Features",
        "description": "A new feature.",
        "releaseType": "minor",
        "color": "#00ff00"
      },
      {
        "name": "build",
        "changelogTitle": "📦  Build Process",
        "description": "Changes to the build process.",
        "releaseType": "patch",
        "color": "#4a4a4a"
      },
      {
        "name": "chore",
        "changelogTitle": "🏗  Miscellaneous",
        "description": "Additional, uncategorized changes.",
        "releaseType": "patch",
        "color": "#ff00ff",
        "default": true
      },
      {
        "name": "ci",
        "changelogTitle": "🔖  Continuous Integration",
        "description": "Changes to CI configuration files and scripts.",
        "releaseType": "patch",
        "color": "#f1a60e"
      },
      {
        "name": "docs",
        "changelogTitle": "📖  Documentation",
        "description": "Documentation updates and changes.",
        "releaseType": "patch",
        "color": "#870048"
      },
      {
        "name": "fix",
        "changelogTitle": "🐛  Bug Fixes",
        "description": "A bug fix.",
        "releaseType": "patch",
        "color": "#6000ff"
      },
      {
        "name": "perf",
        "changelogTitle": "⚡️  Performance",
        "description": "A code change that improves performance.",
        "releaseType": "patch",
        "color": "#00e4ff"
      },
      {
        "name": "refactor",
        "changelogTitle": "♻️  Refactoring",
        "description": "A code change that neither fixes a bug nor adds a feature.",
        "releaseType": "patch",
        "color": "#00b58d"
      },
      {
        "name": "revert",
        "changelogTitle": "🚧  Reverting",
        "description": "Reverts a previous commit.",
        "releaseType": "patch",
        "color": "#ff9000"
      },
      {
        "name": "style",
        "changelogTitle": "🎨  Style",
        "description": "Code style (white-space, formatting, missing semi-colons, etc).",
        "releaseType": "patch",
        "color": "#0051d8"
      },
      {
        "name": "test",
        "changelogTitle": "✅  Testing",
        "description": "Adding missing tests or correcting existing tests.",
        "releaseType": "patch",
        "color": "#127f00"
      },
      {
        "name": "upgrade",
        "changelogTitle": "⚙️  Dependencies",
        "description": "Dependency upgrades.",
        "releaseType": "minor",
        "color": "#00787f"
      }
    ]
  }

这是输出:

Created labels: breaking, feature, build, chore, ci, docs, fix, perf, refactor, revert, style, test, upgrade, major, minor, patch, skip-release, internal, documentation, tests, dependencies, performance, released, prerelease

预期行为

只会创建上述配置中列出的标签。 上面输出列表中upgrade标签之后的任何内容都是不需要的,不应创建。

截图

环境信息:

Environment Information:

"auto" version: v10.25.1
"git"  version: v2.29.2
"node" version: v12.13.0

✔ Labels configured on GitHub project

附加上下文

bug released

最有用的评论

@reintroducing我非常喜欢这个选项! 默认只能创建指定的标签。 包含其他标志并使用覆盖逻辑的新标志。 不过,这将是对行为的重大改变。 相反的--no-include-defaults呢?

所有15条评论

我正要提交同样的问题。 文档不清楚覆盖默认标签。 有没有办法说我只想要配置中定义的那些标签而不想要默认标签?

标签配置中有一个overwrite选项,它将覆盖匹配的默认标签。 IDK 是否适用于 zon-semver 标签。 你能试试吗? 如果文档对此不够清楚,更愿意接受 PR

@hipstersmoothie在查看https://intuit.github.io/auto/docs/generated/create-labels时,我没有看到任何这种性质的东西。 与此选项有关的文档在哪里?

啊,它在这里: https: //intuit.github.io/auto/docs/configuration/autorc#label -customization

@hipstersmoothie所以查看这些文档,我想我不清楚该选项的功能。 我会假设,如果我将它添加到我的配置中的每个标签中,它只会用我的标签覆盖majorminorpatch标签,但是会不清除除这些之外正在创建的其他人。 我认为一个不错的补充是向create labels命令添加一个选项,该选项表示include-defaults并设置为 true/false(如果您想保持向后兼容性,则默认为 true)。 想法?

我同意@reintroducing。 我知道overwrite选项,但如果我理解正确,它只是关于调整默认标签。 我们想要一个选项来创建_only_我们配置的标签。

@reintroducing我非常喜欢这个选项! 默认只能创建指定的标签。 包含其他标志并使用覆盖逻辑的新标志。 不过,这将是对行为的重大改变。 相反的--no-include-defaults呢?

@hipstersmoothie是的,抱歉,我的解释不清楚,我建议的内容与您相同,但相反,默认情况下是正确的,哈哈,以避免发生重大变化。 你的实际上更干净,并且与所有其他选项的完成方式更好地保持一致。 我全力以赴!

我可能要到周末才能做到这一点。 如果您提交 PR,我将审核并合并提示

我尝试修复它: https :


:rocket: 问题已在v10.26.0 :rocket:

@laughedelic @hipstersmoothie @adierkens我刚刚尝试升级到这个,我在 CI 中看到以下问题,我们在新 PR 上自动创建金丝雀:

Screen Shot 2021-04-29 at 2 32 48 PM

值得注意的是,实际的配置在packages/auto/config.json文件中,并使用以下内容在我们的 repo 的根目录下进行扩展:

"auto": {
    "extends": "./packages/auto/config.json"
  },

然而,在更新到最新版本之前,这工作得很好。

这是完整的 config.json 文件:

{
  "baseBranch": "master",
  "noDefaultLabels": true,
  "prereleaseBranches": ["next"],
  "plugins": [
    [
      "npm",
      {
        "legacyAuth": true,
        "setRcToken": false
      }
    ],
    "released",
    "microsoft-teams"
  ],
  "shipit": {
    "noChangelog": true
  },
  "labels": [
    {
      "name": "breaking",
      "changelogTitle": "🚨  Breaking Changes",
      "description": "Backwards incompatible enhancement or feature.",
      "releaseType": "major",
      "color": "#c5000b"
    },
    {
      "name": "feature",
      "changelogTitle": "🚀  Features",
      "description": "A new feature.",
      "releaseType": "minor",
      "color": "#00ff00"
    },
    {
      "name": "build",
      "changelogTitle": "📦  Build Process",
      "description": "Changes to the build process.",
      "releaseType": "patch",
      "color": "#4a4a4a"
    },
    {
      "name": "chore",
      "changelogTitle": "🏗  Miscellaneous",
      "description": "Additional, uncategorized changes.",
      "releaseType": "patch",
      "color": "#ff00ff",
      "default": true
    },
    {
      "name": "ci",
      "changelogTitle": "🔖  Continuous Integration",
      "description": "Changes to CI configuration files and scripts.",
      "releaseType": "patch",
      "color": "#f1a60e"
    },
    {
      "name": "docs",
      "changelogTitle": "📖  Documentation",
      "description": "Documentation updates and changes.",
      "releaseType": "patch",
      "color": "#870048"
    },
    {
      "name": "fix",
      "changelogTitle": "🐛  Bug Fixes",
      "description": "A bug fix.",
      "releaseType": "patch",
      "color": "#6000ff"
    },
    {
      "name": "perf",
      "changelogTitle": "⚡️  Performance",
      "description": "A code change that improves performance.",
      "releaseType": "patch",
      "color": "#00e4ff"
    },
    {
      "name": "refactor",
      "changelogTitle": "♻️  Refactoring",
      "description": "A code change that neither fixes a bug nor adds a feature.",
      "releaseType": "patch",
      "color": "#00b58d"
    },
    {
      "name": "revert",
      "changelogTitle": "🚧  Reverting",
      "description": "Reverts a previous commit.",
      "releaseType": "patch",
      "color": "#ff9000"
    },
    {
      "name": "style",
      "changelogTitle": "🎨  Style",
      "description": "Code style (white-space, formatting, missing semi-colons, etc).",
      "releaseType": "patch",
      "color": "#0051d8"
    },
    {
      "name": "test",
      "changelogTitle": "✅  Testing",
      "description": "Adding missing tests or correcting existing tests.",
      "releaseType": "patch",
      "color": "#127f00"
    },
    {
      "name": "upgrade",
      "changelogTitle": "⚙️  Dependencies",
      "description": "Dependency upgrades.",
      "releaseType": "minor",
      "color": "#00787f"
    }
  ]
}

是否有可能需要将新选项添加​​到验证器中,就这么简单? https://github.com/intuit/auto/blob/main/packages/core/src/types.ts#L54

是否有可能需要将新选项添加​​到验证器中,就这么简单? https://github.com/intuit/auto/blob/main/packages/core/src/types.ts#L54

这是有道理的! 我不知道。

@reintroducing我在这里添加了它: https :

此页面是否有帮助?
0 / 5 - 0 等级