Skip to content

[DO NOT MERGE] GHCP — Crawl: Ex15 Resilience and Failure Tests#125

Open
nikhil2611 wants to merge 1 commit into
learn/crawl/nikhil-ex14-static-analysisfrom
learn/crawl/nikhil-ex15-resilience
Open

[DO NOT MERGE] GHCP — Crawl: Ex15 Resilience and Failure Tests#125
nikhil2611 wants to merge 1 commit into
learn/crawl/nikhil-ex14-static-analysisfrom
learn/crawl/nikhil-ex15-resilience

Conversation

@nikhil2611
Copy link
Copy Markdown
Contributor

Summary

Added error-mapping rescue block to knife status#run so HTTP 5xx and network failures produce a clear fatal message + exit 1 instead of a raw stack trace. Added 2 failure tests proving both paths.

Evidence

bundle exec rspec spec/unit/knife/status_spec.rb
23 examples, 0 failures

bundle exec cookstyle --chefstyle -c .rubocop.yml
376 files inspected, no offenses detected

Failure tests:

  • when the Chef Server returns an HTTP errorui.fatal + exit 1
  • when the network is unreachable (SocketError)ui.fatal + exit 1

Review Focus

  • lib/chef/knife/status.rb lines 76–90 — begin/rescue block wrapping search; verify two rescue clauses
  • spec/unit/knife/status_spec.rb"resilience: error mapping" context (last 20 lines)
  • ai-track-docs/resilience.md — documents failure modes, code location, and why error mapping over retry

Verification Steps

bundle exec rspec spec/unit/knife/status_spec.rb -e "resilience"
# Expect: 2 examples, 0 failures

bundle exec rspec spec/unit/knife/status_spec.rb
# Expect: 23 examples, 0 failures

Risk

Low — rescue clauses only trigger on exception; happy path is unchanged. Scoped to knife status.

Rollback

git revert HEAD

@nikhil2611 nikhil2611 requested review from a team and jaymzh as code owners May 22, 2026 05:23
@nikhil2611 nikhil2611 added the ai-assisted Work completed with AI assistance following Progress AI policies label May 22, 2026
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex14-static-analysis branch from 51e9d44 to 24f85fa Compare May 22, 2026 08:25
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex15-resilience branch from 89dcb4a to 651368b Compare May 22, 2026 08:25
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex14-static-analysis branch from 24f85fa to 4570af5 Compare May 22, 2026 08:32
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex15-resilience branch from 651368b to a150c93 Compare May 22, 2026 08:32
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex14-static-analysis branch from 4570af5 to 7556832 Compare May 22, 2026 08:54
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex15-resilience branch from a150c93 to 8d486de Compare May 22, 2026 08:54
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex14-static-analysis branch from 7556832 to f4f2bad Compare May 22, 2026 11:26
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex15-resilience branch from 8d486de to f16dbb2 Compare May 22, 2026 11:26
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex14-static-analysis branch from f4f2bad to 9be9b26 Compare May 22, 2026 11:38
Signed-off-by: nikhil2611 <ngupta@progress.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nikhil2611 nikhil2611 force-pushed the learn/crawl/nikhil-ex15-resilience branch from f16dbb2 to dcdcbc8 Compare May 22, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Work completed with AI assistance following Progress AI policies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants