Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Only the first shallow call of a sequence of calls is recorded on shallow mode

未關閉
#355 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
ruby
領域
observability

研究方向

從 lib/appmap/hook/method.rb 中第 98 行附近的淺層 package 檢查開始,接著使用 minutes.ago 和 year.ago 重現 Calc 範例。檢查 AppMap.tracing 如何追蹤上一個 package,並評估以 stack 為基礎的方法,讓每個淺層呼叫都能被記錄,包括兩個 ago 呼叫。

由索引模型根據 Issue 內容生成。

描述

bug

While implementing the shallow mode for appmap-node agent I noticed this and it's been checked by @dividedmind:

I just checked and for example
require 'active_support/core_ext'

class Calc
  def calc x
    y = x.minutes.ago
    z = 1.year.ago
    y.to_i - z.to_i
  end
end

indeed only records #minutes, ignoring #year and both invocations of #ago.

It seems that the problem is with this line return false if hook_package&.shallow? && AppMap.tracing.last_package_for_current_thread == hook_package that checks the last recorded package. Because no other package is recorded between the calls mentioned, the last package stays the same. This causes subsequent calls to be skipped from recording, even if they are also "shallow" calls. A stack based approach can be used to fix this.

主要語言
Ruby
星號
101
分支
13
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

getappmap/appmap-ruby 的其他 Issue

查看 getappmap/appmap-ruby 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。