Skip to content

feat: Add support for Go callgraph processing#43

Merged
arunanshub merged 8 commits intomainfrom
feat/go-callgraph-plugin-support
Oct 5, 2025
Merged

feat: Add support for Go callgraph processing#43
arunanshub merged 8 commits intomainfrom
feat/go-callgraph-plugin-support

Conversation

@abhisek
Copy link
Member

@abhisek abhisek commented Oct 4, 2025

No description provided.

@abhisek abhisek requested review from a team and Copilot October 4, 2025 16:05
@safedep
Copy link

safedep bot commented Oct 4, 2025

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go @ v1.36.6-20250625184727-c923a0c2a132.1
go go.mod
✔️ ✔️ ✔️ 🔗
buf.build/gen/go/safedep/api/protocolbuffers/go @ v1.36.6-20250704090109-f29b2dffa5c5.1
go go.mod
✔️ ✔️ ✔️ 🔗
cel.dev/expr @ v0.24.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/MakeNowJust/heredoc @ v1.0.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/alessio/shellescape @ v1.4.1
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/antlr4-go/antlr/v4 @ v4.13.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/aymanbagabas/go-osc52/v2 @ v2.0.1
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/briandowns/spinner @ v1.23.2
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/charmbracelet/colorprofile @ v0.2.3-0.20250311203215-f60798e515dc
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/charmbracelet/lipgloss @ v1.1.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/charmbracelet/x/ansi @ v0.8.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/charmbracelet/x/cellbuf @ v0.0.13-0.20250311204145-2c3ea96c31dd
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/charmbracelet/x/term @ v0.2.1
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/creack/pty @ v1.1.24
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/davecgh/go-spew @ v1.1.2-0.20180830191138-d8f796af33cc
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/evilmartians/lefthook @ v1.13.6
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/fatih/color @ v1.18.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/gabriel-vasile/mimetype @ v1.4.10-rc1
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/go-json-experiment/json @ v0.0.0-20250910080747-cc2cfa0554c3
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/go-viper/mapstructure/v2 @ v2.4.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/gobwas/glob @ v0.2.3
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/goccy/go-json @ v0.10.5
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/goccy/go-yaml @ v1.18.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/golang/protobuf @ v1.5.4
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/google/cel-go @ v0.25.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/google/go-cmp @ v0.7.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/inconshreveable/mousetrap @ v1.1.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/kaptinlin/go-i18n @ v0.1.7
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/kaptinlin/jsonschema @ v0.4.14
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/kaptinlin/messageformat-go @ v0.4.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/knadh/koanf/maps @ v0.1.2
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/knadh/koanf/parsers/json @ v1.0.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/knadh/koanf/parsers/toml/v2 @ v2.2.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/knadh/koanf/parsers/yaml @ v1.1.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/knadh/koanf/providers/fs @ v1.0.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/knadh/koanf/v2 @ v2.3.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/lucasb-eyer/go-colorful @ v1.2.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/mattn/go-colorable @ v0.1.14
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/mattn/go-isatty @ v0.0.20
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/mattn/go-runewidth @ v0.0.16
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/mattn/go-tty @ v0.0.7
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/mitchellh/colorstring @ v0.0.0-20190213212951-d06e56a500db
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/mitchellh/copystructure @ v1.2.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/mitchellh/mapstructure @ v1.5.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/mitchellh/reflectwalk @ v1.0.2
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/muesli/termenv @ v0.16.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/oklog/ulid/v2 @ v2.1.1
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/pelletier/go-toml/v2 @ v2.2.4
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/pmezard/go-difflib @ v1.0.1-0.20181226105442-5d4384ee4fb2
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/rivo/uniseg @ v0.4.7
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/schollz/progressbar/v3 @ v3.18.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/spf13/afero @ v1.15.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/spf13/cobra @ v1.10.1
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/spf13/pflag @ v1.0.9
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/stoewer/go-strcase @ v1.3.0
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/stretchr/testify @ v1.11.1
go go.mod
✔️ ✔️ ✔️ 🔗
github.com/xo/terminfo @ v0.0.0-20220910002029-abceb7e1c41e
go go.mod
✔️ ✔️ ✔️ 🔗
go.uber.org/multierr @ v1.11.0
go go.mod
✔️ ✔️ ✔️ 🔗
go.uber.org/zap @ v1.27.0
go go.mod
✔️ ✔️ ✔️ 🔗
go.yaml.in/yaml/v3 @ v3.0.3
go go.mod
✔️ ✔️ ✔️ 🔗
golang.org/x/exp @ v0.0.0-20240909161429-701f63a606c0
go go.mod
✔️ ✔️ ✔️ 🔗
golang.org/x/mod @ v0.27.0
go go.mod
✔️ ✔️ ✔️ 🔗
golang.org/x/sys @ v0.35.0
go go.mod
✔️ ✔️ ✔️ 🔗
golang.org/x/term @ v0.32.0
go go.mod
✔️ ✔️ ✔️ 🔗
golang.org/x/text @ v0.29.0
go go.mod
✔️ ✔️ ✔️ 🔗
google.golang.org/genproto/googleapis/api @ v0.0.0-20250528174236-200df99c418a
go go.mod
✔️ ✔️ ✔️ 🔗
google.golang.org/genproto/googleapis/rpc @ v0.0.0-20250528174236-200df99c418a
go go.mod
✔️ ✔️ ✔️ 🔗
google.golang.org/protobuf @ v1.36.6
go go.mod
✔️ ✔️ ✔️ 🔗
gopkg.in/check.v1 @ v1.0.0-20201130134442-10cb98267c6c
go go.mod
✔️ ✔️ ✔️ 🔗
gopkg.in/natefinch/lumberjack.v2 @ v2.2.1
go go.mod
✔️ ✔️ ✔️ 🔗
sigs.k8s.io/yaml @ v1.4.0
go go.mod
✔️ ✔️ ✔️ 🔗

This report is generated by SafeDep Github App.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive support for Go callgraph processing by implementing Go-specific processors for function calls, method declarations, and function declarations, along with Go-specific node types and a test fixture.

  • Adds wrapper functions to conditionally handle Go-specific syntax tree nodes
  • Implements Go-specific processors for call expressions, function declarations, and method declarations
  • Includes comprehensive test cases with a Go test fixture

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
plugin/callgraph/processors.go Adds Go-specific processors and wrapper functions for handling Go callgraph processing
plugin/callgraph/plugin_test.go Adds comprehensive Go test case with expected call graph results
plugin/callgraph/nodeTypes.go Adds Go literal types and data structure types to existing maps
plugin/callgraph/fixtures/testCallGraph.go New test fixture file containing various Go function and method call patterns

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2025

Codecov Report

❌ Patch coverage is 49.62406% with 134 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.46%. Comparing base (6c4f6f1) to head (4771f9f).

Files with missing lines Patch % Lines
plugin/callgraph/processors.go 48.00% 114 Missing and 16 partials ⚠️
plugin/callgraph/imports.go 66.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #43      +/-   ##
==========================================
- Coverage   57.79%   57.46%   -0.34%     
==========================================
  Files          47       47              
  Lines        4580     4843     +263     
==========================================
+ Hits         2647     2783     +136     
- Misses       1709     1822     +113     
- Partials      224      238      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

github-actions bot commented Oct 4, 2025

vet Summary Report

This report is generated by vet

Policy Checks

  • ✅ Vulnerability
  • ✅ Malware
  • ✅ License
  • ❌ Popularity
  • ❌ Maintenance
  • ✅ Security Posture
  • ✅ Threats

Malicious Package Analysis

Malicious package analysis was performed using SafeDep Cloud API

Malicious Package Analysis Report
Ecosystem Package Version Status Report
ECOSYSTEM_GO github.com/creack/pty 1.1.24 🔗
ECOSYSTEM_GO github.com/MakeNowJust/heredoc 1.0.0 🔗
ECOSYSTEM_GO golang.org/x/sys 0.35.0 🔗
ECOSYSTEM_GO github.com/briandowns/spinner 1.23.2 🔗
ECOSYSTEM_GO github.com/charmbracelet/x/term 0.2.1 🔗
ECOSYSTEM_GO github.com/lucasb-eyer/go-colorful 1.2.0 🔗
ECOSYSTEM_GO github.com/goccy/go-yaml 1.18.0 🔗
ECOSYSTEM_GO github.com/schollz/progressbar/v3 3.18.0 🔗
ECOSYSTEM_GO github.com/mitchellh/copystructure 1.2.0 🔗
ECOSYSTEM_GO golang.org/x/mod 0.27.0 🔗
ECOSYSTEM_GO github.com/knadh/koanf/parsers/toml/v2 2.2.0 🔗
ECOSYSTEM_GO github.com/aymanbagabas/go-osc52/v2 2.0.1 🔗
ECOSYSTEM_GO github.com/knadh/koanf/maps 0.1.2 🔗
ECOSYSTEM_GO github.com/spf13/afero 1.15.0 🔗
ECOSYSTEM_GO github.com/evilmartians/lefthook 1.13.6 🔗
ECOSYSTEM_GO github.com/goccy/go-json 0.10.5 🔗
ECOSYSTEM_GO github.com/charmbracelet/colorprofile 0.2.3-0.20250311203215-f60798e515dc 🔗
ECOSYSTEM_GO github.com/kaptinlin/jsonschema 0.4.14 🔗
ECOSYSTEM_GO github.com/stretchr/testify 1.11.1 🔗
ECOSYSTEM_GO github.com/muesli/termenv 0.16.0 🔗
ECOSYSTEM_GO go.yaml.in/yaml/v3 3.0.3 🔗
ECOSYSTEM_GO github.com/mitchellh/reflectwalk 1.0.2 🔗
ECOSYSTEM_GO github.com/gabriel-vasile/mimetype 1.4.10-rc1 🔗
ECOSYSTEM_GO github.com/xo/terminfo 0.0.0-20220910002029-abceb7e1c41e 🔗
ECOSYSTEM_GO github.com/knadh/koanf/providers/fs 1.0.0 🔗
ECOSYSTEM_GO github.com/charmbracelet/x/ansi 0.8.0 🔗
ECOSYSTEM_GO github.com/spf13/pflag 1.0.9 🔗
ECOSYSTEM_GO github.com/kaptinlin/go-i18n 0.1.7 🔗
ECOSYSTEM_GO github.com/charmbracelet/lipgloss 1.1.0 🔗
ECOSYSTEM_GO github.com/go-viper/mapstructure/v2 2.4.0 🔗
ECOSYSTEM_GO github.com/mitchellh/colorstring 0.0.0-20190213212951-d06e56a500db 🔗
ECOSYSTEM_GO github.com/spf13/cobra 1.10.1 🔗
ECOSYSTEM_GO github.com/knadh/koanf/v2 2.3.0 🔗
ECOSYSTEM_GO github.com/charmbracelet/x/cellbuf 0.0.13-0.20250311204145-2c3ea96c31dd 🔗
ECOSYSTEM_GO github.com/knadh/koanf/parsers/yaml 1.1.0 🔗
ECOSYSTEM_GO github.com/kaptinlin/messageformat-go 0.4.0 🔗
ECOSYSTEM_GO github.com/mattn/go-tty 0.0.7 🔗
ECOSYSTEM_GO github.com/go-json-experiment/json 0.0.0-20250910080747-cc2cfa0554c3 🔗
ECOSYSTEM_GO github.com/pelletier/go-toml/v2 2.2.4 🔗
ECOSYSTEM_GO github.com/alessio/shellescape 1.4.1 🔗
ECOSYSTEM_GO gopkg.in/check.v1 1.0.0-20201130134442-10cb98267c6c 🔗
ECOSYSTEM_GO github.com/knadh/koanf/parsers/json 1.0.0 🔗
ECOSYSTEM_GO golang.org/x/term 0.32.0 🔗
  • ℹ️ 43 packages have been actively analyzed for malicious behaviour.
  • ✅ No malicious packages found.

Note: Some of the package analysis jobs may still be running.Please check back later. Consider increasing the timeout for better coverage.

Changed Packages

Changed Packages

  • ✅ [Go] github.com/charmbracelet/x/ansi@0.8.0
  • ⚠️ [Go] github.com/briandowns/spinner@1.23.2
  • ✅ [Go] github.com/evilmartians/lefthook@1.13.6
  • ✅ [Go] github.com/go-json-experiment/json@0.0.0-20250910080747-cc2cfa0554c3
  • ✅ [Go] go.yaml.in/yaml/v3@3.0.3
  • ✅ [Go] github.com/charmbracelet/colorprofile@0.2.3-0.20250311203215-f60798e515dc
  • ✅ [Go] golang.org/x/text@0.29.0
  • ⚠️ [Go] github.com/kaptinlin/messageformat-go@0.4.0
  • ⚠️ [Go] github.com/muesli/termenv@0.16.0
  • ⚠️ [Go] github.com/mattn/go-tty@0.0.7
  • ✅ [Go] github.com/spf13/cobra@1.10.1
  • ✅ [Go] github.com/knadh/koanf/v2@2.3.0
  • ✅ [Go] github.com/charmbracelet/lipgloss@1.1.0
  • ✅ [Go] github.com/go-viper/mapstructure/v2@2.4.0
  • ⚠️ [Go] github.com/pelletier/go-toml/v2@2.2.4
  • ⚠️ [Go] github.com/mitchellh/colorstring@0.0.0-20190213212951-d06e56a500db
  • ⚠️ [Go] github.com/kaptinlin/go-i18n@0.1.7
  • ✅ [Go] gopkg.in/check.v1@1.0.0-20201130134442-10cb98267c6c
  • ✅ [Go] github.com/charmbracelet/x/term@0.2.1
  • ✅ [Go] github.com/gabriel-vasile/mimetype@1.4.10-rc1
  • ⚠️ [Go] github.com/mitchellh/reflectwalk@1.0.2
  • ⚠️ [Go] github.com/schollz/progressbar/v3@3.18.0
  • ⚠️ [Go] github.com/goccy/go-json@0.10.5
  • ✅ [Go] github.com/knadh/koanf/parsers/toml/v2@2.2.0
  • ✅ [Go] github.com/stretchr/testify@1.11.1
  • ⚠️ [Go] github.com/lucasb-eyer/go-colorful@1.2.0
  • ⚠️ [Go] github.com/creack/pty@1.1.24
  • ✅ [Go] github.com/spf13/pflag@1.0.9
  • ✅ [Go] github.com/spf13/afero@1.15.0
  • ✅ [Go] github.com/charmbracelet/x/cellbuf@0.0.13-0.20250311204145-2c3ea96c31dd
  • ✅ [Go] stdlib@1.25.1
  • ✅ [Go] github.com/knadh/koanf/parsers/json@1.0.0
  • ✅ [Go] github.com/knadh/koanf/providers/fs@1.0.0
  • ⚠️ [Go] github.com/xo/terminfo@0.0.0-20220910002029-abceb7e1c41e
  • ⚠️ [Go] github.com/aymanbagabas/go-osc52/v2@2.0.1
  • ⚠️ [Go] github.com/MakeNowJust/heredoc@1.0.0
  • ⚠️ [Go] github.com/mitchellh/copystructure@1.2.0
  • ✅ [Go] github.com/knadh/koanf/parsers/yaml@1.1.0
  • ✅ [Go] github.com/goccy/go-yaml@1.18.0
  • ✅ [Go] github.com/alessio/shellescape@1.4.1
  • ✅ [Go] github.com/knadh/koanf/maps@0.1.2
  • ✅ [Go] golang.org/x/sys@0.35.0
  • ✅ [Go] golang.org/x/mod@0.27.0
  • ✅ [Go] github.com/kaptinlin/jsonschema@0.4.14
  • ✅ [Go] golang.org/x/term@0.32.0
Policy Violations

Packages Violating Policy

[Go] github.com/briandowns/spinner@1.23.2 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/kaptinlin/messageformat-go@0.4.0 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component popularity is low by Github stars count
  • ⚡ Use an alternative package that is popular

[Go] github.com/muesli/termenv@0.16.0 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/mattn/go-tty@0.0.7 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/pelletier/go-toml/v2@2.2.4 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/mitchellh/colorstring@0.0.0-20190213212951-d06e56a500db 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/kaptinlin/go-i18n@0.1.7 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component popularity is low by Github stars count
  • ⚡ Use an alternative package that is popular

[Go] github.com/mitchellh/reflectwalk@1.0.2 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/schollz/progressbar/v3@3.18.0 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/goccy/go-json@0.10.5 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/lucasb-eyer/go-colorful@1.2.0 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/creack/pty@1.1.24 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/xo/terminfo@0.0.0-20220910002029-abceb7e1c41e 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/aymanbagabas/go-osc52/v2@2.0.1 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/MakeNowJust/heredoc@1.0.0 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/mitchellh/copystructure@1.2.0 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

@arunanshub arunanshub merged commit 6ce4992 into main Oct 5, 2025
5 of 6 checks passed
@arunanshub arunanshub deleted the feat/go-callgraph-plugin-support branch October 5, 2025 06:59
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.

4 participants