machineconfig 5.11__py3-none-any.whl → 5.12__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.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/scripts/python/count_lines.py +1 -0
- machineconfig/scripts/python/count_lines_frontend.py +5 -1
- machineconfig/scripts/python/devops.py +0 -1
- machineconfig/scripts/python/repos.py +26 -113
- machineconfig/scripts/python/repos_helper.py +85 -0
- machineconfig/scripts/python/repos_helper_action.py +93 -50
- {machineconfig-5.11.dist-info → machineconfig-5.12.dist-info}/METADATA +1 -1
- {machineconfig-5.11.dist-info → machineconfig-5.12.dist-info}/RECORD +11 -10
- {machineconfig-5.11.dist-info → machineconfig-5.12.dist-info}/WHEEL +0 -0
- {machineconfig-5.11.dist-info → machineconfig-5.12.dist-info}/entry_points.txt +0 -0
- {machineconfig-5.11.dist-info → machineconfig-5.12.dist-info}/top_level.txt +0 -0
|
@@ -3,7 +3,11 @@ import typer
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
def analyze_repo_development(repo_path: str = typer.Argument(..., help="Path to the git repository")):
|
|
6
|
-
|
|
6
|
+
from machineconfig.scripts.python import count_lines
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
count_lines_path = Path(count_lines.__file__).resolve().parent.joinpath("count_lines.py")
|
|
9
|
+
# --project $HOME/code/machineconfig
|
|
10
|
+
cmd = f"""uv run --python 3.13 --with machineconfig--group plot {count_lines_path} analyze-over-time {repo_path}"""
|
|
7
11
|
from machineconfig.utils.code import run_script
|
|
8
12
|
run_script(cmd)
|
|
9
13
|
|
|
@@ -9,7 +9,6 @@ import typer
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
app = typer.Typer(help=f"🛠️ DevOps operations @ machineconfig {__version__}", no_args_is_help=True)
|
|
12
|
-
|
|
13
12
|
app.command(name="install", help="📦 Install essential packages")(installer_entry_point.main)
|
|
14
13
|
app.command(name="share-terminal", help="📡 Share terminal via web browser")(share_terminal.main)
|
|
15
14
|
app.add_typer(repos.app, name="repos", help="📁 Manage git repositories")
|
|
@@ -6,22 +6,10 @@ in the event that username@github.com is not mentioned in the remote url.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
from pathlib import Path
|
|
10
9
|
from typing import Annotated, Optional
|
|
11
|
-
|
|
12
10
|
import typer
|
|
13
11
|
|
|
14
12
|
|
|
15
|
-
from machineconfig.utils.source_of_truth import CONFIG_PATH, DEFAULTS_PATH
|
|
16
|
-
from pathlib import Path
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def _print_banner() -> None:
|
|
20
|
-
typer.echo("\n" + "=" * 50)
|
|
21
|
-
typer.echo("📂 Welcome to the Repository Manager")
|
|
22
|
-
typer.echo("=" * 50 + "\n")
|
|
23
|
-
|
|
24
|
-
|
|
25
13
|
|
|
26
14
|
app = typer.Typer(help="� Manage development repositories", no_args_is_help=True)
|
|
27
15
|
sync_app = typer.Typer(help="� Manage repository specifications and syncing", no_args_is_help=True)
|
|
@@ -47,93 +35,14 @@ CloudOption = Annotated[
|
|
|
47
35
|
|
|
48
36
|
|
|
49
37
|
|
|
50
|
-
|
|
51
|
-
def _resolve_directory(directory: Optional[str]) -> Path:
|
|
52
|
-
if directory is None:
|
|
53
|
-
directory = Path.cwd().as_posix()
|
|
54
|
-
typer.echo(f"📁 Using directory: {directory}")
|
|
55
|
-
return Path(directory).expanduser().absolute()
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def _git_operations(
|
|
59
|
-
directory: Optional[str],
|
|
60
|
-
*,
|
|
61
|
-
pull: bool,
|
|
62
|
-
commit: bool,
|
|
63
|
-
push: bool,
|
|
64
|
-
recursive: bool,
|
|
65
|
-
no_sync: bool,
|
|
66
|
-
) -> None:
|
|
67
|
-
_print_banner()
|
|
68
|
-
repos_root = _resolve_directory(directory)
|
|
69
|
-
auto_sync = not no_sync
|
|
70
|
-
from machineconfig.scripts.python.repos_helper_action import perform_git_operations
|
|
71
|
-
from machineconfig.utils.path_extended import PathExtended
|
|
72
|
-
perform_git_operations(
|
|
73
|
-
repos_root=PathExtended(repos_root),
|
|
74
|
-
pull=pull,
|
|
75
|
-
commit=commit,
|
|
76
|
-
push=push,
|
|
77
|
-
recursive=recursive,
|
|
78
|
-
auto_sync=auto_sync,
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def _resolve_spec_path(directory: Optional[str], cloud: Optional[str]) -> Path:
|
|
83
|
-
repos_root = _resolve_directory(directory)
|
|
84
|
-
from machineconfig.utils.path_extended import PathExtended
|
|
85
|
-
if not repos_root.exists() or repos_root.name != "repos.json":
|
|
86
|
-
candidate = Path(CONFIG_PATH).joinpath("repos").joinpath(PathExtended(repos_root).rel2home()).joinpath("repos.json")
|
|
87
|
-
repos_root = candidate
|
|
88
|
-
if not repos_root.exists():
|
|
89
|
-
cloud_name: Optional[str]
|
|
90
|
-
if cloud is None:
|
|
91
|
-
from machineconfig.utils.io import read_ini
|
|
92
|
-
cloud_name = read_ini(DEFAULTS_PATH)["general"]["rclone_config_name"]
|
|
93
|
-
typer.echo(f"⚠️ Using default cloud: {cloud_name}")
|
|
94
|
-
else:
|
|
95
|
-
cloud_name = cloud
|
|
96
|
-
assert cloud_name is not None, (
|
|
97
|
-
f"Path {repos_root} does not exist and cloud was not passed. You can't clone without one of them."
|
|
98
|
-
)
|
|
99
|
-
from machineconfig.utils.path_extended import PathExtended
|
|
100
|
-
PathExtended(repos_root).from_cloud(cloud=cloud_name, rel2home=True)
|
|
101
|
-
assert repos_root.exists() and repos_root.name == "repos.json", (
|
|
102
|
-
f"Path {repos_root} does not exist and cloud was not passed. You can't clone without one of them."
|
|
103
|
-
)
|
|
104
|
-
return repos_root
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
def _clone_from_specs(
|
|
108
|
-
directory: Optional[str],
|
|
109
|
-
cloud: Optional[str],
|
|
110
|
-
*,
|
|
111
|
-
checkout_branch_flag: bool,
|
|
112
|
-
checkout_commit_flag: bool,
|
|
113
|
-
) -> None:
|
|
114
|
-
_print_banner()
|
|
115
|
-
typer.echo("\n📥 Cloning or checking out repositories...")
|
|
116
|
-
spec_path = _resolve_spec_path(directory, cloud)
|
|
117
|
-
from machineconfig.scripts.python.repos_helper_clone import clone_repos
|
|
118
|
-
|
|
119
|
-
clone_repos(
|
|
120
|
-
spec_path=spec_path,
|
|
121
|
-
preferred_remote=None,
|
|
122
|
-
checkout_branch_flag=checkout_branch_flag,
|
|
123
|
-
checkout_commit_flag=checkout_commit_flag,
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
|
|
127
38
|
@app.command()
|
|
128
|
-
def push(
|
|
129
|
-
directory: DirectoryArgument = None,
|
|
39
|
+
def push(directory: DirectoryArgument = None,
|
|
130
40
|
recursive: RecursiveOption = False,
|
|
131
41
|
no_sync: NoSyncOption = False,
|
|
132
42
|
) -> None:
|
|
133
43
|
"""🚀 Push changes across repositories."""
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
44
|
+
from machineconfig.scripts.python.repos_helper import git_operations
|
|
45
|
+
git_operations(directory, pull=False, commit=False, push=True, recursive=recursive, no_sync=no_sync)
|
|
137
46
|
@app.command()
|
|
138
47
|
def pull(
|
|
139
48
|
directory: DirectoryArgument = None,
|
|
@@ -141,9 +50,8 @@ def pull(
|
|
|
141
50
|
no_sync: NoSyncOption = False,
|
|
142
51
|
) -> None:
|
|
143
52
|
"""⬇️ Pull changes across repositories."""
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
53
|
+
from machineconfig.scripts.python.repos_helper import git_operations
|
|
54
|
+
git_operations(directory, pull=True, commit=False, push=False, recursive=recursive, no_sync=no_sync)
|
|
147
55
|
@app.command()
|
|
148
56
|
def commit(
|
|
149
57
|
directory: DirectoryArgument = None,
|
|
@@ -151,9 +59,8 @@ def commit(
|
|
|
151
59
|
no_sync: NoSyncOption = False,
|
|
152
60
|
) -> None:
|
|
153
61
|
"""💾 Commit changes across repositories."""
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
62
|
+
from machineconfig.scripts.python.repos_helper import git_operations
|
|
63
|
+
git_operations(directory, pull=False, commit=True, push=False, recursive=recursive, no_sync=no_sync)
|
|
157
64
|
@app.command()
|
|
158
65
|
def all(
|
|
159
66
|
directory: DirectoryArgument = None,
|
|
@@ -161,7 +68,8 @@ def all(
|
|
|
161
68
|
no_sync: NoSyncOption = False,
|
|
162
69
|
) -> None:
|
|
163
70
|
"""🔄 Pull, commit, and push changes across repositories."""
|
|
164
|
-
|
|
71
|
+
from machineconfig.scripts.python.repos_helper import git_operations
|
|
72
|
+
git_operations(directory, pull=True, commit=True, push=True, recursive=recursive, no_sync=no_sync)
|
|
165
73
|
|
|
166
74
|
|
|
167
75
|
@sync_app.command()
|
|
@@ -170,31 +78,34 @@ def record(
|
|
|
170
78
|
cloud: CloudOption = None,
|
|
171
79
|
) -> None:
|
|
172
80
|
"""📝 Record repositories into a repos.json specification."""
|
|
173
|
-
|
|
174
|
-
|
|
81
|
+
from machineconfig.scripts.python.repos_helper import print_banner, resolve_directory
|
|
82
|
+
print_banner()
|
|
83
|
+
repos_root = resolve_directory(directory)
|
|
175
84
|
from machineconfig.scripts.python.repos_helper_record import main as record_repos
|
|
176
85
|
save_path = record_repos(repos_root=repos_root)
|
|
177
86
|
from machineconfig.utils.path_extended import PathExtended
|
|
178
87
|
if cloud is not None:
|
|
179
88
|
PathExtended(save_path).to_cloud(rel2home=True, cloud=cloud)
|
|
180
|
-
|
|
181
|
-
|
|
182
89
|
@sync_app.command()
|
|
183
90
|
def capture(
|
|
184
91
|
directory: DirectoryArgument = None,
|
|
185
92
|
cloud: CloudOption = None,
|
|
186
93
|
) -> None:
|
|
187
94
|
"""📥 Clone repositories described by a repos.json specification."""
|
|
188
|
-
|
|
95
|
+
from machineconfig.scripts.python.repos_helper import print_banner, clone_from_specs
|
|
96
|
+
print_banner()
|
|
97
|
+
clone_from_specs(directory, cloud, checkout_branch_flag=False, checkout_commit_flag=False)
|
|
189
98
|
|
|
190
99
|
|
|
191
|
-
@sync_app.command(name="checkout")
|
|
100
|
+
@sync_app.command(name="checkout-to-commit")
|
|
192
101
|
def checkout_command(
|
|
193
102
|
directory: DirectoryArgument = None,
|
|
194
103
|
cloud: CloudOption = None,
|
|
195
104
|
) -> None:
|
|
196
105
|
"""🔀 Check out specific commits listed in the specification."""
|
|
197
|
-
|
|
106
|
+
from machineconfig.scripts.python.repos_helper import print_banner, clone_from_specs
|
|
107
|
+
print_banner()
|
|
108
|
+
clone_from_specs(directory, cloud, checkout_branch_flag=False, checkout_commit_flag=True)
|
|
198
109
|
|
|
199
110
|
|
|
200
111
|
@sync_app.command(name="checkout-to-branch")
|
|
@@ -203,7 +114,9 @@ def checkout_to_branch_command(
|
|
|
203
114
|
cloud: CloudOption = None,
|
|
204
115
|
) -> None:
|
|
205
116
|
"""🔀 Check out to the main branch defined in the specification."""
|
|
206
|
-
|
|
117
|
+
from machineconfig.scripts.python.repos_helper import print_banner, clone_from_specs
|
|
118
|
+
print_banner()
|
|
119
|
+
clone_from_specs(directory, cloud, checkout_branch_flag=True, checkout_commit_flag=False)
|
|
207
120
|
|
|
208
121
|
|
|
209
122
|
@app.command()
|
|
@@ -211,9 +124,9 @@ def analyze(
|
|
|
211
124
|
directory: DirectoryArgument = None,
|
|
212
125
|
) -> None:
|
|
213
126
|
"""📊 Analyze repository development over time."""
|
|
214
|
-
|
|
127
|
+
from machineconfig.scripts.python.repos_helper import print_banner
|
|
128
|
+
print_banner()
|
|
215
129
|
repo_path = directory if directory is not None else "."
|
|
216
|
-
from machineconfig.scripts.python.count_lines_frontend import analyze_repo_development
|
|
217
|
-
|
|
218
|
-
_analyze(repo_path=repo_path)
|
|
130
|
+
from machineconfig.scripts.python.count_lines_frontend import analyze_repo_development
|
|
131
|
+
analyze_repo_development(repo_path=repo_path)
|
|
219
132
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from typing import Optional
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from machineconfig.utils.source_of_truth import CONFIG_PATH, DEFAULTS_PATH
|
|
7
|
+
|
|
8
|
+
import typer
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def print_banner() -> None:
|
|
13
|
+
typer.echo("\n" + "=" * 50)
|
|
14
|
+
typer.echo("📂 Welcome to the Repository Manager")
|
|
15
|
+
typer.echo("=" * 50 + "\n")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def resolve_directory(directory: Optional[str]) -> Path:
|
|
20
|
+
if directory is None:
|
|
21
|
+
directory = Path.cwd().as_posix()
|
|
22
|
+
typer.echo(f"📁 Using directory: {directory}")
|
|
23
|
+
return Path(directory).expanduser().absolute()
|
|
24
|
+
def git_operations(
|
|
25
|
+
directory: Optional[str],
|
|
26
|
+
*,
|
|
27
|
+
pull: bool,
|
|
28
|
+
commit: bool,
|
|
29
|
+
push: bool,
|
|
30
|
+
recursive: bool,
|
|
31
|
+
no_sync: bool,
|
|
32
|
+
) -> None:
|
|
33
|
+
print_banner()
|
|
34
|
+
repos_root = resolve_directory(directory)
|
|
35
|
+
auto_sync = not no_sync
|
|
36
|
+
from machineconfig.scripts.python.repos_helper_action import perform_git_operations
|
|
37
|
+
from machineconfig.utils.path_extended import PathExtended
|
|
38
|
+
perform_git_operations(
|
|
39
|
+
repos_root=PathExtended(repos_root),
|
|
40
|
+
pull=pull,
|
|
41
|
+
commit=commit,
|
|
42
|
+
push=push,
|
|
43
|
+
recursive=recursive,
|
|
44
|
+
auto_sync=auto_sync,
|
|
45
|
+
)
|
|
46
|
+
def resolve_spec_path(directory: Optional[str], cloud: Optional[str]) -> Path:
|
|
47
|
+
repos_root = resolve_directory(directory)
|
|
48
|
+
from machineconfig.utils.path_extended import PathExtended
|
|
49
|
+
if not repos_root.exists() or repos_root.name != "repos.json":
|
|
50
|
+
candidate = Path(CONFIG_PATH).joinpath("repos").joinpath(PathExtended(repos_root).rel2home()).joinpath("repos.json")
|
|
51
|
+
repos_root = candidate
|
|
52
|
+
if not repos_root.exists():
|
|
53
|
+
cloud_name: Optional[str]
|
|
54
|
+
if cloud is None:
|
|
55
|
+
from machineconfig.utils.io import read_ini
|
|
56
|
+
cloud_name = read_ini(DEFAULTS_PATH)["general"]["rclone_config_name"]
|
|
57
|
+
typer.echo(f"⚠️ Using default cloud: {cloud_name}")
|
|
58
|
+
else:
|
|
59
|
+
cloud_name = cloud
|
|
60
|
+
assert cloud_name is not None, (
|
|
61
|
+
f"Path {repos_root} does not exist and cloud was not passed. You can't clone without one of them."
|
|
62
|
+
)
|
|
63
|
+
from machineconfig.utils.path_extended import PathExtended
|
|
64
|
+
PathExtended(repos_root).from_cloud(cloud=cloud_name, rel2home=True)
|
|
65
|
+
assert repos_root.exists() and repos_root.name == "repos.json", (
|
|
66
|
+
f"Path {repos_root} does not exist and cloud was not passed. You can't clone without one of them."
|
|
67
|
+
)
|
|
68
|
+
return repos_root
|
|
69
|
+
def clone_from_specs(
|
|
70
|
+
directory: Optional[str],
|
|
71
|
+
cloud: Optional[str],
|
|
72
|
+
*,
|
|
73
|
+
checkout_branch_flag: bool,
|
|
74
|
+
checkout_commit_flag: bool,
|
|
75
|
+
) -> None:
|
|
76
|
+
print_banner()
|
|
77
|
+
typer.echo("\n📥 Cloning or checking out repositories...")
|
|
78
|
+
spec_path = resolve_spec_path(directory, cloud)
|
|
79
|
+
from machineconfig.scripts.python.repos_helper_clone import clone_repos
|
|
80
|
+
clone_repos(
|
|
81
|
+
spec_path=spec_path,
|
|
82
|
+
preferred_remote=None,
|
|
83
|
+
checkout_branch_flag=checkout_branch_flag,
|
|
84
|
+
checkout_commit_flag=checkout_commit_flag,
|
|
85
|
+
)
|
|
@@ -7,6 +7,9 @@ from dataclasses import dataclass
|
|
|
7
7
|
from enum import Enum
|
|
8
8
|
|
|
9
9
|
from rich import print as pprint
|
|
10
|
+
from rich.table import Table
|
|
11
|
+
from rich.panel import Panel
|
|
12
|
+
from rich.columns import Columns
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
class GitAction(Enum):
|
|
@@ -191,87 +194,127 @@ def git_action(path: PathExtended, action: GitAction, mess: Optional[str] = None
|
|
|
191
194
|
|
|
192
195
|
|
|
193
196
|
def print_git_operations_summary(summary: GitOperationSummary, operations_performed: list[str]) -> None:
|
|
194
|
-
"""Print a detailed summary of git operations
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
"""Print a detailed summary of git operations with rich formatting and tables."""
|
|
198
|
+
from rich.console import Console
|
|
199
|
+
console = Console()
|
|
200
|
+
|
|
201
|
+
# Main summary panel
|
|
202
|
+
summary_stats = [
|
|
203
|
+
f"Total paths processed: {summary.total_paths_processed}",
|
|
204
|
+
f"Git repositories found: {summary.git_repos_found}",
|
|
205
|
+
f"Non-git paths skipped: {summary.non_git_paths}"
|
|
206
|
+
]
|
|
207
|
+
|
|
208
|
+
console.print(Panel.fit(
|
|
209
|
+
"\n".join(summary_stats),
|
|
210
|
+
title="[bold blue]📊 Git Operations Summary[/bold blue]",
|
|
211
|
+
border_style="blue"
|
|
212
|
+
))
|
|
213
|
+
|
|
214
|
+
# Statistics panels in columns
|
|
215
|
+
stat_panels = []
|
|
216
|
+
|
|
201
217
|
if "commit" in operations_performed:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
218
|
+
commit_stats = [
|
|
219
|
+
f"Attempted: {summary.commits_attempted}",
|
|
220
|
+
f"Successful: {summary.commits_successful}",
|
|
221
|
+
f"No changes: {summary.commits_no_changes}",
|
|
222
|
+
f"Failed: {summary.commits_failed}"
|
|
223
|
+
]
|
|
224
|
+
stat_panels.append(Panel.fit(
|
|
225
|
+
"\n".join(commit_stats),
|
|
226
|
+
title="[bold green]💾 Commit Operations[/bold green]",
|
|
227
|
+
border_style="green"
|
|
228
|
+
))
|
|
229
|
+
|
|
208
230
|
if "pull" in operations_performed:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
231
|
+
pull_stats = [
|
|
232
|
+
f"Attempted: {summary.pulls_attempted}",
|
|
233
|
+
f"Successful: {summary.pulls_successful}",
|
|
234
|
+
f"Failed: {summary.pulls_failed}"
|
|
235
|
+
]
|
|
236
|
+
stat_panels.append(Panel.fit(
|
|
237
|
+
"\n".join(pull_stats),
|
|
238
|
+
title="[bold cyan]⬇️ Pull Operations[/bold cyan]",
|
|
239
|
+
border_style="cyan"
|
|
240
|
+
))
|
|
241
|
+
|
|
214
242
|
if "push" in operations_performed:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
243
|
+
push_stats = [
|
|
244
|
+
f"Attempted: {summary.pushes_attempted}",
|
|
245
|
+
f"Successful: {summary.pushes_successful}",
|
|
246
|
+
f"Failed: {summary.pushes_failed}"
|
|
247
|
+
]
|
|
248
|
+
stat_panels.append(Panel.fit(
|
|
249
|
+
"\n".join(push_stats),
|
|
250
|
+
title="[bold magenta]🚀 Push Operations[/bold magenta]",
|
|
251
|
+
border_style="magenta"
|
|
252
|
+
))
|
|
219
253
|
|
|
220
|
-
|
|
254
|
+
if stat_panels:
|
|
255
|
+
console.print(Columns(stat_panels, equal=True, expand=True))
|
|
256
|
+
|
|
257
|
+
# Repositories without remotes warning
|
|
221
258
|
if summary.repos_without_remotes:
|
|
222
|
-
|
|
259
|
+
repos_table = Table(title="[bold yellow]⚠️ Repositories Without Remotes[/bold yellow]")
|
|
260
|
+
repos_table.add_column("Repository Name", style="cyan", no_wrap=True)
|
|
261
|
+
repos_table.add_column("Full Path", style="dim")
|
|
262
|
+
|
|
223
263
|
for repo_path in summary.repos_without_remotes:
|
|
224
|
-
|
|
225
|
-
print(" These repositories cannot be pushed to remote servers.")
|
|
226
|
-
else:
|
|
227
|
-
if "push" in operations_performed:
|
|
228
|
-
print("\n✅ All repositories have remote configurations.")
|
|
264
|
+
repos_table.add_row(repo_path.name, str(repo_path))
|
|
229
265
|
|
|
230
|
-
|
|
266
|
+
console.print(repos_table)
|
|
267
|
+
console.print("[yellow]These repositories cannot be pushed to remote servers.[/yellow]")
|
|
268
|
+
elif "push" in operations_performed:
|
|
269
|
+
console.print("[green]✅ All repositories have remote configurations.[/green]")
|
|
270
|
+
|
|
271
|
+
# Failed operations table
|
|
231
272
|
if summary.failed_operations:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
273
|
+
failed_table = Table(title=f"[bold red]❌ Failed Operations ({len(summary.failed_operations)} total)[/bold red]")
|
|
274
|
+
failed_table.add_column("Action", style="bold red", no_wrap=True)
|
|
275
|
+
failed_table.add_column("Repository", style="cyan", no_wrap=True)
|
|
276
|
+
failed_table.add_column("Problem", style="red")
|
|
277
|
+
|
|
278
|
+
# Group failed operations by type for better organization
|
|
235
279
|
failed_by_action = {}
|
|
236
280
|
for failed_op in summary.failed_operations:
|
|
237
281
|
if failed_op.action not in failed_by_action:
|
|
238
282
|
failed_by_action[failed_op.action] = []
|
|
239
283
|
failed_by_action[failed_op.action].append(failed_op)
|
|
240
|
-
|
|
284
|
+
|
|
241
285
|
for action, failures in failed_by_action.items():
|
|
242
|
-
print(f"\n {action.upper()} failures ({len(failures)}):")
|
|
243
286
|
for failure in failures:
|
|
244
|
-
if
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
287
|
+
repo_name = failure.repo_path.name if failure.is_git_repo else f"{failure.repo_path.name} (not git repo)"
|
|
288
|
+
problem = failure.message if failure.is_git_repo else "Not a git repository"
|
|
289
|
+
failed_table.add_row(action.upper(), repo_name, problem)
|
|
290
|
+
|
|
291
|
+
console.print(failed_table)
|
|
248
292
|
else:
|
|
249
|
-
print("
|
|
293
|
+
console.print("[green]✅ All git operations completed successfully![/green]")
|
|
250
294
|
|
|
251
295
|
# Overall success assessment
|
|
252
296
|
total_failed = len(summary.failed_operations)
|
|
253
|
-
total_operations = (summary.commits_attempted + summary.pulls_attempted +
|
|
297
|
+
total_operations = (summary.commits_attempted + summary.pulls_attempted +
|
|
254
298
|
summary.pushes_attempted)
|
|
255
|
-
|
|
299
|
+
|
|
256
300
|
if total_failed == 0 and total_operations > 0:
|
|
257
|
-
print(f"\n🎉 SUCCESS: All {total_operations} operations completed successfully!")
|
|
301
|
+
console.print(f"\n[bold green]🎉 SUCCESS: All {total_operations} operations completed successfully![/bold green]")
|
|
258
302
|
elif total_operations == 0:
|
|
259
|
-
print("\n📝 No git operations were performed.")
|
|
303
|
+
console.print("\n[blue]📝 No git operations were performed.[/blue]")
|
|
260
304
|
else:
|
|
261
305
|
success_rate = ((total_operations - total_failed) / total_operations * 100) if total_operations > 0 else 0
|
|
262
|
-
print(f"\n⚖️ SUMMARY: {total_operations - total_failed}/{total_operations} operations succeeded ({success_rate:.1f}% success rate)")
|
|
263
306
|
if total_failed > 0:
|
|
264
|
-
print("
|
|
307
|
+
console.print(f"\n[bold yellow]⚖️ SUMMARY: {total_operations - total_failed}/{total_operations} operations succeeded ({success_rate:.1f}% success rate)[/bold yellow]")
|
|
308
|
+
console.print("[yellow]Review the failed operations table above for details on what needs attention.[/yellow]")
|
|
309
|
+
else:
|
|
310
|
+
console.print(f"\n[bold green]⚖️ SUMMARY: {total_operations}/{total_operations} operations succeeded (100% success rate)[/bold green]")
|
|
265
311
|
|
|
266
312
|
|
|
267
313
|
def perform_git_operations(repos_root: PathExtended, pull: bool, commit: bool, push: bool, recursive: bool, auto_sync: bool) -> None:
|
|
268
314
|
"""Perform git operations on all repositories and provide detailed summary."""
|
|
269
315
|
print(f"\n🔄 Performing Git actions on repositories @ `{repos_root}`...")
|
|
270
|
-
|
|
271
|
-
# Initialize summary tracking
|
|
272
316
|
summary = GitOperationSummary()
|
|
273
|
-
operations_performed = []
|
|
274
|
-
|
|
317
|
+
operations_performed = []
|
|
275
318
|
# Determine which operations to perform
|
|
276
319
|
if pull:
|
|
277
320
|
operations_performed.append("pull")
|
|
@@ -145,10 +145,10 @@ machineconfig/scripts/python/cloud_manager.py,sha256=YN0DYLzPKtMBaks-EAVwFmkCu3X
|
|
|
145
145
|
machineconfig/scripts/python/cloud_mount.py,sha256=GwcXbd5ohoHGESfX5edtCEl2-umDDxH_AZapmFSzc9E,6740
|
|
146
146
|
machineconfig/scripts/python/cloud_repo_sync.py,sha256=8dnlHbQqRymPRU0v01pNIuaIvFeY4fReP7ewNSSCt34,9765
|
|
147
147
|
machineconfig/scripts/python/cloud_sync.py,sha256=RWGpAfJ9fnN18yNBSgN44dzA38Hmd4879JL5r2pcyrM,3514
|
|
148
|
-
machineconfig/scripts/python/count_lines.py,sha256=
|
|
149
|
-
machineconfig/scripts/python/count_lines_frontend.py,sha256=
|
|
148
|
+
machineconfig/scripts/python/count_lines.py,sha256=BoIR9B5l-Yb1UtCkR1iBp7zCD8jxXw8BAgOnmiFG9es,15895
|
|
149
|
+
machineconfig/scripts/python/count_lines_frontend.py,sha256=Kl2sLS8Cwy_7vx5DuTbb0V45_Z-j43g2dP-lRi9c5uI,571
|
|
150
150
|
machineconfig/scripts/python/croshell.py,sha256=parFHSL859H00ExDpDBPHBFe_E_DrfVq6P8CpCGVK9A,8571
|
|
151
|
-
machineconfig/scripts/python/devops.py,sha256=
|
|
151
|
+
machineconfig/scripts/python/devops.py,sha256=JB4_M6S-nO3yqas8wtAlU2r6jsmHu_nlq7aoEOH-54Y,3486
|
|
152
152
|
machineconfig/scripts/python/devops_add_identity.py,sha256=wvjNgqsLmqD2SxbNCW_usqfp0LI-TDvcJJKGOWt2oFw,3775
|
|
153
153
|
machineconfig/scripts/python/devops_add_ssh_key.py,sha256=BXB-9RvuSZO0YTbnM2azeABW2ngLW4SKhhAGAieMzfw,6873
|
|
154
154
|
machineconfig/scripts/python/devops_backup_retrieve.py,sha256=JLJHmi8JmZ_qVTeMW-qBEAYGt1fmfWXzZ7Gm-Q-GDcU,5585
|
|
@@ -171,8 +171,9 @@ machineconfig/scripts/python/mount_nw_drive.py,sha256=iru6AtnTyvyuk6WxlK5R4lDkul
|
|
|
171
171
|
machineconfig/scripts/python/mount_ssh.py,sha256=k2fKq3f5dKq_7anrFOlqvJoI_3U4EWNHLRZ1o3Lsy6M,2268
|
|
172
172
|
machineconfig/scripts/python/onetimeshare.py,sha256=bmGsNnskym5OWfIhpOfZG5jq3m89FS0a6dF5Sb8LaZM,2539
|
|
173
173
|
machineconfig/scripts/python/pomodoro.py,sha256=SPkfeoZGv8rylGiOyzQ7UK3aXZ3G2FIOuGkSuBUggOI,2019
|
|
174
|
-
machineconfig/scripts/python/repos.py,sha256=
|
|
175
|
-
machineconfig/scripts/python/
|
|
174
|
+
machineconfig/scripts/python/repos.py,sha256=n7LUG_SPZ_i-moYjz3QHPhsBM_cFpm3cZ-tjztplDfc,4918
|
|
175
|
+
machineconfig/scripts/python/repos_helper.py,sha256=3jLdnNf1canpzi3JXiz5VA6UTUmLeNHuhjOWVl_thP0,3006
|
|
176
|
+
machineconfig/scripts/python/repos_helper_action.py,sha256=sXeOw5uHaK2GJixYW8qU_PD24mruGcQ59uf68ELC76A,14846
|
|
176
177
|
machineconfig/scripts/python/repos_helper_clone.py,sha256=9vGb9NCXT0lkerPzOJjmFfhU8LSzE-_1LDvjkhgnal0,5461
|
|
177
178
|
machineconfig/scripts/python/repos_helper_record.py,sha256=dtnnInQPn00u1cyr0oOgJ_jB12O3bSiNctwzC3W7_3w,10994
|
|
178
179
|
machineconfig/scripts/python/repos_helper_update.py,sha256=AYyKIB7eQ48yoYmFjydIhRI1lV39TBv_S4_LCa-oKuQ,11042
|
|
@@ -407,8 +408,8 @@ machineconfig/utils/schemas/fire_agents/fire_agents_input.py,sha256=pTxvLzIpD5RF
|
|
|
407
408
|
machineconfig/utils/schemas/installer/installer_types.py,sha256=QClRY61QaduBPJoSpdmTIdgS9LS-RvE-QZ-D260tD3o,1214
|
|
408
409
|
machineconfig/utils/schemas/layouts/layout_types.py,sha256=TcqlZdGVoH8htG5fHn1KWXhRdPueAcoyApppZsPAPto,2020
|
|
409
410
|
machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
|
|
410
|
-
machineconfig-5.
|
|
411
|
-
machineconfig-5.
|
|
412
|
-
machineconfig-5.
|
|
413
|
-
machineconfig-5.
|
|
414
|
-
machineconfig-5.
|
|
411
|
+
machineconfig-5.12.dist-info/METADATA,sha256=bcbdbTMVjgLU4e-XinDcInPPj0ELaL4i1jJYkM2_5BA,8030
|
|
412
|
+
machineconfig-5.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
413
|
+
machineconfig-5.12.dist-info/entry_points.txt,sha256=2afE1mw-o4MUlfxyX73SV02XaQI4SV_LdL2r6_CzhPU,1074
|
|
414
|
+
machineconfig-5.12.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
415
|
+
machineconfig-5.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|