googleapis / release-please-action

automated releases based on conventional commits
Apache License 2.0
1.64k stars 207 forks source link

Enable loading of custom plugins similar to the CLI tool #841

Open SgtPooki opened 11 months ago

SgtPooki commented 11 months ago

TL;DR

Custom plugins that are loaded by the CLI tool are not loaded by the release-please action.

The release-please-action should allow for users to specify custom release-please plugins without requiring them to call the release-please CLI directly.

Detailed design

There are already config options available to specify release-please plugins, so the tool is aware of them, however, the execution runtime is not the same as the release-please binary which will require plugins that are known to it.

There are a few different paths forward:

  1. No change to release-please-action: The internal release-please logic should try to load custom plugins during manifest construction
  2. No change to release-please-action: The internal release-please logic should fall-back to trying to require "unknown" types before emitting ConfigurationErrors
  3. New 'external-plugins' key in release-please-action: release-please-action should require plugins prior to constructing the manifest (1, 2, 3)
  4. New release-please-action handling of plugins arg: Try to require any plugins passed to release-please-action, similar to the release-please CLI. This is possibly BREAKING for existing release-please-action users?

Additional information

See https://github.com/ipfs-shipyard/release-please-ipfs-plugin#ensure-you-call-the-release-please-binary for more details, but basically:

  1. custom plugins are loaded in the CLI by https://github.com/googleapis/release-please/blob/71dcc7b3b2df4bb3d3e0884b3f0bfb96700cb76a/src/bin/release-please.ts#L828-L843
  2. There exists no methods in this action to accomplish the same

This results in errors like that seen at https://github.com/ipfs/ipfs-desktop/actions/runs/6506161278/job/17671766024#step:2:913

SgtPooki commented 11 months ago

Note that when changing the CI to use the CLI commands, the plugin is loaded properly: https://github.com/ipfs/ipfs-desktop/actions/runs/6565554763/job/17835204060#step:5:17.

The line in the output above is emitted by https://github.com/ipfs-shipyard/release-please-ipfs-plugin/blob/a5529f51b3d2ca8907387e395745a85f6352ed1a/src/index.ts#L10

chingor13 commented 11 months ago

AFAIK, release-please (or the action) cannot dynamically load plugins from other packages. This was something I was looking into but is not implemented.

SgtPooki commented 10 months ago

AFAIK, release-please (or the action) cannot dynamically load plugins from other packages. This was something I was looking into but is not implemented.

If the plugin is a dependency of the package release-please is running against (ie in node_modules), or even pulled in during CI workflow, release-please should be able to require it the same as the CLI.