Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Non-npm] Custom plugin not found #1915

Closed
angeliski opened this issue Mar 26, 2021 · 6 comments · Fixed by #1930
Closed

[Non-npm] Custom plugin not found #1915

angeliski opened this issue Mar 26, 2021 · 6 comments · Fixed by #1930
Labels
bug Something isn't working released This issue/pull request has been released.

Comments

@angeliski
Copy link
Contributor

Describe the bug

I created a custom plugin but when running in CI, auto never finds my plugin

ps: When I tested local, point to the directory I could execute the plugin. But when tried using the global approach doesn't work

To Reproduce

I put a repository here: https://github.com/angeliski/gem-auto-release

First I tried to use the global approach here: angeliski/gem-auto-release#8
The result: https://app.circleci.com/pipelines/github/angeliski/gem-auto-release/45/workflows/ba986523-811a-4db0-b5c4-6c08054bc12e/jobs/121

⚠  warning   Could not find plugin: auto-plugin-gem-canary-release

And after I tried to use the clone approach here: angeliski/gem-auto-release#9
The result: https://app.circleci.com/pipelines/github/angeliski/gem-auto-release/46/workflows/78f6695d-0af9-4e2f-96b9-dcb5f0e57a2a/jobs/124

⚠  warning   Could not find plugin: ../plugins/auto-plugin-gem-canary-release

Expected behavior
The plugin needs to be founded and execute the canary command.
Local Environment information:

Environment Information:

"auto" version: v10.22.0
"git"  version: v2.31.0
"node" version: v12.18.1

Project Information:

✔ Repository:      angeliski/gem-auto-release
✔ Author Name:     Rogerio Angeliski
✔ Author Email:    rogerio.angeliski@resultadosdigitais.com.br
✔ Current Version: v0.2.0
✔ Latest Release:  v0.2.0

✔ Labels configured on GitHub project 

GitHub Token Information:

✔ Token:            [Token starting with 02e4]
✔ Repo Permission:  admin
✔ User:             angeliski
✔ API:              
✔ Enabled Scopes:   admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages
✔ Rate Limit:       4641/5000

Found the following plugins in your .autorc:

- gem (/snapshot/auto/plugins/gem)
- all-contributors (/snapshot/auto/plugins/all-contributors)
- conventional-commits (/snapshot/auto/plugins/conventional-commits)
- first-time-contributor (/snapshot/auto/plugins/first-time-contributor)
- released (/snapshot/auto/plugins/released)
- ../auto-plugin-gem-canary-release (../auto-plugin-gem-canary-release)

Found the following plugins bundled with your binary:

- all-contributors (/snapshot/auto/plugins/all-contributors)
- brew (/snapshot/auto/plugins/brew)
- chrome (/snapshot/auto/plugins/chrome)
- cocoapods (/snapshot/auto/plugins/cocoapods)
- conventional-commits (/snapshot/auto/plugins/conventional-commits)
- crates (/snapshot/auto/plugins/crates)
- docker (/snapshot/auto/plugins/docker)
- exec (/snapshot/auto/plugins/exec)
- first-time-contributor (/snapshot/auto/plugins/first-time-contributor)
- gem (/snapshot/auto/plugins/gem)
- gh-pages (/snapshot/auto/plugins/gh-pages)
- git-tag (/snapshot/auto/plugins/git-tag)
- gradle (/snapshot/auto/plugins/gradle)
- jira (/snapshot/auto/plugins/jira)
- magic-zero (/snapshot/auto/plugins/magic-zero)
- maven (/snapshot/auto/plugins/maven)
- microsoft-teams (/snapshot/auto/plugins/microsoft-teams)
- npm (/snapshot/auto/plugins/npm)
- omit-commits (/snapshot/auto/plugins/omit-commits)
- omit-release-notes (/snapshot/auto/plugins/omit-release-notes)
- pr-body-labels (/snapshot/auto/plugins/pr-body-labels)
- released (/snapshot/auto/plugins/released)
- slack (/snapshot/auto/plugins/slack)
- twitter (/snapshot/auto/plugins/twitter)
- upload-assets (/snapshot/auto/plugins/upload-assets)
- vscode (/snapshot/auto/plugins/vscode)

●  note      There might be other plugins available as files on your machine. This flag can only list plugins from your .autorc or plugins managed with "npm".

Additional context

I am using the Non-npm approach.

@angeliski angeliski added the bug Something isn't working label Mar 26, 2021
@hipstersmoothie
Copy link
Collaborator

The first problem with your custom auto plugin is that it isn't published anywhere. So when building on CI it never installs the plugin so it can't use it. To fix this you could publish your plugin to npm, install it globally, and then auto should be able to pick it up.


For that second approach it should have worked. I can mess around with that.


While this does seems like an issue with auto right now I think the better approach would be to add this functionality directly to the auto gem plugin. Do you think your approach is generally applicable to all gems? Or is this canary workflow more bespoke and only suited to your workflow?

If it's the former I would happily accept this as a contribution!

@angeliski
Copy link
Contributor Author

Hey @hipstersmoothie My package is published here: https://www.npmjs.com/package/auto-plugin-gem-canary-release
So I didn't know why doesn't work. 😢

About the contribution to the gem plugin, I think maybe that makes sense to the flow, but I didn't make that in the official plugin because I use a custom gem for some features, so maybe that is a bad requirement for the official plugin. But I will try to create a better approach for that and make a PR for the main repository :)

@angeliski
Copy link
Contributor Author

@hipstersmoothie I found the problem when using the global package. Is required to provide the correct value for NODE_PATH
I found here some ways: https://stackfame.com/nodejs-require-global-node-modules

Maybe we could add that in the docs?
I created the #1916 but I will try to discover why the folder approach doesn't work

@adierkens
Copy link
Collaborator

🚀 Issue was released in v10.24.1 🚀

@adierkens adierkens added the released This issue/pull request has been released. label Mar 30, 2021
@hipstersmoothie
Copy link
Collaborator

@angeliski I think that release should have fixed it. Could you test it out?

@angeliski
Copy link
Contributor Author

@hipstersmoothie The global approach works fine, but how about the folder way? In some cases we prefer to use a repository over a published package, could you look at that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants