opencollective / opencollective-cli

Command Line Interface for Open Collective
MIT License
17 stars 12 forks source link

Opt Out #7

Closed mlucool closed 5 years ago

mlucool commented 6 years ago

As opencollective is more widely used, it has created an ethical dilemma. Inspiring people to donate to opensource and help grow their favorite projects is a good thing, but this is being used in ways which cause negative externalities including:

  1. The postinstall step is now crowding my npm install with advertisements. The more this is used, the less I am able to quickly see what is wrong with my install
  2. This adds at least 4mb to every install and >150 files (depending on deduping)
  3. CI now has ads in it, which mean writing scripts to parse it must take this into account

I am opening this thread in hope of finding a meaningful way balance encouraging people to donate and not causing them more pain to use great open source software.

I have proposed a NODE_NO_SUPPORT_MESSAGE=true (needs a better name) when seeing projects do this via node -e as well (https://github.com/remy/nodemon/issues/1299). In addition, maybe libraries should make use of optionalDependencies instead of dependencies for this tool (example). Any method to allow for opt out would be greatly appreciated.

Again, I want to be clear that I think using economics to motivate and fund OSS is a worthwhile idea, but we should be careful about creating pain along the way.

mlucool commented 6 years ago

Linking the same idea in a different package: https://github.com/opencollective/opencollective-postinstall/issues/8

ckknight commented 6 years ago

The extra dependencies this adds (which are incompatible with other dependency versions) leaves an extremely bad taste in my mouth about this project.

ckknight commented 6 years ago

I have made a project that ostensibly allows one to "opt out": https://github.com/ckknight/opencollective-cli

xdamman commented 6 years ago

Thank you all for chiming here and offering solutions. Sorry about the trouble this has caused. So many edge cases.

We just published a very lightweight version that doesn't have any dependency: https://github.com/opencollective/opencollective-postinstall

Just replace in your package.json the opencollective dependency with opencollective-postinstall and in scripts.postinstall section, replace opencollective postinstall with opencollective-postinstall

Let us know your thoughts and pull requests welcome!

mlucool commented 6 years ago

This is a big step forward, especially since it no longer needs to connect home for stats. Still, I don't see how this fixes the ability to opt out or the fact this shown is once per thing that wants to advertise per install (instead of maybe one message that shows every link only at a given frequency).

xdamman commented 6 years ago

Given that's it's just two lines in the log, is that really such a big issue? It would be much more complicated to record whether the user has already seen it (and I'd argue not worth it as it adds quite some complexity that could break on different environments as we've learned).

One improvement I could see is to not show it in CI environment. Want to take a stab at it?

mlucool commented 6 years ago

@xdamman What do you think about https://github.com/opencollective/opencollective-postinstall/pull/9?

Omeryl commented 6 years ago

@xdamman This isn't two lines?

> opencollective postinstall

                                     .,:;;:,.
                                 ..:;;;rrrrr;;:,.
                             ..:;;rrrrrrrrrrrrrr;;:,.
                         .,:;;rrrrrrrrrsiisrrrrrrrrr;;:,.
                         :issrrrrrrsiiSSSSSSiisrrrrrrssi;
                         ;SiiiiiiSSSSSSSSSSSSSSSSiiiSiiS;
                         ;SS5222222255SSSSSS55222222255S;
                         ;222222222222225522222222222222r
                         ;222222222222222222222222222222r
                         ;222222222222222222222222222222r
                         ;222222222222222222222222222222r
                         ;S22222222222222222222222222225r
                         ,rrsi5222222222222222222225isrr:
                         ,;;;;rrsi52222222222225Ssrr;;;;:
                         ,;;;;;;;;rrsi522225Ssrr;;;;;;;;:
                         .::;;;;;;;;;;rrssrr;;;;;;;;;;::,
                          ..,,::;;;;;;;;;;;;;;;;;;::,,..
                              ..,,::;;;;;;;;;;::,,..
                                  ..,,::;;::,,..
                                      ..,,,.

                          Thanks for installing level 🙏
                 Please consider donating to our open collective
                        to help us maintain this package.

                            Number of contributors: 40
                               Number of backers: 5
                              Annual budget: US$ 216
                             Current balance: US$ 200

           👉  Donate: https://opencollective.com/level/donate
eddiemonge commented 5 years ago

At least obey npm's loglevel

if (["silent", "error", "warn"].indexOf(process.env.npm_config_loglevel) < 0) {
  showPostInstall();
}
znarf commented 5 years ago

We recommend everyone to use thew new lightweight postinstall: https://github.com/opencollective/opencollective-postinstall

It does feature "Opt Out" when CI or DISABLE_OPENCOLLECTIVE is set.