Skip to content

stop using unsupported debug flag for plugins#2377

Merged
VinozzZ merged 1 commit intogetporter:release/v1from
VinozzZ:stop-sending-debug-to-plugins
Sep 26, 2022
Merged

stop using unsupported debug flag for plugins#2377
VinozzZ merged 1 commit intogetporter:release/v1from
VinozzZ:stop-sending-debug-to-plugins

Conversation

@VinozzZ
Copy link
Contributor

@VinozzZ VinozzZ commented Sep 26, 2022

What does this change

since porter has removed the debug flag from plugins, we need to remove the reference in porter when running a plugin command

What issue does it fix

Closes #2375

Notes for the reviewer

Checklist

  • Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list. Thank you for making Porter better! 🙇‍♀️

Reviewer Checklist

  • Comment with /azp run test-porter-release if a magefile or build script was modified
  • Comment with /azp run porter-integration if it's a non-trivial PR

Signed-off-by: Yingrong Zhao <yingrong.zhao@gmail.com>
@carolynvs carolynvs self-assigned this Sep 26, 2022
Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

plugin, err := p.Plugins.GetMetadata(ctx, opts.Name)
if err != nil {
return err
return fmt.Errorf("failed to get plugin metadata: %w", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I created #2376 to improve the error message returned when calls to the plugin fail. It would have helped us debug if stderr had been included in the error message that was returned in err.

@carolynvs
Copy link
Member

I had one thought. This doesn't affect mixins at runtime, they rely on the PORTER_DEBUG environment variable set inside the bundle instead of the --debug flag. But when we call mixins at build time, for example for the build, lint or schema commands, then this does prevent us from passing along the --debug flag to them.

I don't think any of the mixins use that flag for those commands (--debug has always been kind of a runtime thing) but if we ever need it in the future, the way to get --debug to work would be to pass PORTER_DEBUG to the mixin at buildtime too.

I just wanted to capture that in case we end up wanting the mixin to behave differently in the future. I do think that not assuming that the mixin or plugin has a --debug flag is good and to use other ways to communicate that don't result in a hard failure if it's not supported.

@VinozzZ VinozzZ merged commit ce94589 into getporter:release/v1 Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to install v1.0.0-rc.1 plugins

2 participants