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

formula_auditor: audit all relicensed HashiCorp formulae #15982

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions Library/Homebrew/formula_auditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,28 @@
"They must not be upgraded to version 7.11 or newer."
end

TERRAFORM_RELICENSED_VERSION = "1.6"
# https://www.hashicorp.com/license-faq#products-covered-by-bsl
HASHICORP_RELICENSED_FORMULAE_VERSIONS = {
"terraform" => "1.6",
"packer" => "1.10",
"vault" => "1.15",
"boundary" => "0.14",
"consul" => "1.17",
"nomad" => "1.7",
"waypoint" => "0.12",
"vagrant" => "2.4",
"vagrant-compleion" => "2.4",
}.freeze

def audit_terraform
return if formula.name != "terraform"
def audit_hashicorp_formulae
return unless HASHICORP_RELICENSED_FORMULAE_VERSIONS.key? formula.name
return unless @core_tap
return if formula.version < Version.new(TERRAFORM_RELICENSED_VERSION)

problem "Terraform was relicensed to a non-open-source license from version 1.6. " \
"It must not be upgraded to version 1.6 or newer."
relicensed_version = Version.new(HASHICORP_RELICENSED_FORMULAE_VERSIONS[formula.name])

Check warning on line 517 in Library/Homebrew/formula_auditor.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/formula_auditor.rb#L517

Added line #L517 was not covered by tests
return if formula.version < relicensed_version

problem "#{formula.name} was relicensed to a non-open-source license from version #{relicensed_version}. " \

Check warning on line 520 in Library/Homebrew/formula_auditor.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/formula_auditor.rb#L520

Added line #L520 was not covered by tests
"It must not be upgraded to version #{relicensed_version} or newer."
end

def audit_keg_only_reason
Expand Down