-
Notifications
You must be signed in to change notification settings - Fork 409
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
Distribute as Composer package #791
Comments
Would it be possible to have that in an extra repo as not to clutter the main repo any further? |
@martin-schulze-vireso Please note that other libraries, such as Bootstrap (which is not a PHP library), provide |
I'm not against adding this if it helps. Though I would like to add a few additional notes of clarification. Firstly, when I originally added the package.json manifest to my own bats plugins, it was not as a means of distribution. Bats was (and is) installable by simple git-cloning. Or curl-ing the release tarballs. In fact, I believe it was years before I started publishing those plugins to the npm registry. The initial addition of package.json was solely to simplify our own CI setup and local testing workflows. I don't recall when package.json was added to bats-core itself, but I wouldn't be surprised if its initial addition was for similar reasons.
Reiterating, node and npm are absolutely not required to install or use bats. git-clone or curl the release tarballs as is common with shell utilities. Or install with homebrew on mac or linux. Or dockerhub. These and other installation mechanisms are documented. But really I want to push back a little (gently) on this:
It's not only a single file. For it to be installable by composer, we would also need to publish it to some registry, no? Which means (probably trivial, but non-zero) effort for setting up and configuring CI to publish to an additional endpoint. Which also brings with it security implications for having publish tokens/credentials managed securely. But sure, some package managers don't require the package to be published; they can install directly from a git repo. So there's even more: adding And then follow the requests for a cargo.toml, a .gemspec, a maven manifest et. al. To be clear, we do have to draw the line somewhere. This is a Bash testing tool. It is installable with the common utilities in a shell environment. But I also agree that, among the many and varied language platforms that are in widespread use, the ecosystems that likely have a lot of shell scripts in need of testing is likely php, node and ruby. So I would personally not be against adding composer.json. But then again, I haven't been an active maintainer for some time, so I would defer to those whose time is actually invested in the subsequent support. |
Packagist.org is a registry for Composer. It auto-syncs with GitHub repo. Setup is as simple as providing a URL of GitHub. No further maintenance required. Installing from GitHub via Curl is not simple - it is not possible to lock to a version easily. Package managers handle that. I use bats in 20+ projects and using a package manager is a huge benefit. It’s just that it is currently only NPM and non-js projects have to have it installed. If bash to have own package manager - this issue would not exist in principle. But because it doesn’t exist - we have to use package managers from different languages to fill the void. |
Nice! Does packagist somehow derive the version from the git tag? (I assume composer requires a version number in its manifest which will need to be accounted for in the release automation.)
Fancy construction is straightforward with the gh cli and gh api, if something other than pinned downloads is required. (Though, since bats isn't a library and doesn't have any transitive deps, it doesn't have the same dependency-resolution needs as a typical lib dep; so that is likely unnecessary for most use cases.) I think if there is a next step here, it is to open a PR with the necessary composer.json file and automation changes necessary that will bump the version in composer.json on release. |
Yes. Everything automated. Re CURL. I'm not arguing that it is not possible or hard. I'm saying that if Composer already used as a package distribution method for other packages, it would be easier to add BATS through composer. Hence this issues.
This is not required. From https://packagist.org/about:
I'm happy to provide Thank you |
Is your feature request related to a problem? Please describe.
Bats-core can currently be downloaded using a NodeJS package manager. It would be great if we can let it be downloaded by the Composer PHP package manager.
Describe the solution you'd like
Add
composer.json
, similar topackage.json
, and submit it to Packagist.orgDescribe alternatives you've considered
N/A
Additional context
In PHP projects that may have some scripts, the only way to get Bats installed for testing is through NodeJS package manager, but it may not be available in the PHP environment.
The text was updated successfully, but these errors were encountered: