Skip to content

Commit

Permalink
feat: remove disable_use_branch_heads_for_latest_branch_pacts feature…
Browse files Browse the repository at this point in the history
… toggle
  • Loading branch information
bethesque committed May 12, 2022
1 parent add6cb0 commit 5c6f176
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
7 changes: 1 addition & 6 deletions lib/pact_broker/pacts/pact_publication_dataset_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ def for_branch_heads(branch_name)
end

def latest_for_consumer_branch(branch_name)
# Keep this flag for a little whle in case we need to disable the new logic
if PactBroker.feature_enabled?(:disable_use_branch_heads_for_latest_branch_pacts, true)
old_latest_for_consumer_branch(branch_name)
else
for_branch_heads(branch_name)
end
for_branch_heads(branch_name)
end

def old_latest_for_consumer_branch(branch_name)
Expand Down
11 changes: 0 additions & 11 deletions spec/lib/pact_broker/pacts/pact_publication_dataset_module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,6 @@ module Pacts
all = subject.all_allowing_lazy_load
expect(all.size).to eq 1
end

context "when the new logic is disabled" do
before do
allow(PactBroker). to receive(:feature_enabled?).with(:disable_use_branch_heads_for_latest_branch_pacts, true).and_return(true)
end

it "does return a pact for the branch" do
all = subject.all_allowing_lazy_load
expect(all.size).to eq 2
end
end
end

context "when columns are already selected" do
Expand Down

0 comments on commit 5c6f176

Please sign in to comment.