-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup: allow analysis of merge commits #730
Conversation
Follows updates to CodeQL integration guidance per github/codeql-action#297
None of this explains why. Can you share why we would or why it didn't used to suggest this and nwo does? |
In short, it's that the CodeQL analysis action has been updated to detect and analyze the content changes applied during merge commits. Previously after a pull request was merged, the CodeQL action would have naively analyzed the HEAD (merge) commit, which in itself does not include content modifications. What a merge commit does have, however, are merged commit references. For a merged pull request, the first merge reference would be the parent (previous) commit, and the second merge reference (HEAD^2) would include the contents of the pull request. (probably a few technical inaccuracies there, but that's roughly as I understand it currently) All things being equal, a simpler and easier to read configuration seems better, especially if it matches the recommended guidance. Your question's given me pause though, and so I'm digging through the CodeQL action itself to see exactly how it detects and handles merge commits. |
Yep - going by the plugin's source code, since the end-of-November release of |
@sigmavirus24 Any more comments on this? Is it okay to merge? |
No other comments or thoughts |
Some retrospection about this pull request: I answered more of the what about this change than the why. It's true that this was newly available CodeQL functionality, and that it had become a recommended practice, but that didn't directly address the question, so my apologies. In On the CodeQL side: that tooling may have begun analyzing merge commits because those commits can include previously-unseen changes introduced during conflict resolution. In other words: although from a cursory (automated or human) inspection, a merge commit may appear to simply combine together two existing, known components -- and, often, that is indeed the sum total of what it does -- sometimes a merge commit can also include a conflict resolution edit (a change that may be less-well-reviewed and/or accident-prone -- and worth analyzing). I don't know whether that's helpful context, especially relatively long after-the-fact, but it's an attempt to improve upon my previous responses. |
Follows updates to CodeQL integration guidance per github/codeql-action#297