Skip to content

fix: correct Squid access.log path and add runtime presence detection - #49557

Merged
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-fix-missing-access-log
Aug 1, 2026
Merged

fix: correct Squid access.log path and add runtime presence detection#49557
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-fix-missing-access-log

Conversation

Copilot AI commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

The daily observability report was checking sandbox/firewall/logs/access.log but current AWF layout writes to sandbox/firewall/logs/squid-logs/access.log — causing every recent run to be flagged CRITICAL for a "missing" file that was actually present. The format description also referenced native Squid format instead of the AWF custom format.

Changes

  • daily-observability-report.md: Fix canonical path to squid-logs/access.log; retain the legacy direct path as fallback (explains the 3/8 runs that previously passed); replace format spec with actual AWF 10-field format:

    timestamp client_ip:port domain dest_ip:port proto method status decision url user_agent
    
  • generate_observability_summary.cjs: Add squidAccessLogPresent field (probes both current squid-logs/ and legacy paths) emitted in the step summary when firewall is enabled; surfaces a warning line when missing so operators see the gap without waiting for the daily report.

  • print_firewall_logs.sh: After the chown/chmod pass, probe both paths and emit a stderr WARNING if neither exists — makes the failure visible directly in the job log.

- daily-observability-report.md: fix canonical path from
  sandbox/firewall/logs/access.log to sandbox/firewall/logs/squid-logs/access.log
  (current AWF layout), keep legacy path as fallback, and replace the
  native Squid format description with the AWF custom 10-field format

- generate_observability_summary.cjs: add squidAccessLogPresent field
  (checks both current squid-logs/ and legacy path) and emit a warning
  line in the step summary when the access.log is missing on a
  firewall-enabled run

- generate_observability_summary.test.cjs: add 4 tests covering present
  (squid-logs/ path), present (legacy path), missing, and firewall-
  disabled cases

- print_firewall_logs.sh: after chown/chmod, probe both access.log
  paths and emit a stderr WARNING when neither is found so operators
  can spot the gap directly in the job log

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing access.log in firewall-enabled runs fix: correct Squid access.log path and add runtime presence detection Aug 1, 2026
Copilot AI requested a review from pelikhan August 1, 2026 08:59
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

PR Triage

Category: bug · Risk: low · Priority: medium · Score: 47/100 (impact 20, urgency 15, quality 12)

Recommended action: defer

Fixes a false-CRITICAL observability alert (wrong Squid log path). Draft, no CI/reviews yet — will fast-track once undrafted given real signal-quality impact.

Generated by 🔧 PR Triage Agent · auto · 49.2 AIC · ⌖ 8.64 AIC · ⊞ 8K ·

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

PR Triage

  • Category: bug
  • Risk: low
  • Priority: medium
  • Score: 50/100 (Impact25/Urgency15/Quality10)
  • Recommended action: fast_track

OTel/observability-report path bug causing false CRITICAL alerts; draft, needs undraft. OTEL-FLAGGED.

Generated by 🔧 PR Triage Agent · auto · 73.4 AIC · ⌖ 10.1 AIC · ⊞ 8K ·

@github-actions github-actions Bot added the otel label Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

cc @mnkeifer — this PR is OpenTelemetry-related and has been labeled otel per customer triage policy. (Note: no assignee-management tool is available to safe-outputs in this workflow; please self-assign or ask a maintainer to assign.)

Generated by 🔧 PR Triage Agent · auto · 73.4 AIC · ⌖ 10.1 AIC · ⊞ 8K ·

@pelikhan
pelikhan marked this pull request as ready for review August 1, 2026 19:31
Copilot AI review requested due to automatic review settings August 1, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Corrects Squid access-log discovery and adds runtime visibility for missing firewall logs.

Changes:

  • Updates current and legacy log paths and AWF format guidance.
  • Adds step-summary presence reporting and tests.
  • Emits job-log warnings when access logs are absent.
Show a summary per file
File Description
actions/setup/sh/print_firewall_logs.sh Adds missing-log warning.
actions/setup/js/generate_observability_summary.cjs Reports access-log presence.
actions/setup/js/generate_observability_summary.test.cjs Tests summary behavior.
.github/workflows/daily-observability-report.md Corrects path and format guidance.
.github/workflows/daily-observability-report.lock.yml Recompiles workflow metadata.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment on lines +57 to +60
for candidate in \
"${AWF_LOGS_DIR}/squid-logs/access.log" \
"${AWF_LOGS_DIR}/access.log"; do
if [[ -f "${candidate}" ]]; then
const OTLP_EXPORT_ERROR_DETAILS_PATH = "/tmp/gh-aw/otlp-export-errors.jsonl";
const gatewayEventPaths = ["/tmp/gh-aw/mcp-logs/gateway.jsonl", "/tmp/gh-aw/mcp-logs/rpc-messages.jsonl"];
// Squid access log paths: current AWF layout (squid-logs/ subdirectory) and legacy layout (directly under logs/).
const squidAccessLogPaths = ["/tmp/gh-aw/sandbox/firewall/logs/squid-logs/access.log", "/tmp/gh-aw/sandbox/firewall/logs/access.log"];
staged: awInfo.staged === true,
firewallEnabled: awInfo.firewall_enabled === true,
firewallEnabled,
squidAccessLogPresent: firewallEnabled ? checkSquidAccessLogPresent() : null,
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — the fix is correct and well-tested. One important correctness issue remains: the hardcoded /tmp/gh-aw base path in the JS summary script won't work on ARC/DinD runners.

📋 Key Themes & Highlights

Key Themes

  • Hardcoded /tmp/gh-aw base path (generate_observability_summary.cjs line 12): squidAccessLogPresent will silently return false on ARC runners where logs live under RUNNER_TEMP/gh-aw/. This is the highest-risk issue — mirrors comments already posted by a prior review pass.
  • Shell test coverage gap (print_firewall_logs.sh): the new warning branch has no shell test assertions (also called out in existing comments).
  • Early-return coverage (generate_observability_summary.cjs line 138): squidAccessLogPresent is only emitted when OTLP is enabled, so non-OTLP firewall runs won't surface the warning (also flagged in existing comments).

Positive Highlights

  • ✅ Good dual-path fallback logic (current + legacy) in both JS and shell
  • ✅ Test suite covers all four key scenarios: current path, legacy path, missing, firewall-disabled
  • ✅ Warning written to stderr in the shell script — operators see it without grepping the step summary
  • squidAccessLogPresent: null when firewall is disabled — clean sentinel avoids false positives

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 29.5 AIC · ⌖ 8.05 AIC · ⊞ 7.1K
Comment /matt to run again

const OTLP_EXPORT_ERROR_DETAILS_PATH = "/tmp/gh-aw/otlp-export-errors.jsonl";
const gatewayEventPaths = ["/tmp/gh-aw/mcp-logs/gateway.jsonl", "/tmp/gh-aw/mcp-logs/rpc-messages.jsonl"];
// Squid access log paths: current AWF layout (squid-logs/ subdirectory) and legacy layout (directly under logs/).
const squidAccessLogPaths = ["/tmp/gh-aw/sandbox/firewall/logs/squid-logs/access.log", "/tmp/gh-aw/sandbox/firewall/logs/access.log"];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] The hardcoded /tmp/gh-aw base path will silently return false on ARC/DinD runners where the Go compiler writes logs under RUNNER_TEMP/gh-aw/squidAccessLogPresent will always be wrong there even when the log file exists. This is the same root cause as the existing comment at this line but the fix direction is worth making explicit.

💡 Suggested approach

Mirror how print_firewall_logs.sh already derives the path: the compiler exports AWF_LOGS_DIR; the JS side can use RUNNER_TEMP to construct the same base, or a new GH_AW_BASE_DIR env var:

const GH_AW_BASE = (process.env.RUNNER_TEMP && process.env.RUNNER_TEMP !== '')
  ? path.join(process.env.RUNNER_TEMP, 'gh-aw')
  : '/tmp/gh-aw';
const squidAccessLogPaths = [
  GH_AW_BASE + '/sandbox/firewall/logs/squid-logs/access.log',
  GH_AW_BASE + '/sandbox/firewall/logs/access.log',
];

Add a unit-test case that sets RUNNER_TEMP to confirm the path is derived dynamically.

@copilot please address this.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

⚠️ Test Quality Score: 75/100 — Acceptable

Analyzed 8 test(s): 8 design, 0 implementation, 0 violation(s).

📊 Metrics (8 tests)
Metric Value
Analyzed 8 (Go: 0, JS: 8)
✅ Design 8 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 4 (50%)
Duplicate clusters 0
Inflation Yes (2.3:1 — test: 46 lines added, prod: 20 lines added)
🚨 Violations 0
Test File Classification Issues
builds summary from runtime observability files generate_observability_summary.test.cjs design_test, behavioral_contract None
uses GITHUB_AW_OTEL_TRACE_ID env var when set generate_observability_summary.test.cjs design_test, behavioral_contract None
does not show workflow_call_id as trace id generate_observability_summary.test.cjs design_test, behavioral_contract None
always generates summary regardless of env vars generate_observability_summary.test.cjs design_test, behavioral_contract None
squid access.log present at squid-logs path generate_observability_summary.test.cjs design_test, behavioral_contract None
squid access.log present at legacy path generate_observability_summary.test.cjs design_test, behavioral_contract None
warns when squid access.log is missing generate_observability_summary.test.cjs design_test, behavioral_contract None
omits squid access.log when firewall disabled generate_observability_summary.test.cjs design_test, behavioral_contract None

Verdict

passed. 0% implementation tests (threshold: 30%). Test inflation at 2.3:1 (46 test lines / 20 prod lines) deducted 10 points, but all 8 tests are strong behavioral contracts covering the primary fix (correct squid-logs path), legacy path fallback, missing-log warning, and firewall-disabled omission.

🧪 Test quality analysis by Test Quality Sentinel · sonnet46 · 26.7 AIC · ⌖ 11.5 AIC · ⊞ 8.4K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Test Quality Sentinel: 75/100. 0% implementation tests (threshold: 30%).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

The changes correctly fix the canonical Squid access.log path (squid-logs/ subdirectory) and add dual-path fallback detection in both the JS summary generator and the shell script. The test coverage added is solid.

Three existing comments (by Copilot) and one new comment (line 64 of print_firewall_logs.sh) flag non-blocking but actionable issues:

  1. print_firewall_logs.sh — warning not surfaced in step summary (new, line 64): the >&2-only message is invisible in the GitHub step-summary panel. Should also write to $GITHUB_STEP_SUMMARY.
  2. generate_observability_summary.cjs — hardcoded /tmp/gh-aw path (existing, line 12): ARC/DinD runners use $RUNNER_TEMP/gh-aw/... instead.
  3. generate_observability_summary.cjs — field never emitted without OTLP (existing, line 138): the step-summary block is gated on isOTLPEnabled, so squidAccessLogPresent may not appear for non-OTLP runs.
  4. print_firewall_logs.sh — no shell test assertions (existing, line 60): new warning code path has no test coverage.

None of these are blocking the correctness of the core fix.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 20.1 AIC · ⌖ 16.8 AIC · ⊞ 5.4K

ACCESS_LOG_FOUND=true
break
fi
done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning is written only to stderr (>&2) and is not appended to $GITHUB_STEP_SUMMARY. Unlike the AWF summary block above (which uses tee -a "${GITHUB_STEP_SUMMARY:-/dev/null}"), this warning will be invisible in the step-summary panel — easy to miss during triage.

Suggested fix:

if [[ "${ACCESS_LOG_FOUND}" == "false" ]]; then
  msg="WARNING: Squid access.log not found under ${AWF_LOGS_DIR}; egress traffic for this run cannot be audited."
  echo "${msg}" >&2
  echo "${msg}" >> "${GITHUB_STEP_SUMMARY:-/dev/null}"
fi

@copilot please address this.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Request changes — the new detection logic reintroduces the same class of false-positive bug it's meant to fix.

💡 Themes
  • Path resolution bug: generate_observability_summary.cjs hardcodes /tmp/gh-aw/... for the squid log check, but the Go compiler redirects firewall logs to ${{ runner.temp }}/gh-aw/... on ARC/DinD topologies. This means the new diagnostic will falsely report the access log missing on ARC/DinD even when it's present — the exact failure mode this PR set out to eliminate.
  • Coverage gap: The new step-summary field is gated behind isOTLPEnabled(data) in the Go compiler, so firewall-only workflows without OTLP configured never get this diagnostic at all, silently limiting the fix's real-world impact.
  • Test asymmetry: The shell script (print_firewall_logs.sh) got no test coverage for its new warning logic, unlike the well-tested .cjs counterpart, risking silent drift between the two parallel implementations.

The core .md path fix and format-spec correction look solid and well-reasoned. The remaining issues are in the two auxiliary detection scripts added alongside it.

🔎 Code quality review by PR Code Quality Reviewer · auto · 28.2 AIC · ⌖ 9.8 AIC · ⊞ 7.8K
Comment /review to run again

const OTLP_EXPORT_ERROR_DETAILS_PATH = "/tmp/gh-aw/otlp-export-errors.jsonl";
const gatewayEventPaths = ["/tmp/gh-aw/mcp-logs/gateway.jsonl", "/tmp/gh-aw/mcp-logs/rpc-messages.jsonl"];
// Squid access log paths: current AWF layout (squid-logs/ subdirectory) and legacy layout (directly under logs/).
const squidAccessLogPaths = ["/tmp/gh-aw/sandbox/firewall/logs/squid-logs/access.log", "/tmp/gh-aw/sandbox/firewall/logs/access.log"];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded /tmp/gh-aw/... paths make squidAccessLogPresent always false on ARC/DinD runners, producing a false "log missing" warning on every such run.

💡 Details

The Go compiler deliberately redirects firewall logs to ${{ runner.temp }}/gh-aw/sandbox/firewall/logs on ARC/DinD topologies (see pkg/workflow/engine_firewall_support.go isArcDindTopology branches using constants.AWFProxyLogsDirExpr), because /tmp/gh-aw is not daemon-visible in that mode. print_firewall_logs.sh correctly receives this via the AWF_LOGS_DIR env var and checks the right location. This new .cjs script instead hardcodes /tmp/gh-aw/sandbox/firewall/logs/... with no environment override, so on ARC/DinD it will always report squidAccessLogPresent: false and emit the "cannot be audited" warning even when the log is present — exactly the false-positive class of bug this PR set out to fix.

const squidAccessLogPaths = [
  path.join(process.env.GH_AW_FIREWALL_LOGS_DIR || "/tmp/gh-aw/sandbox/firewall/logs", "squid-logs", "access.log"),
  path.join(process.env.GH_AW_FIREWALL_LOGS_DIR || "/tmp/gh-aw/sandbox/firewall/logs", "access.log"),
];

The generator step would need to pass the same resolved directory as an env var, mirroring what generateFirewallLogParsingStep already does for the shell script.

staged: awInfo.staged === true,
firewallEnabled: awInfo.firewall_enabled === true,
firewallEnabled,
squidAccessLogPresent: firewallEnabled ? checkSquidAccessLogPresent() : null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new step-summary field never fires for firewall-enabled workflows that lack OTLP, since generateObservabilitySummary bails out early unless isOTLPEnabled(data).

💡 Details

In pkg/workflow/compiler_yaml_ai_execution.go, generateObservabilitySummary returns immediately when !isOTLPEnabled(data), before this script is even wired into the workflow. Firewall can be enabled independently of OTLP tracing, so the majority of firewall-only workflows (no telemetry export configured) will never emit the squidAccessLogPresent line or the missing-log warning — silently defeating the stated goal of "surfaces a warning line when missing so operators see the gap without waiting for the daily report" for that common configuration.

// pkg/workflow/compiler_yaml_ai_execution.go
func (c *Compiler) generateObservabilitySummary(yaml *strings.Builder, data *WorkflowData) {
	if !isOTLPEnabled(data) {
		return // <- firewall-only workflows never reach the squid-log check below
	}
	...

Either decouple the squid-log presence check into its own step gated only on isFirewallEnabled(data), or relax the early return so firewall-only runs still get this diagnostic.

@@ -50,3 +50,18 @@ if command -v awf &> /dev/null; then
else
echo 'AWF binary not installed, skipping firewall log summary'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No test suite covers this new warning path, so a shell-syntax regression (e.g. quoting/array issues) would silently ship undetected.

💡 Details

print_firewall_logs.sh has no accompanying test file in this diff, unlike generate_observability_summary.cjs which got four new Jest cases for the equivalent logic. The two implementations of the same "check current path, then legacy path" logic can now drift silently — e.g. if AWFProxyLogsDir changes in Go but only the .cjs array is updated (which is already stale per the ARC/DinD hardcoded-path issue noted elsewhere), this shell script would keep checking the old paths without any test catching the mismatch.

Consider adding a bats/shellspec test (or a minimal inline smoke test invoked from CI) that stubs AWF_LOGS_DIR, creates files at the current path, the legacy path, and neither, and asserts the WARNING line is/isn't emitted on stderr — mirroring the JS test matrix already added.

@pelikhan

pelikhan commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/github/gh-aw/actions/runs/30714964525/job/91410770557?pr=49557

Fixed in 3d65be5. The CI failure was TestWasmGolden_AllEngines/copilot — the golden file had hardcoded version 1.0.75 but DefaultCopilotVersion is now 1.0.77. Added Copilot version normalization to the test (matching the existing pattern for Codex and Pi), updated copilot.golden to use the COPILOT_VERSION placeholder, and extended TestNormalizeOutput_DefaultRuntimeVersions to cover it. Future version bumps to DefaultCopilotVersion will no longer break this test.

@pelikhan
pelikhan merged commit 387454f into main Aug 1, 2026
@pelikhan
pelikhan deleted the copilot/deep-report-fix-missing-access-log branch August 1, 2026 22:34
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] 5 of 8 sampled firewall-enabled runs are missing access.log, making egress debugging impossible

3 participants