spl-core 7.11.2__py3-none-any.whl → 7.12.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
spl_core/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "7.11.2"
1
+ __version__ = "7.12.1"
@@ -35,28 +35,57 @@ class CollectPRChanges(PipelineStep):
35
35
  changed_files = self._get_changed_files(ci_context.target_branch, ci_context.current_branch)
36
36
  output_file = self.get_outputs()[0]
37
37
  output_file.parent.mkdir(parents=True, exist_ok=True)
38
- output_file.write_text(json.dumps(
39
- PR_Changes(
40
- ci_system=ci_context.ci_system.name, target_branch=ci_context.target_branch, current_branch=ci_context.current_branch, commit_id=self._get_commit_id(ci_context), changed_files=changed_files
41
- ).to_dict(),
42
- indent=2
43
- ))
38
+ output_file.write_text(
39
+ json.dumps(
40
+ PR_Changes(
41
+ ci_system=ci_context.ci_system.name, target_branch=ci_context.target_branch, current_branch=ci_context.current_branch, commit_id=self._get_commit_id(ci_context), changed_files=changed_files
42
+ ).to_dict(),
43
+ indent=2,
44
+ )
45
+ )
44
46
  logger.info(f"PR changes saved to {output_file}")
45
47
 
46
48
  def _get_changed_files(self, target_branch: str, current_branch: str) -> List[str]:
47
49
  """Get list of changed files in the current branch/PR"""
48
- try:
49
- result = SubprocessExecutor(["git", "fetch", "origin", current_branch]).execute(handle_errors=False)
50
- if result and result.returncode == 0:
51
- result = SubprocessExecutor(["git", "diff", "--name-only", f"origin/{target_branch}...origin/{current_branch}"]).execute(handle_errors=False)
52
-
53
- if result and result.returncode == 0 and result.stdout.strip():
54
- files = [line.strip() for line in result.stdout.strip().split("\n") if line.strip()]
55
- return files
50
+ # Fetch both branches to ensure they exist locally
51
+ logger.info(f"Fetching branches: {target_branch} and {current_branch}")
52
+
53
+ # Fetch the target branch
54
+ result = SubprocessExecutor(["git", "fetch", "origin", target_branch]).execute(handle_errors=False)
55
+ if not result or result.returncode != 0:
56
+ logger.warning(f"Failed to fetch target branch {target_branch}")
57
+ return []
58
+
59
+ # Fetch the current branch
60
+ result = SubprocessExecutor(["git", "fetch", "origin", current_branch]).execute(handle_errors=False)
61
+ if not result or result.returncode != 0:
62
+ logger.warning(f"Failed to fetch current branch {current_branch}")
63
+ return []
64
+
65
+ # Try different git diff approaches in order of preference
66
+ diff_commands = [
67
+ ["git", "diff", "--name-only", f"origin/{target_branch}...origin/{current_branch}"],
68
+ ["git", "diff", "--name-only", f"origin/{target_branch}", f"origin/{current_branch}"],
69
+ ["git", "diff", "--name-only", f"{target_branch}...{current_branch}"],
70
+ ["git", "diff", "--name-only", f"{target_branch}", f"{current_branch}"],
71
+ ]
72
+
73
+ for cmd in diff_commands:
74
+ try:
75
+ logger.info(f"Trying command: {' '.join(cmd)}")
76
+ result = SubprocessExecutor(cmd).execute(handle_errors=False)
56
77
 
57
- except Exception as e:
58
- logger.error(f"Git command failed: {e}")
59
- return [] # Ensure a list is always returned
78
+ if result and result.returncode == 0:
79
+ if result.stdout.strip():
80
+ files = [line.strip() for line in result.stdout.strip().split("\n") if line.strip()]
81
+ logger.info(f"Found {len(files)} changed files")
82
+ return files
83
+ else:
84
+ logger.warning("No changed files found")
85
+ return []
86
+ except Exception as e:
87
+ logger.warning(f"Command failed: {' '.join(cmd)} - {e}")
88
+ continue
60
89
  return []
61
90
 
62
91
  def get_inputs(self) -> List[Path]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spl-core
3
- Version: 7.11.2
3
+ Version: 7.12.1
4
4
  Summary: Software Product Line Support for CMake
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,4 +1,4 @@
1
- spl_core/__init__.py,sha256=caodT8M2Hzk-61z4CDgBlU57SGNeKrYbU6LQ4BXlBNk,23
1
+ spl_core/__init__.py,sha256=2szdaPGvYYHEsBMMeewskoN2Yu2URh06p_5-YZo0P9M,23
2
2
  spl_core/__run.py,sha256=DphnN7_Bjiw_mOOztsHxTDHS8snz1g2MMWAaJpZxPKM,361
3
3
  spl_core/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  spl_core/common/path.py,sha256=sDujd3n4XP1XGjHc7ImXEdjihO6A8BOIDbKCf7HgQ0Y,462
@@ -59,13 +59,13 @@ spl_core/kickstart/templates/project/tools/toolchains/clang/toolchain.cmake,sha2
59
59
  spl_core/kickstart/templates/project/tools/toolchains/gcc/toolchain.cmake,sha256=3xKeNw1zjo5dSzu2v9WmFHJajOn64v7UukKNp6U5Dk8,547
60
60
  spl_core/main.py,sha256=_hL4j155WZMXog_755bgAH1PeUwvTdJZvVdVw9EWhvo,1225
61
61
  spl_core/spl.cmake,sha256=YQMhpSJ9yZaJ34m_W1UqrlTh_r7AKMDuH6-hzK4w98A,4585
62
- spl_core/steps/collect_pr_changes.py,sha256=0zqjF55K3P8V3ZfCNQc33pYrCxhJJhBmAG4cVxVuy1U,4182
62
+ spl_core/steps/collect_pr_changes.py,sha256=su3yCtSJM9XDlMNOD0L72ooQdKzruc0lUat858Na0Kg,5539
63
63
  spl_core/test_utils/archive_artifacts_collection.py,sha256=x7LH5dGIvssyhXsTFzB6rjgb5D2efKvHVpnjId3MNDk,5126
64
64
  spl_core/test_utils/artifacts_archiver.py,sha256=OzwFOd7qrU-dJdeebbLMF7dvZZ4QLQhHTVOgbAlEHxg,12121
65
65
  spl_core/test_utils/base_variant_test_runner.py,sha256=Oq27lkJlpB_y-p2_8S23F5zjn1438HW148q-hQNz3EY,3795
66
66
  spl_core/test_utils/spl_build.py,sha256=bSM6hwhTH9aRryvUvtSPDfk_zoZuKEO5g3QXK4SIrco,8442
67
- spl_core-7.11.2.dist-info/METADATA,sha256=UJ4McChqwJg7F2rVnzST1cmlGg9POnqqlJXZVNkwq9s,5314
68
- spl_core-7.11.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
69
- spl_core-7.11.2.dist-info/entry_points.txt,sha256=18_sdVY93N1GVBiAHxQ_F9ZM-bBvOmVMOMn7PNe2EqU,45
70
- spl_core-7.11.2.dist-info/licenses/LICENSE,sha256=UjjA0o8f5tT3wVm7qodTLAhPWLl6kgVyn9FPAd1VeYY,1099
71
- spl_core-7.11.2.dist-info/RECORD,,
67
+ spl_core-7.12.1.dist-info/METADATA,sha256=Ik-OSx46tVkDaQwcnx16QLHLbAccWH0D0mL5vU18Mmc,5314
68
+ spl_core-7.12.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
69
+ spl_core-7.12.1.dist-info/entry_points.txt,sha256=18_sdVY93N1GVBiAHxQ_F9ZM-bBvOmVMOMn7PNe2EqU,45
70
+ spl_core-7.12.1.dist-info/licenses/LICENSE,sha256=UjjA0o8f5tT3wVm7qodTLAhPWLl6kgVyn9FPAd1VeYY,1099
71
+ spl_core-7.12.1.dist-info/RECORD,,