try fixing gitea ci: v24
diff-tag / dix (push) Successful in 6m6s
flake-check / flake-check (push) Failing after 4m14s
lint / lint (push) Failing after 1m46s

This commit is contained in:
Floweynt
2026-09-10 17:27:27 -05:00
parent 935166fef7
commit ac7dfe13b7
3 changed files with 61 additions and 14 deletions
+4 -12
View File
@@ -19,14 +19,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: pick reporter
run: |
if [ "${{ github.event_name }}" = pull_request ]; then
echo "REPORTER=gitea-pr-review" >> "$GITHUB_ENV"
else
echo "REPORTER=local" >> "$GITHUB_ENV"
fi
- name: run linters
run: nix run -L .#ci -- lint . "$RUNNER_TEMP/findings"
@@ -35,9 +27,9 @@ jobs:
env:
REVIEWDOG_GITEA_API_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
if [ "$REPORTER" = local ]; then
nix run -L .#ci -- lint-report "$REPORTER" "$RUNNER_TEMP/findings" \
| tee -a "$GITHUB_STEP_SUMMARY"
if [ "${{ github.event_name }}" = pull_request ]; then
nix run -L .#ci -- lint-report gitea-pr-review "$RUNNER_TEMP/findings"
else
nix run -L .#ci -- lint-report "$REPORTER" "$RUNNER_TEMP/findings"
nix run -L .#ci -- lint-summary "$RUNNER_TEMP/findings" \
| tee -a "$GITHUB_STEP_SUMMARY"
fi
+54
View File
@@ -367,6 +367,59 @@ def lint_report(args):
sys.exit(1 if any(codes) else 0)
def has_findings(path):
return os.path.isfile(path) and os.path.getsize(path) > 0
def fmt_rdjsonl(path):
lines = []
with open(path) as f:
for raw in f:
rec = json.loads(raw)
loc = rec["location"]
r = loc.get("range", {}).get("start")
pos = f"{loc['path']}:{r['line']}:{r['column']}" if r else loc["path"]
lines.append(f"- `{pos}`: {rec['message']}")
return "\n".join(lines)
def fmt_errfmt(path):
lines = []
with open(path) as f:
for raw in f:
parts = raw.strip().split(">", 1)
if len(parts) == 2:
lines.append(f"- `{parts[0]}:{parts[1].split(':', 3)[-1].strip()}`" if ":" in parts[1] else f"- `{raw.strip()}`")
elif raw.strip():
lines.append(f"- `{raw.strip()}`")
return "\n".join(lines)
def lint_summary(args):
sections = []
d = args.dir
if has_findings(f"{d}/nixfmt.diff"):
with open(f"{d}/nixfmt.diff") as f:
sections.append(f"## nixfmt\n\n```diff\n{f.read().rstrip()}\n```")
if has_findings(f"{d}/statix.errfmt"):
sections.append(f"## statix\n\n{fmt_errfmt(f'{d}/statix.errfmt')}")
if has_findings(f"{d}/deadnix.rdjsonl"):
sections.append(f"## deadnix\n\n{fmt_rdjsonl(f'{d}/deadnix.rdjsonl')}")
if has_findings(f"{d}/cycles.rdjsonl"):
sections.append(f"## systemd ordering cycles\n\n{fmt_rdjsonl(f'{d}/cycles.rdjsonl')}")
if sections:
print("\n\n".join(["# Lint findings"] + sections))
sys.exit(1)
else:
print("No lint findings.")
sys.exit(0)
def post_comment(args):
body = args.marker + "\n" + Path(args.body_file).read_text()
pr = os.environ["PR"]
@@ -439,6 +492,7 @@ def main():
command("vulnix", vulnix, "ref", "body_out")
command("lint", lint, "target", "out")
command("lint-report", lint_report, "reporter", "dir")
command("lint-summary", lint_summary, "dir")
command("post-comment", post_comment, "marker", "body_file")
command("upsert-issue", upsert_issue, "label", "title", "body_file")
command("close-issue", close_issue, "label")
+3 -2
View File
@@ -205,11 +205,12 @@ with subtest("(isolation): edges are one-way"):
server.fail(ct_connect("git", ADDR["nginx"], 443, timeout=2))
with subtest("(isolation): host access allowlist"):
server.succeed(
server.wait_until_succeeds(
net_cmd(
"overseer",
f"{CURL} -sf --max-time 5 http://{HOST_ADDR['overseer']}:{HOST_EXPORTER_PORT}/metrics >&2",
)
),
timeout=60,
)
for port in (HOST_EXPORTER_PORT, HOST_CADVISOR_PORT):
server.fail(ct_connect("git", HOST_ADDR["git"], port, timeout=2))