Skip to content

Commit

Permalink
chore: disable branch updating validation
Browse files Browse the repository at this point in the history
It's causing our builds to fail. Need to update the version -> branch relationship.
  • Loading branch information
bethesque committed Apr 6, 2021
1 parent 1bbdfb9 commit 2fc2f31
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
25 changes: 14 additions & 11 deletions lib/pact_broker/versions/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ class Service
extend PactBroker::Repositories

def self.conflict_errors(existing_version, open_struct_version, version_url)
if existing_version&.branch && open_struct_version.to_h.key?(:branch) && existing_version.branch != open_struct_version.branch
message_params = {
old_branch: existing_version&.branch,
new_branch: open_struct_version.branch,
version_url: version_url
}
error_message = message("errors.validation.cannot_modify_version_branch", message_params)
{ branch: [error_message] }
else
{}
end
# This validation is causing problems in the PF build when branches are merged
# TODO remove this properly when re-doing the version -> branch relationship
{}
# if existing_version&.branch && open_struct_version.to_h.key?(:branch) && existing_version.branch != open_struct_version.branch
# message_params = {
# old_branch: existing_version&.branch,
# new_branch: open_struct_version.branch,
# version_url: version_url
# }
# error_message = message("errors.validation.cannot_modify_version_branch", message_params)
# { branch: [error_message] }
# else
# {}
# end
end

def self.find_latest_by_pacticpant_name params
Expand Down
6 changes: 3 additions & 3 deletions spec/features/update_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
its(:status) { is_expected.to eq 200 }
end

context "when the existing version has a branch, and the new branch is different" do
context "when the existing version has a branch, and the new branch is different", skip: true do
let(:version_hash) { { branch: "new-branch" } }

its(:status) { is_expected.to eq 409 }
Expand All @@ -48,7 +48,7 @@
end
end

context "when the existing version has a branch, and the new branch is nil" do
context "when the existing version has a branch, and the new branch is nil", skip: true do
let(:version_hash) { { branch: nil } }

its(:status) { is_expected.to eq 409 }
Expand Down Expand Up @@ -117,7 +117,7 @@
.create_consumer_version_tag("dev")
end

context "when the branch is attempted to be changed" do
context "when the branch is attempted to be changed", skip: true do
let(:version_hash) { { branch: "new-branch" } }

its(:status) { is_expected.to eq 409 }
Expand Down

0 comments on commit 2fc2f31

Please sign in to comment.