Skip to content

Handle ignored errors and discarded results - #71892

Closed
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/lint-monster-handle-ignored-errors
Closed

pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/lint-monster-handle-ignored-errors

Conversation

Copilot AI commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Unchecked errors could silently truncate parsed content, hide write failures, or discard compiler validation failures. This change handles actionable findings while preserving tolerant parsing and best-effort cleanup semantics.

  • Propagate failures: Return scanner, temporary-file close, compiler domain-validation, and CLI version/help/edit output errors.
  • Preserve cleanup semantics: Log read-side close and traversal failures without masking primary errors; remove incomplete manifest-cache files.
  • Avoid truncation: Replace string-backed scanner loops with line iteration where appropriate. Remaining scanners check completion errors:
    if err := scanner.Err(); err != nil {
        return "", fmt.Errorf("failed to scan includes: %w", err)
    }
  • Retain intentional fallbacks: Check type assertions explicitly while preserving zero-value behavior for absent or malformed optional fields.
  • Cover failure paths: Add regressions for oversized lines, failed writes, malformed metadata, compiler errors, and cleanup.
  • Retain infallible-write findings: Leave 514 formatting findings across 64 files unchanged: their destinations are strings.Builder or bytes.Buffer, which cannot return write errors. No suppressions or analyzer changes.

Copilot AI changed the title [WIP] Fix ignored errors and discarded results in lint findings Handle ignored errors and discarded results Oct 25, 2026
Copilot AI requested a review from pelikhan October 25, 2026 13:25
@pelikhan
pelikhan marked this pull request as ready for review October 25, 2026 13:40
Copilot AI max review requested due to automatic review settings October 25, 2026 13:40
@pelikhan pelikhan closed this Oct 25, 2026

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.

🔵 Needs a closer look

Cross-cutting error-handling changes need human validation, and unresolved failure-path issues remain.

3 open issues
What changed in this PR

This PR improves error handling across gh-aw’s compiler, parser, CLI, and console, addressing ignored results while preserving tolerant parsing and best-effort cleanup.

Changes:

  • Propagates selected scanner, compiler-validation, temporary-file, and command-output failures.
  • Logs cleanup and rendering failures and makes optional-field type checks explicit.
  • Adds regressions for oversized lines, failed writes, malformed metadata, and traversal errors.
File Description
pkg/​workflow/​tools.go Checks event-map and event-type assertions explicitly.
pkg/​workflow/​skills_frontmatter.go Checks skill-reference types before use.
pkg/​workflow/​samples_validation.go Uses typed lookups while preserving schema fallbacks.
pkg/​workflow/​samples_replay.go Checks sampled workflow-name types.
pkg/​workflow/​safe_outputs_data_schema.go Makes schema-type checks explicit.
pkg/​workflow/​safe_outputs_call_workflow.go Uses typed tool-schema lookups.
pkg/​workflow/​runtime_overrides.go Uses typed runtime-option lookups.
pkg/​workflow/​run_step_sanitizer.go Checks environment and step-name lookups.
pkg/​workflow/​resolve.go Logs lock-file close failures.
pkg/​workflow/​plugins_frontmatter.go Checks plugin-reference types before use.
pkg/​workflow/​observability_otlp.go Makes optional telemetry-field lookups explicit.
pkg/​workflow/​mcp_setup_gateway.go Separates GitHub-tool presence from map lookup.
pkg/​workflow/​linear_safe_outputs.go Checks configuration-map assertions.
pkg/​workflow/​jira_tools.go Checks authentication and URL field types.
pkg/​workflow/​drive_memory_config.go Uses the tolerant boolean helper.
pkg/​workflow/​dependabot_reconcile.go Checks ecosystem and dependency-name types.
pkg/​workflow/​copilot_logs.go Checks wire-request field assertions.
pkg/​workflow/​compiler_yaml_step_conversion.go Uses a typed step-name lookup.
pkg/​workflow/​compiler_yaml_main_job.go Propagates allowed-domain computation errors.
pkg/​workflow/​compiler_yaml_main_job_test.go Tests malformed-model rejection before execution.
pkg/​workflow/​compiler_github_mcp_steps.go Checks GitHub guard configuration types.
pkg/​workflow/​compiler_difc_proxy.go Makes proxy configuration lookups explicit.
pkg/​workflow/​comment_memory.go Checks optional configuration-map assertions.
pkg/​workflow/​close_entity_helpers.go Uses a typed configuration-map lookup.
pkg/​workflow/​assign_to_user.go Uses a typed assignment configuration lookup.
pkg/​workflow/​add_reviewer.go Uses a typed reviewer configuration lookup.
pkg/​typeutil/​lookup.go Makes boolean assertion handling explicit.
pkg/​typeutil/​lookup_test.go Tests tolerant boolean parsing.
pkg/​scanfindings/​scanfindings.go Stops rendering after a write failure.
pkg/​scanfindings/​scanfindings_test.go Tests rendering termination on failed writes.
pkg/​parser/​remote_resolve_sha.go Logs API response-close failures.
pkg/​parser/​remote_download_file.go Logs download response-close failures.
pkg/​parser/​remote_client.go Logs contents-response close failures.
pkg/​parser/​include_processor.go Returns include-scanner completion errors.
pkg/​parser/​include_expander.go Removes one scanner limit and checks another scanner’s errors.
pkg/​parser/​include_expander_relativize_test.go Tests oversized lines and include-scanner failures.
pkg/​parser/​import_schema_validation.go Makes optional schema assertions explicit.
pkg/​parser/​frontmatter_extraction_test.go Tests markdown-section scanner failures.
pkg/​parser/​frontmatter_content.go Returns markdown-section scanning errors.
pkg/​fileutil/​fileutil.go Logs source-file close failures.
pkg/​console/​verbose.go Logs verbose-output write failures.
pkg/​console/​terminal.go Checks terminal-control and banner writes.
pkg/​console/​spinner.go Logs spinner execution and output failures.
pkg/​console/​prompt_form.go Returns setup-write errors and logs cleanup failures.
pkg/​console/​print.go Logs shared message-output failures.
pkg/​console/​output_failure_test.go Tests prompt failures and spinner cleanup.
pkg/​console/​list.go Returns list-output errors before reading input.
pkg/​console/​console.go Checks composed-section output writes.
pkg/​console/​confirm.go Returns confirmation-output errors before reading input.
pkg/​console/​banner.go Logs banner write failures.
pkg/​cli/​zizmor.go Iterates completion messages without a scanner limit.
pkg/​cli/​update_workflows.go Logs update response-close failures.
pkg/​cli/​update_github_api.go Checks contextual client types and response cleanup.
pkg/​cli/​update_extension_check.go Logs buffered upgrade-output replay failures.
pkg/​cli/​typeassertion_diagnostics_test.go Tests malformed optional metadata and tolerant fallbacks.
pkg/​cli/​trial_repository.go Logs confirmation-input errors without blocking setup.
pkg/​cli/​token_usage_subagent_session.go Logs token-usage session close failures.
pkg/​cli/​shellcheck.go Checks metadata types and temporary-file cleanup errors.
pkg/​cli/​shellcheck_test.go Tests temporary scripts and malformed step metadata.
pkg/​cli/​scanner_diagnostics_test.go Tests oversized records, includes, and scanner output.
pkg/​cli/​retry.go Logs repeat-status output failures.
pkg/​cli/​redacted_domains.go Logs domain-log close failures.
pkg/​cli/​project_command.go Uses the string helper for status-field IDs.
pkg/​cli/​observability_insights.go Stops insight rendering on write failure.
pkg/​cli/​model_routing.go Logs traversal and routing-file close failures.
pkg/​cli/​model_routing_session.go Logs routing-session close failures.
pkg/​cli/​mcp_safe_update_cache.go Handles cache close errors and removes incomplete files.
pkg/​cli/​mcp_safe_update_cache_test.go Tests manifest-cache writing and creation failures.
pkg/​cli/​mcp_registry.go Logs registry response-close failures.
pkg/​cli/​mcp_inspect_mcp.go Logs MCP session-close failures.
pkg/​cli/​logs_rate_limit.go Checks rate-limit warning writes.
pkg/​cli/​logs_github_rate_limit_usage.go Logs rate-limit file-close failures.
pkg/​cli/​logs_format_tsv.go Stops TSV rendering and logs failed writes.
pkg/​cli/​logs_download_zip.go Logs archive and entry close failures.
pkg/​cli/​includes.go Processes include lines without scanner token limits.
pkg/​cli/​imports.go Replaces string-backed scanners with line iteration.
pkg/​cli/​import_url_fetcher.go Logs HTTP response-close failures.
pkg/​cli/​gateway_logs_timeline.go Logs timeline and event-file close failures.
pkg/​cli/​gateway_logs_rpc.go Logs RPC message-file close failures.
pkg/​cli/​gateway_logs_parsing.go Logs gateway-log close failures.
pkg/​cli/​gateway_logs_mcp.go Logs tool-call source close failures.
pkg/​cli/​forecast_metadata.go Uses tolerant concurrency boolean parsing.
pkg/​cli/​firewall_policy.go Logs audit-file close failures.
pkg/​cli/​firewall_log.go Logs firewall-log close failures.
pkg/​cli/​experiments_fetch.go Parses evaluation records without scanner token limits.
pkg/​cli/​edit_command.go Returns output errors and preserves file-close errors.
pkg/​cli/​edit_command_test.go Tests edit-output failures without workflow mutation.
pkg/​cli/​domains_command.go Uses a typed tools-map lookup.
pkg/​cli/​deps_security.go Logs response-close and drain failures.
pkg/​cli/​deps_outdated.go Logs proxy response-close and drain failures.
pkg/​cli/​copilot_events_jsonl.go Logs event-file close failures.
pkg/​cli/​copilot_agents.go Logs agent-list response-close failures.
pkg/​cli/​copilot_agent.go Logs agent-log close failures.
pkg/​cli/​compile_watch.go Logs watcher-close failures.
pkg/​cli/​compile_update_check.go Logs release and probe response-close failures.
pkg/​cli/​codemod_bash_allowlist_unsupported_engine.go Uses typed lookups while preserving fallback behavior.
pkg/​cli/​cli_output_write_errors_test.go Tests renderer failures and preserved execution results.
pkg/​cli/​cleanup_traversal_test.go Tests traversal continuation and error logging.
pkg/​cli/​bootstrap_profile_github_app.go Checks listener cleanup and registration-page writes.
pkg/​cli/​bootstrap_config.go Stops checklist rendering on write failure.
pkg/​cli/​audit_threat_detection.go Logs threat-detection traversal and close failures.
pkg/​cli/​audit_threat_detection_session.go Logs unified-session close failures.
pkg/​cli/​audit_expanded.go Logs routing-artifact close failures.
pkg/​cli/​audit_cross_run_clusters_render.go Checks cluster-report writes and stops on failure.
pkg/​cli/​access_log.go Logs access-log close failures.
cmd/​gh-aw/​output_write_errors_test.go Tests version and usage-output error propagation.
cmd/​gh-aw/​main.go Returns version and usage-rendering write errors.

Review effort: Max

@@ -0,0 +1,73 @@
package cli
}

func TestWriteTempScriptFileCreationFailure(t *testing.T) {
t.Setenv("TMPDIR", filepath.Join(t.TempDir(), "missing"))
Comment on lines +37 to +41
if _, err := fmt.Fprintf(w, "# %d runs | %s duration | %s tokens | %d turns | %d errors\n",
s.TotalRuns, s.TotalDuration, formatTSVSummaryTokens(s.TotalTokens), s.TotalTurns, s.TotalErrors); err != nil {
logsTSVLog.Printf("Failed to write TSV summary: %v", err)
return
}
@github-actions
github-actions Bot deleted the copilot/lint-monster-handle-ignored-errors branch November 3, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[lint-monster] Handle ignored errors and discarded results

3 participants