Close phase 0 review findings: stricter policy scans, property generator, hook
ci / test (postgres) (push) Successful in 1m24s
ci / test (sqlite) (push) Successful in 1m35s
ci / image (push) Successful in 16s
ci / test (postgres) (pull_request) Successful in 1m11s
ci / test (sqlite) (pull_request) Successful in 1m24s
ci / image (pull_request) Successful in 14s
ci / test (postgres) (push) Successful in 1m24s
ci / test (sqlite) (push) Successful in 1m35s
ci / image (push) Successful in 16s
ci / test (postgres) (pull_request) Successful in 1m11s
ci / test (sqlite) (pull_request) Successful in 1m24s
ci / image (pull_request) Successful in 14s
The independent review found that the policy tests could be bypassed: Microsoft-named direct packages and GlobalPackageReference slipped past the dependency check, the live-money scan missed the JSON, Dockerfile and Unraid template forms, the secret scan missed short project secrets but would have failed on the user's own ignored .env. The scans now read only the files git would commit and cover those cases. Also adds the fixed-seed generator for property tests, the REGISTRY variables reserved for phase 9 in the CI, a git pre-commit hook in place of the pre-commit tool (tasks hooks), the missing SPEC 4 facts in API-NOTES (Fed/ECB/BLS times, USDC depth on OKX) and the full list of today's indirect packages. refs #3 refs #5 refs #6 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b4bf864f74
commit
52550ee6d1
15 files changed
+400
-83
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using System.Net.Sockets;
|
||||
|
||||
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]
|
||||
@@ -32,29 +33,41 @@ internal static class Repo
|
||||
throw new InvalidOperationException("Repository root (Anubis.slnx) not found above " + AppContext.BaseDirectory);
|
||||
}
|
||||
|
||||
private static readonly string[] _skippedDirectories = ["bin", "obj", ".git", ".vs", ".claude", "artifacts", "TestResults", "publish", "screenshots"];
|
||||
private static readonly Lazy<IReadOnlyList<FileInfo>> _files = new(ListFiles);
|
||||
|
||||
/// <summary>All files of the working tree, without build output and tool folders.</summary>
|
||||
public static IEnumerable<FileInfo> Files()
|
||||
/// <summary>
|
||||
/// The files git would commit: tracked ones plus new ones that .gitignore does not exclude.
|
||||
/// The local .env, /data and build output stay out, so a key the user puts there never fails the suite.
|
||||
/// </summary>
|
||||
public static IEnumerable<FileInfo> Files() => _files.Value;
|
||||
|
||||
private static List<FileInfo> ListFiles()
|
||||
{
|
||||
var pending = new Stack<DirectoryInfo>();
|
||||
pending.Push(Root);
|
||||
while (pending.Count > 0)
|
||||
var info = new ProcessStartInfo("git")
|
||||
{
|
||||
var dir = pending.Pop();
|
||||
foreach (var sub in dir.EnumerateDirectories())
|
||||
{
|
||||
if (!_skippedDirectories.Contains(sub.Name, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
pending.Push(sub);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var file in dir.EnumerateFiles())
|
||||
{
|
||||
yield return file;
|
||||
}
|
||||
WorkingDirectory = Root.FullName,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
UseShellExecute = false,
|
||||
};
|
||||
foreach (var argument in new[] { "ls-files", "-z", "--cached", "--others", "--exclude-standard" })
|
||||
{
|
||||
info.ArgumentList.Add(argument);
|
||||
}
|
||||
|
||||
using var process = Process.Start(info) ?? throw new InvalidOperationException("git could not be started.");
|
||||
var errors = process.StandardError.ReadToEndAsync();
|
||||
var output = process.StandardOutput.ReadToEnd();
|
||||
process.WaitForExit();
|
||||
if (process.ExitCode != 0)
|
||||
{
|
||||
throw new InvalidOperationException("git ls-files failed: " + errors.Result);
|
||||
}
|
||||
|
||||
return output.Split('\0', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(path => new FileInfo(Path.Combine(Root.FullName, path)))
|
||||
.Where(file => file.Exists)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static string Relative(FileInfo file) =>
|
||||
|
||||
Reference in new issue
Block a user