Skip to content

Conversation

@owen-mc
Copy link
Contributor

@owen-mc owen-mc commented Sep 11, 2025

We should be testing post-update nodes for method calls. It turns out that we don't generate post-update nodes for receivers of method calls when they are made indirectly, via a variable. (The code looks like it tries to, but actually it will never work.) It won't always be possible to find the receiver, but when it is we probably ought to. But that is future work.

Copilot AI review requested due to automatic review settings September 11, 2025 10:34
@owen-mc owen-mc requested a review from a team as a code owner September 11, 2025 10:34
@owen-mc owen-mc added the no-change-note-required This PR does not need a change note label Sep 11, 2025
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 improves testing for post-update nodes in Go data flow analysis by expanding test coverage to include method calls. The change reveals that post-update nodes are not generated for receivers of indirect method calls (calls made through variables), which is noted as future work to address.

Key changes:

  • Enhanced the test query to display both post-update nodes and their corresponding pre-update nodes
  • Added test cases for direct and indirect method calls to verify post-update node generation

Reviewed Changes

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

File Description
test.ql Modified query to output pre-update nodes alongside post-update nodes for better test visibility
test.go Added method definitions and test cases for direct/indirect method calls to expand test coverage
test.expected Updated expected output to reflect the enhanced query results and new test cases

@github-actions github-actions bot added the Go label Sep 11, 2025
@owen-mc owen-mc merged commit f74913a into github:main Sep 11, 2025
14 checks passed
@owen-mc owen-mc deleted the go/improve-pun-tests branch September 11, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Go no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants