Skip to content

🐛 Use GitLab diff head SHA for CI-Tests statuses#5074

Open
bmendonca3 wants to merge 1 commit into
ossf:mainfrom
bmendonca3:fix-gitlab-ci-tests-head-sha
Open

🐛 Use GitLab diff head SHA for CI-Tests statuses#5074
bmendonca3 wants to merge 1 commit into
ossf:mainfrom
bmendonca3:fix-gitlab-ci-tests-head-sha

Conversation

@bmendonca3

Copy link
Copy Markdown

Fixes #3701.

What

  • query GitLab merge requests for diffHeadSha
  • use diffHeadSha as the associated merge request HeadSHA, falling back to mergeCommitSha if needed
  • avoid mapping an empty merge commit SHA back to a merge request
  • add a regression test for fast-forward-style merge requests where mergeCommitSha is empty

Testing

  • GOTOOLCHAIN=local /tmp/scorecard-go-toolchain/go/bin/go test ./clients/gitlabrepo
  • GOTOOLCHAIN=local /tmp/scorecard-go-toolchain/go/bin/go test ./checks/raw -run TestCITests -count=1
  • GOTOOLCHAIN=local /tmp/scorecard-go-toolchain/go/bin/go test ./clients/gitlabrepo ./checks/raw
  • git diff --check

Signed-off-by: bmendonca3 <208517100+bmendonca3@users.noreply.github.com>
@bmendonca3 bmendonca3 requested a review from a team as a code owner May 29, 2026 01:42
@bmendonca3 bmendonca3 requested review from AdamKorcz and justaugustus and removed request for a team May 29, 2026 01:42
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 29, 2026

@justaugustus justaugustus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See note about AI contributions —> ossf/allstar#841 (comment)

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

This pull request has been marked stale because it has been open for 10 days with no activity

@github-actions github-actions Bot added the Stale label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files. Stale

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

BUG: CI-Tests: internal error: internal error: Client.Repositories.ListStatuses: error getting commit statuses

2 participants