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

Allow multiple plugins of the same type (e.g. GithubActions CI plugins) #266

Closed
nickrobinson251 opened this issue Feb 3, 2021 · 3 comments · Fixed by #419
Closed

Allow multiple plugins of the same type (e.g. GithubActions CI plugins) #266

nickrobinson251 opened this issue Feb 3, 2021 · 3 comments · Fixed by #419
Labels
new-feature A proposed feature (which is not a new plugin)

Comments

@nickrobinson251
Copy link
Collaborator

nickrobinson251 commented Feb 3, 2021

Currently, if two plugins have the same type, the first plugin is used, see e.g. #265 (comment) Why is that?

My use-case for multipl plugins of the same type is multiple GitHubAction CI plugins, e.g. for when if you want a different CI job for running on the Julia Nightly versions, or something like that. (Noticed at #265)

I think this is implemented at
https://github.com/invenia/PkgTemplates.jl/blob/238bfc11c037f341eff4889e0424a66d1edf7404/src/template.jl#L100
but i don't know why we do that.

I think it might be so that we can use a pattern like

for T in PluginTypes
   p = getplugin(tpl, T)
   ...
end

but i think that only appears one (in the code for view(p::Readme, ...), and we could easily get the desired behaviour (sorting by the type T somehow) by writng the code slightly differently.

Is there any other reason to disallow multiple plugins of the same type?

@christopher-dG
Copy link
Member

The reason is that we want default plugins to get removed if a user provides one of the same type, e.g. a Readme that produces a .txt file. We don't want to produce two READMEs, so we get rid of the first one. It would be fine to change that behaviour so it only removes default plugins and doesn't completely deduplicate the list.

@hannahilea
Copy link
Contributor

Allowing multiple plugins of the same type is also a feature that I'd like---is there a reason that the initial implementation #269 was closed rather than left open for further tests/merging? I'd like to take this on, but don't want to continue down a path that was intentionally abandoned...

@nickrobinson251
Copy link
Collaborator Author

Please do pick this up! #269 was just closed as i didn't have time to finish it and i didn't want it to be left open in case it blocked others working on this issue

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature A proposed feature (which is not a new plugin)
Projects
None yet
3 participants