Skip to content

Commit

Permalink
chore: update deployed and released version policy methods [pf]
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed May 17, 2022
1 parent 21bd33c commit d5f565a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
10 changes: 8 additions & 2 deletions lib/pact_broker/api/resources/deployed_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ def from_merge_patch_json
end

def policy_name
:'versions::version'
:'versions::deployed_version'
end

def policy_record_context
{
pacticipant: deployed_version&.pacticipant
}
end

def policy_record
deployed_version&.version
deployed_version&.environment
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ def to_json
end

def policy_name
:'versions::deployed_version'
end

def policy_record
environment
:'versions::deployed_versions'
end

private
Expand Down
10 changes: 8 additions & 2 deletions lib/pact_broker/api/resources/released_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,17 @@ def from_merge_patch_json
end

def policy_name
:'versions::version'
:'versions::released_version'
end

def policy_record_context
{
pacticipant: released_version&.pacticipant
}
end

def policy_record
released_version&.version
released_version&.environment
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def to_json
end

def policy_name
:'versions::released_version'
:'versions::released_versions'
end

def policy_record
Expand Down

0 comments on commit d5f565a

Please sign in to comment.