Skip to content

Commit

Permalink
Switch allow_remote_projects default
Browse files Browse the repository at this point in the history
There is only one place in the app where we look at
remote project links. All the others turned it off, let's
make this the default.
  • Loading branch information
hennevogel committed Oct 23, 2023
1 parent a300e72 commit aab43da
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/api/app/models/concerns/project_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def validate_link_xml_attribute(request_data, project_name)
end

def expand_linking_to
expand_all_projects(allow_remote_projects: false).map(&:id)
expand_all_projects.map(&:id)
end

def expand_all_projects(project_map: {}, allow_remote_projects: true)
def expand_all_projects(project_map: {}, allow_remote_projects: false)
# cycle check
return [] if project_map[self]

Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/concerns/project_maintenance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def maintained_project_names
end

def expand_maintained_projects
maintained_projects.collect { |mp| mp.project.expand_all_projects(allow_remote_projects: false) }.flatten
maintained_projects.collect { |mp| mp.project.expand_all_projects }.flatten
end

def is_maintenance_release?
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/owner_search/assignee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def lookup_package_owner(package)
return package_owner if package_owner

# no match, loop about projects below with this package container name
package.project.expand_all_projects(allow_remote_projects: false).each do |project|
package.project.expand_all_projects.each do |project|
project_package = project.packages.find_by_name(package.name)
next if project_package.nil? || @already_checked[project_package.id]

Expand Down Expand Up @@ -114,7 +114,7 @@ def parse_binary_info(binary, project)
end

def find_assignees(binary_name)
projects = @rootproject.expand_all_projects(allow_remote_projects: false)
projects = @rootproject.expand_all_projects

# binary search via all projects
data = Xmlhash.parse(Backend::Api::Search.binary(projects.map(&:name), binary_name))
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/owner_search/missing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def find
owners = []
# search in each marked project
projects_to_look_at.each do |project|
@projects = project.expand_all_projects(allow_remote_projects: false)
@projects = project.expand_all_projects
@roles = filter(project).map { |f| Role.find_by_title!(f) }

(all_packages - defined_packages).each do |p|
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/owner_search/owned.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def for(owner)
# search in each marked project
projects_to_look_at.map do |project|
@roles = filter(project).map { |f| Role.find_by_title!(f) }
@projects = project.expand_all_projects(allow_remote_projects: false)
@projects = project.expand_all_projects
find_projects(project, owner)
find_packages(project, owner)
end
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def self.get_by_project_and_name(project, package, opts = {})
if pkg.nil? && opts[:follow_project_links]
# in case we link to a remote project we need to assume that the
# backend may be able to find it even when we don't have the package local
prj.expand_all_projects.each do |p|
prj.expand_all_projects(allow_remote_projects: true).each do |p|
return nil unless p.is_a?(Project)
end
end
Expand Down

0 comments on commit aab43da

Please sign in to comment.