1
0
Fork 0

Fix fallback more in choose_projects

When a path can't be mapped, we fallback to a "all" project.
This was broken by the recent changes to be more selective on the
testing.
This commit is contained in:
Mehdi Amini 2021-09-28 17:49:52 +00:00 committed by Mikhail Goncharov
parent 4ec28b0bf7
commit 30be93ac21

View file

@ -71,6 +71,9 @@ class ChooseProjects:
targets = set() targets = set()
all_projects = self.config['allprojects'] all_projects = self.config['allprojects']
for project in affected_projects: for project in affected_projects:
if project == "all":
targets = set(["check-all"])
return targets
targets.update(set(all_projects[project])) targets.update(set(all_projects[project]))
return targets return targets
@ -90,14 +93,14 @@ class ChooseProjects:
llvm_dir = os.path.abspath(os.path.expanduser(self.llvm_dir)) llvm_dir = os.path.abspath(os.path.expanduser(self.llvm_dir))
logging.info('Scanning LLVM in {}'.format(llvm_dir)) logging.info('Scanning LLVM in {}'.format(llvm_dir))
if not self.match_projects_dirs(): if not self.match_projects_dirs():
return self.FALLBACK_PROJECTS return self.FALLBACK_PROJECTS, set()
changed_files = self.get_changed_files(patch) changed_files = self.get_changed_files(patch)
changed_projects, unmapped_changes = self.get_changed_projects(changed_files) changed_projects, unmapped_changes = self.get_changed_projects(changed_files)
if unmapped_changes: if unmapped_changes:
logging.warning('There were changes that could not be mapped to a project.' logging.warning('There were changes that could not be mapped to a project.'
'Building all projects instead!') 'Building all projects instead!')
return self.FALLBACK_PROJECTS return self.FALLBACK_PROJECTS, set()
return self.extend_projects(changed_projects, current_os) return self.extend_projects(changed_projects, current_os)
def extend_projects(self, projects: Set[str], current_os : str = None) -> List[str]: def extend_projects(self, projects: Set[str], current_os : str = None) -> List[str]: