Skip to content

Commit bce9323

Browse files
committed
Change to minimal license enforcement
* This removes the license gem enitrely. * Specifies the user to declare his compliance with either opensource or commercial usage.
1 parent b824f87 commit bce9323

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+722
-1666
lines changed

Diff for: Changelog.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# v0.12.0 [unreleased]
2+
3+
Drop the license gem, entirely. This reduces DRM in mutants code base to the absolute minimal.
4+
Mutant is *still* comercial software that requires payment if used on a commercial code base!
5+
6+
Migration:
7+
8+
* Commercial users: Add `usage: commercial` to your config file (or `--usage commercial` to your CLI)
9+
* Opensource users: Add `usage: opensource` to your config file (or `--usage opensource` to your CLI)
10+
111
# v0.11.34 2024-03-26
212

313
* [#1432](https://github.com/mbj/mutant/pull/1432)

Diff for: Gemfile.lock

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
PATH
22
remote: .
33
specs:
4-
mutant (0.11.34)
4+
mutant (0.12.0)
55
diff-lcs (~> 1.3)
66
parser (~> 3.3.0)
77
regexp_parser (~> 2.9.0)
88
sorbet-runtime (~> 0.5.0)
99
unparser (~> 0.6.9)
1010

11-
GEM
12-
remote: https://oss:[email protected]/
13-
specs:
14-
mutant-license (0.1.1.2.2355046999240944981729280251890364410689.5)
15-
1611
GEM
1712
remote: https://rubygems.org/
1813
specs:
@@ -69,7 +64,6 @@ PLATFORMS
6964

7065
DEPENDENCIES
7166
mutant!
72-
mutant-license!
7367
rspec (~> 3.10)
7468
rspec-core (~> 3.10)
7569
rspec-its (~> 1.3.0)

Diff for: Gemfile.shared

-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
# Mutant itself uses an opensource license key.
2-
# Scoped to https://github.com/mbj/mutant it'll
3-
# not be useful elsewhere.
4-
source 'https://oss:[email protected]' do
5-
gem 'mutant-license'
6-
end

Diff for: README.md

+17-43
Original file line numberDiff line numberDiff line change
@@ -77,54 +77,27 @@ Labels:
7777

7878
## Licensing
7979

80-
Mutant is commercial software, with a free usage plan for opensource projects.
80+
Mutant is commercial software, with a free usage option for opensource projects.
81+
Opensource projects have to be on a public repository.
8182

82-
Commercial projects have to acquire a license per developer, with unlimited repositories
83-
per developer. CI usage for licensed developers is included.
83+
Commercial projects have to pay a monthly or annual subscription fee.
8484

85-
Opensource projects have to acquire their free license per repository. That license will
86-
work for any contributor implicitly. Typically the project maintainer gets the license.
85+
## Opensource usage
8786

88-
The license distribution happens through the `mutant-license` gem. Mutant installs without
89-
that dependency, but will not be very cooperative unless `mutant-license` is also available.
87+
Usage is free and does not require a signup. But it requires the code is under an
88+
opensource license and public. Specify `--usage opensource` on the CLI or `usage: opensource`
89+
in the config file.
9090

91-
The license gem is dynamically generated per licensee and comes with a unique license gem source
92-
URL.
91+
## Commercial usage
9392

94-
After signup for a license the following has to be added to your `Gemfile` replacing `${key}`
95-
with the license key and `${plan}` with `com` for commercial or `oss` for opensource usage.
93+
Commercial use requires payment via a subscription and requires a signup. See [pricing](#pricing) for
94+
available plans.
9695

97-
```ruby
98-
source 'https://${plan}:${key}@gem.mutant.dev' do
99-
gem 'mutant-license'
100-
end
101-
```
102-
103-
The mutant license gem contains metadata that allows mutant to verify licensed use.
104-
105-
For commercial licenses mutant checks the git commit author or the configured git email
106-
to be in the set of licensed developers.
107-
108-
For opensource licenses mutant checks the git remotes against the licensed git repositories.
109-
This allows the project maintainer to sign up and not bother collaborators with the details.
110-
111-
There are, apart from initial license gem installation, no remote interaction for
112-
license validation.
113-
114-
### Getting an Opensource license
115-
116-
As stated above: Opensource projects of any kind are free to use mutant.
117-
118-
Just mail [me](mailto:[email protected]?subject=Mutant%20Opensource%20License): Please
119-
include:
120-
121-
* Just the git remote URL of your repository. Repository can be anywhere, must not be on Github, just has to be public.
122-
123-
I do not need any more details.
96+
After payment pecify `--usage commercial` on the CLI or `usage: commercial` in the config file.
12497

12598
### Pricing
12699

127-
**Mutant is free for [opensource use](#getting-an-opensource-license)!**
100+
**Mutant is free for [opensource use](#opensource-usage)!**
128101

129102
For commercial use mutants pricing is subscription based.
130103

@@ -137,18 +110,19 @@ For commercial use mutants pricing is subscription based.
137110

138111
Costs are **per developer using mutant on any number of repositories**.
139112

140-
Volume licenses with custom plans are available on request.
113+
Volume subscriptions with custom plans are available on request.
141114

142-
Should you want to procure a commercial mutant subscription please [mail me](mailto:[email protected]?subject=Mutant%20Commercial%20License).
115+
Should you want to procure a commercial mutant subscription please
116+
[mail me](mailto:[email protected]?subject=Mutant%20Commercial%20License) to start the payment
117+
process.
143118

144119
Please include the following information:
145120

146121
* Your business invoice address.
147122
* A payment email address, if different from your email address.
148123
* Only for the EU: A valid VAT-ID is *required*, no sales to private customers to avoid the
149124
horrors cross border VAT / MOSS.
150-
VAT for customers outside of Malta will use **reverse charging**.
151-
* *Per developer* the git author email address as returned by `git config user.email`
125+
VAT for EU customers outside of Malta will use **reverse charging**.
152126

153127
Also feel free to ask any other question I forgot to proactively answer here.
154128

Diff for: docs/commercial.md

+18-41
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Is there a trial version?
66

77
There is no free trial.
88

9-
But mutant offers to refund the last monthly
10-
payment on cancellation. Basically a rolling trial on monthly plans.
9+
But mutant offers to refund the last monthly payment on cancellation.
10+
Basically a rolling trial on monthly plans.
1111

1212
Yearly and custom plans do not offer any refunds but come with discounts.
1313

@@ -35,17 +35,14 @@ This per subscription is valid for any number of private repositories.
3535

3636
Depending on your plan subscriptions renew monthly or yearly.
3737

38-
After purchase you get access to a custom rubygem hosted on mutants license
39-
server that enables mutants functionality in commercial repositories.
40-
38+
After purchase you setup the commercial usage type in mutant
39+
and are ready to go.
4140

4241
How do I determine the number of required subscriptions?
4342
--------------------------------------------------------
4443

4544
Collect the git author email from each of your developers that need to use mutant.
46-
Use `git config --get user.email`. Count that list.
47-
48-
Mutant on CI will work on any commit authored by a developer in that list.
45+
Use `git config --get user.email`. Count that list.
4946

5047
So a designer, who contributes to your repository, but never touches Ruby/Mutant:
5148
Will not be forced to get a mutant subscription.
@@ -54,35 +51,12 @@ What happens if my subsription lapses?
5451
--------------------------------------
5552

5653
If your credit card cannot be charged, even after retries: The subscription will be
57-
considered inactive and you loose access to mutants license gem. Which prevents `bundle install`
58-
and adjacent commands to succeed.
54+
considered inactive and you loose the right to run mutant.
5955

6056
**Please note that pricing can chance**. Once you purchase a subscription, you get that price
6157
forever **as long you pay on time**. If your subscription expires for a non-payment, you will lose
6258
that pricing and need to repurchase at current pricing.
6359

64-
What does the license require me to do?
65-
---------------------------------------
66-
67-
Your purchase gets you unique access credentials for accessing the license gem which enables
68-
mutant on a private repository. The license requires you to keep these access credentials private.
69-
70-
If your access credentials are ever found to be publicized:
71-
72-
1. You get a warning email with details. You need to remove the content and
73-
will get new new credentials being generated.
74-
The old credentials will stop working immediately so you'll need to update your
75-
`Gemfile`.
76-
2. If your credentials are publicized a second time, we reserve the right to permanently
77-
remove access (but won't unless it's really egregious - sloppy contractors happen).
78-
79-
Do I have to share the credentials with all of my developers?
80-
-------------------------------------------------------------
81-
82-
In general yes. The intention is that the license details gets checked into the
83-
`Gemfile`. This only gives access to mutants funcionality, your billing account is
84-
separate and individuall developers cannot update the subscription.
85-
8660
Can I get a refund?
8761
-------------------
8862

@@ -98,7 +72,6 @@ Can I request a change to the license terms?
9872
--------------------------------------------
9973

10074
Mutant is sold as is. Pricing becomes negotiatable over 20 developers.
101-
10275
License terms may be amended for even bigger customers.
10376

10477
Disputing a Charge
@@ -133,15 +106,8 @@ Schirp DSO LTD only collects enough customer information provide its services wh
133106
* Per developer: The developers git author emaill address.
134107
* Standard HTTP logging for the license server with 14d expiry.
135108

136-
Mutant runs exclusively on your developers machines. Or your CI. The only time mutant
137-
calls a service operated by Schirp DSO LTD: Is on `bundle install`. Where `bundler` sends a
138-
HTTP request with your license key to the license server.
139-
140-
BTW: As mutant does NOT control the HTTP call side (bundler does instead) there cannot be any
141-
information leak being caused by mutant. Apart from HTTP logs at the license server.
109+
Mutant runs exclusively on your developers machines. Or your CI.
142110

143-
At no point in time Schirp DSO LTD gets access to your source code, your customers data
144-
or other sensitive material.
145111

146112
Should mutant gain more features that would enable features such as distributed
147113
analysis and reporting, these features will be opt in, with a big warning.
@@ -153,3 +119,14 @@ Customer information is never shared or sold to anyone.
153119
* Stripe for subscription, credit card and SEPA direct debits.
154120
* Transferwise for receiving SEPA and ACH transfers.
155121
* AWS to host the license server.
122+
123+
At no point in time Schirp DSO LTD gets access to your source code, your customers data
124+
or other sensitive material.
125+
126+
### Pre mutant 0.12 license gem.
127+
128+
The only time mutant calls a service operated by Schirp DSO LTD: Is on `bundle install`.
129+
Where `bundler` sends a HTTP request with your license key to the license server.
130+
131+
BTW: As mutant does NOT control the HTTP call side (bundler does instead) there cannot be any
132+
information leak being caused by mutant. Apart from HTTP logs at the license server.

Diff for: docs/mutant-minitest.md

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ This prints a report like:
6565

6666
```sh
6767
Mutant environment:
68+
Usage: opensource
6869
Matcher: #<Mutant::Matcher::Config subjects: [AUOM*]>
6970
Integration: Mutant::Integration::Minitest
7071
Jobs: 8

Diff for: docs/mutant-rspec.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ This prints a report like:
3838

3939
```sh
4040
Mutant environment:
41+
Usage: opensource
4142
Matcher: #<Mutant::Matcher::Config subjects: [AUOM*]>
4243
Integration: Mutant::Integration::Rspec
4344
Jobs: 8

Diff for: lib/mutant.rb

+3-7
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ module Mutant
109109
require 'mutant/require_highjack'
110110
require 'mutant/mutation'
111111
require 'mutant/mutation/operators'
112+
require 'mutant/usage'
112113
require 'mutant/mutation/config'
113114
require 'mutant/mutator'
114115
require 'mutant/mutator/util'
@@ -221,7 +222,6 @@ module Mutant
221222
require 'mutant/config/coverage_criteria'
222223
require 'mutant/cli'
223224
require 'mutant/cli/command'
224-
require 'mutant/cli/command/subscription'
225225
require 'mutant/cli/command/environment'
226226
require 'mutant/cli/command/environment/irb'
227227
require 'mutant/cli/command/environment/run'
@@ -255,11 +255,6 @@ module Mutant
255255
require 'mutant/repository/diff/ranges'
256256
require 'mutant/zombifier'
257257
require 'mutant/range'
258-
require 'mutant/license'
259-
require 'mutant/license/subscription'
260-
require 'mutant/license/subscription/commercial'
261-
require 'mutant/license/subscription/opensource'
262-
require 'mutant/license/subscription/repository'
263258
require 'mutant/segment'
264259
require 'mutant/segment/recorder'
265260
end
@@ -363,7 +358,8 @@ class Config
363358
matcher: Matcher::Config::DEFAULT,
364359
mutation: Mutation::Config::EMPTY,
365360
reporter: Reporter::CLI.build(WORLD.stdout),
366-
requires: EMPTY_ARRAY
361+
requires: EMPTY_ARRAY,
362+
usage: Usage::Unknown.new
367363
)
368364
end # Config
369365

Diff for: lib/mutant/cli/command.rb

+1-9
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def banner
122122

123123
def parse(arguments)
124124
Either
125-
.wrap_error(OptionParser::InvalidOption) { parser.order(arguments) }
125+
.wrap_error(OptionParser::InvalidArgument, OptionParser::InvalidOption) { parser.order(arguments) }
126126
.lmap(&method(:with_help))
127127
.bind(&method(:parse_remaining))
128128
end
@@ -176,14 +176,6 @@ def parse_remaining(remaining)
176176
end
177177
end
178178

179-
def parse_remaining_arguments(remaining)
180-
if remaining.any?
181-
Either::Left.new("#{full_name}: Does not expect extra arguments")
182-
else
183-
Either::Right.new(self)
184-
end
185-
end
186-
187179
def parse_subcommand(arguments)
188180
command_name, *arguments = arguments
189181

Diff for: lib/mutant/cli/command/environment.rb

+15
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Environment < self
1515
add_integration_options
1616
add_matcher_options
1717
add_reporter_options
18+
add_usage_options
1819
].freeze
1920

2021
private
@@ -136,6 +137,20 @@ def add_reporter_options(parser)
136137
set(reporter: @config.reporter.with(print_warnings: true))
137138
end
138139
end
140+
141+
def add_usage_options(parser)
142+
parser.separator('Usage:')
143+
144+
parser.accept(Usage, Usage::CLI_REGEXP) do |value|
145+
Usage.parse(value).from_right
146+
end
147+
148+
parser.on(
149+
'--usage USAGE_TYPE',
150+
Usage,
151+
'License usage: opensource|commercial'
152+
) { |usage| set(usage: usage) }
153+
end
139154
end # Run
140155
# rubocop:enable Metrics/ClassLength
141156
end # Command

Diff for: lib/mutant/cli/command/environment/run.rb

+6-9
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ class Run < self
99
SHORT_DESCRIPTION = 'Run code analysis'
1010
SUBCOMMANDS = EMPTY_ARRAY
1111

12-
UNLICENSED = <<~MESSAGE.lines.freeze
13-
You are using mutant unlicensed.
14-
15-
See https://github.com/mbj/mutant#licensing to aquire a license.
16-
Note: Its free for opensource use, which is recommended for trials.
17-
MESSAGE
18-
1912
NO_TESTS_MESSAGE = <<~'MESSAGE'
2013
===============
2114
Mutant found no tests available for mutation testing.
@@ -34,8 +27,8 @@ class Run < self
3427
private
3528

3629
def action
37-
License.call(world)
38-
.bind { bootstrap }
30+
bootstrap
31+
.bind(&method(:verify_usage))
3932
.bind(&method(:validate_tests))
4033
.bind(&Mutation::Runner.public_method(:call))
4134
.bind(&method(:from_result))
@@ -56,6 +49,10 @@ def from_result(result)
5649
Either::Left.new('Uncovered mutations detected, exiting nonzero!')
5750
end
5851
end
52+
53+
def verify_usage(environment)
54+
environment.config.usage.verify.fmap { environment }
55+
end
5956
end # Run
6057
end # Environment
6158
end # Command

0 commit comments

Comments
 (0)