Skip to content

Commit 6e7a84e

Browse files
committed
Consolidate repo automation into shared Python core
1 parent 86225e7 commit 6e7a84e

22 files changed

Lines changed: 1170 additions & 1181 deletions

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Run multi-language smoke checks with:
5656

5757
These smoke checks also compile standalone C# exercises by generating temporary validation projects during the check.
5858

59+
The public PowerShell and Bash scripts are thin wrappers over the shared Python automation core in `scripts/automation.py`. Curriculum validation and smoke target metadata live in `scripts/automation_manifest.json`.
60+
5961
4. Update related README files when behavior or structure changes.
6062
5. Open a pull request with a clear description of what changed and why.
6163

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ bash ./scripts/verify-repo.sh
126126

127127
GitHub Actions validates links, README structure, module completeness, checkpoint completeness, C++ build, and multi-language smoke checks on Linux and Windows.
128128

129+
The public PowerShell and Bash scripts remain the supported entrypoints, but they now delegate to a shared Python automation core under `scripts/automation.py` backed by `scripts/automation_manifest.json`.
130+
129131
The multi-language smoke scripts also compile standalone C# exercises by generating temporary validation projects during the check.
130132

131133
## Contributing

languages/csharp/03-advanced/copy-and-move-semantics/exercises/01.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public IntBuffer(List<int> initialValues)
1111
Console.WriteLine($"Constructed IntBuffer (size={values.Count})");
1212
}
1313

14-
private IntBuffer(List<int> sourceValues)
14+
private IntBuffer(List<int> sourceValues, bool takeOwnership)
1515
{
1616
values = sourceValues;
1717
}
@@ -27,7 +27,7 @@ public IntBuffer Transfer()
2727
{
2828
List<int> movedValues = values;
2929
values = new List<int>();
30-
IntBuffer transferred = new IntBuffer(movedValues);
30+
IntBuffer transferred = new IntBuffer(movedValues, true);
3131
Console.WriteLine($"Transferred IntBuffer (size={transferred.Size})");
3232
return transferred;
3333
}

scripts/automation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from automation_core.ops import main
2+
3+
4+
if __name__ == "__main__":
5+
raise SystemExit(main())
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Shared automation core for repository validation and smoke orchestration."""
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from __future__ import annotations
2+
3+
import json
4+
from dataclasses import dataclass
5+
from pathlib import Path
6+
from typing import Any
7+
8+
9+
@dataclass(frozen=True)
10+
class Manifest:
11+
data: dict[str, Any]
12+
13+
@property
14+
def required_readme_headings(self) -> list[str]:
15+
return list(self.data["required_readme_headings"])
16+
17+
@property
18+
def checkpoint_kinds(self) -> list[str]:
19+
return list(self.data["checkpoint_kinds"])
20+
21+
@property
22+
def module_order(self) -> dict[str, list[str]]:
23+
return {key: list(value) for key, value in self.data["module_order"].items()}
24+
25+
@property
26+
def languages(self) -> dict[str, dict[str, Any]]:
27+
return dict(self.data["languages"])
28+
29+
@property
30+
def docs(self) -> dict[str, Any]:
31+
return dict(self.data["docs"])
32+
33+
@property
34+
def smoke(self) -> dict[str, dict[str, Any]]:
35+
return dict(self.data["smoke"])
36+
37+
38+
def load_manifest(scripts_dir: Path) -> Manifest:
39+
manifest_path = scripts_dir / "automation_manifest.json"
40+
with manifest_path.open("r", encoding="utf-8") as handle:
41+
return Manifest(json.load(handle))

0 commit comments

Comments
 (0)