Skip to content

Conversation

alecgrieser
Copy link
Collaborator

The metrics diff job failed when trying to compare two hashes: https://github.com/FoundationDB/fdb-record-layer/actions/runs/17979075422

This is because we are using the pull_request_target job type, and that only fetches the target's branch's state (so, main in this case), but we need to fetch both the PR head and the target head in order to compute the diff. We have to be a little careful, because the pull_request_target runs at heightened permissions (that is, including writes), so it is important it does not run any outside code. So in this fix, we fetch the PR head, but we do not check it out. We will continue to run the analysis tool from the target branch.

Hopefully, this unblocks the broken metrics diff job.

metrics-analysis:
runs-on: ubuntu-latest
permissions:
contents: read
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should have added this to say that this job is allowed to read contents from the git repo. The fact that we didn't wasn't causing us trouble (perhaps because the repo is public), but this is good practice.

@alecgrieser alecgrieser added the build improvement Improvement to the build system label Sep 24, 2025
@alecgrieser alecgrieser merged commit 127ab8e into FoundationDB:main Sep 24, 2025
8 of 9 checks passed
@alecgrieser alecgrieser deleted the metrics-diff-needs-pr branch September 24, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build improvement Improvement to the build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants