Skip to content

Commit

Permalink
[#359] Return repo store type when getting a PR repository and number
Browse files Browse the repository at this point in the history
  • Loading branch information
antlu authored and zipofar committed Feb 2, 2023
1 parent 151cc25 commit 49921a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/app/services/uffizzi_core/deployment_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def build_subdomain(deployment)
end

def build_pull_request_subdomain(deployment)
repo_name, pull_request_number = pull_request_data(deployment)
_, repo_name, pull_request_number = pull_request_data(deployment)
raise UffizziCore::Deployment::LabelsNotFoundError if repo_name.nil? || pull_request_number.nil?

formatted_repo_name = format_url_safe(repo_name.split('/').last.downcase)
Expand Down Expand Up @@ -307,13 +307,13 @@ def pull_request_data(deployment)
def github_pull_request_data(deployment)
github_data = deployment.metadata.dig('labels', 'github')

[github_data['repository'], github_data.dig('event', 'number')]
[:github, github_data['repository'], github_data.dig('event', 'number')]
end

def gitlab_merge_request_data(deployment)
gitlab_data = deployment.metadata.dig('labels', 'gitlab')

[gitlab_data['repo'], gitlab_data.dig('merge_request', 'number')]
[:gitlab, gitlab_data['repo'], gitlab_data.dig('merge_request', 'number')]
end

def format_url_safe(name)
Expand Down

0 comments on commit 49921a3

Please sign in to comment.