GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix `getCommitOid` stubs by mbg · Pull Request #4163 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Sep 23, 2026

Copy link
Copy Markdown
Member

Copilot noted in #4148 (comment) that most of the stubs for getCommitOid weren't correctly set up: the broken stubs assumed that getCommitOid only had one parameter for the ref, while it actually has two for checkoutPath and ref. This meant that calls to the stubbed getCommitOid weren't working as intended and always received undefined.

This PR updates the tests to stub getCommitOid correctly so that the tests work as intended. It also adds test assertions to verify that getCommitOid is called the expected number of times and with the expected arguments.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

  • Testing/None - This change does not impact any CodeQL workflows in production.

How did/will you validate this change?

  • Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Development/testing only - This change cannot cause any failures in production.

How will you know if something goes wrong after this change is released?

Changes are for tests only and will not be released.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mbg added 2 commits September 23, 2026 13:31
@mbg
Fix getCommitOid stubs
9c9e4b0
@mbg
Stub getCommitOid correctly and check calls
4227741
@mbg
mbg requested a review from a team as a code owner September 23, 2026 12:43
Copilot AI balanced review requested due to automatic review settings September 23, 2026 12:43
@github-actions github-actions Bot added the size/S Should be easy to review label Sep 23, 2026
Copilot started reviewing on behalf of mbg September 23, 2026 12:44
View session
Copilot AI reviewed Sep 23, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The test-only changes accurately reflect the function signature and expected call behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Corrects getCommitOid test stubs so getRef tests exercise the intended branches.

Changes:

  • Matches both checkoutPath and ref arguments.
  • Verifies call counts and arguments.
  • Rejects unexpected calls in the head-ref test.
File Description
src/​git-utils.test.ts Corrects and strengthens getCommitOid stubbing and assertions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg mbg mentioned this pull request Sep 23, 2026
Validate checkout_path input in analyze action #4148
Merged
mario-campos
mario-campos approved these changes Sep 24, 2026
View reviewed changes
@mbg
mbg added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit 26cb08b Sep 24, 2026
234 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg deleted the mbg/fix-getCommitOid-stubs branch September 24, 2026 07:19
This was referenced Sep 24, 2026
Merge main into releases/v4 #4168
Merged
Merge releases/v4 into releases/v3 #4171
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@mario-campos mario-campos mario-campos approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size/S Should be easy to review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mbg @mario-campos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.