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これらのドキュメントを見ると、そのオプションの機能についてはmajorminor 、およびpatchラベルが私のもので上書きされると思いますが、それらに加えて作成されている他のものをクリアしないでください。 create labelsコマンドにinclude-defaultsというオプションを追加し、true / false(下位互換性を維持したい場合はデフォルトでtrue)に設定するのが良い追加だと思います。 考え?

@reintroducingに同意します。 overwriteオプションについては知っていましたが、正しく理解していれば、デフォルトのラベルを調整するだけです。 構成したラベルのみを作成するオプションが必要です。

@reintroducing私はそのオプションがとても好きです! デフォルトでは、指定されたラベルのみを作成できます。 他のものを含み、上書きロジックを使用するための新しいフラグ。 ただし、これは動作の重大な変更になります。 反対の--no-include-defaultsどうですか?

@hipstersmoothieはい、申し訳ありませんが、私の説明は明確ではありませんでした。私はあなたと同じことを提案していましたが、逆であり、

私は週末までこれにたどり着く必要はないかもしれません。 PRを送信すると、プロンプトを確認してマージします

https://github.com/intuit/auto/pull/1966で修正しようとしましたが、方法が少し異なります。 そこの説明を参照してください。


:rocket:問題はv10.26.0リリースされました:rocket:

@laughedelic @hipstersmoothie @adierkensこれへのアップグレードを試したところ、CIで次の問題が発生し、新しいPRでカナリアが自動的に作成されます。

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

実際の構成はpackages / auto / config.jsonファイルにあり、以下を使用してリポジトリのルートで拡張されていることに注意してください。

"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 評価