Skip to content

Stabilize integration-test-result placement via filtering by external_id #27

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

Merged

Conversation

michaelfig
Copy link
Member

@michaelfig michaelfig commented Apr 6, 2025

This PR makes integration-test-result consistently placed as Integration tests / integration-test-result):
image

Past runs without this PR's changes have random placement of integration-test-result (a data race while creating checks that's really easy to lose):

@michaelfig michaelfig added the force:integration Force integration tests to run on PR label Apr 6, 2025
@michaelfig michaelfig added automerge:squash Automatically squash merge and removed force:integration Force integration tests to run on PR labels Apr 6, 2025
@michaelfig michaelfig marked this pull request as ready for review April 6, 2025 04:15
@mergify mergify bot merged commit 4685ba3 into Agoric:main Apr 6, 2025
30 checks passed
@michaelfig michaelfig requested review from mhofman and frazarshad April 6, 2025 04:17
@michaelfig
Copy link
Member Author

@mhofman, I accidentally merged this PR!

Feel free to revert if it's interfering with the repo... I mainly just wanted to get your feedback on it (and yours, too @frazarshad, since you appear to be doing CI tweaks as well) before proposing similar changes in a PR for Agoric SDK.

@mhofman
Copy link
Member

mhofman commented Apr 6, 2025

This PR makes integration-test-result consistently placed as Integration tests / integration-test-result):

This would be great, but afaik, this is not something we get to control. I don't understand how this PR would do that?

@mhofman
Copy link
Member

mhofman commented Apr 6, 2025

Feel free to revert if it's interfering with the repo...

Yeah we should revert and reproduce the issue here if you believe this is a fix.

I think we may need to create a few other workflows in this repo, see on which ones the "result" check attaches to.

My understanding is that there is no way to control which "check suite" a check run created through the API ends up attached to: https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run

@mhofman
Copy link
Member

mhofman commented Apr 6, 2025

This answers confirms there is no way to specify the suite: https://github.com/orgs/community/discussions/24616#discussioncomment-3244677

@michaelfig
Copy link
Member Author

This PR makes integration-test-result consistently placed as Integration tests / integration-test-result):

This would be great, but afaik, this is not something we get to control. I don't understand how this PR would do that?

there is no way to specify the suite

Correct, but we can create and query by the external_id (embedding a run number and an attempt number in that ID to ensure we're not getting unrelated attempts when we query for it).

We had nearly all the ingredients; the old code does its best to propagate and limit the checks query to a specific external_id, which should attach the check to a specific workflow run. Turns out, upon rereading the octokit docs for github.rest.checks.listForRef, I had misunderstood its arguments (specifying the external_id as a property in the listForRef had no effect).

When digging deeper, that query was not filtering by external_id, and so I needed to filter the returned runs by it afterward. That worked.

Without that explicit filter, we'd get the newest check to update, but no guarantee that the check was the one we had stamped with the external_id.

@michaelfig
Copy link
Member Author

Feel free to revert if it's interfering with the repo...

Yeah we should revert and reproduce the issue here if you believe this is a fix.

I did reproduce it, in the multiple runs on this PR, as well as by investigating other green PRs in this repro.

After this PR, there is no instability.

I think we may need to create a few other workflows in this repo, see on which ones the "result" check attaches to.

We have other workflows, and without this PR, it reproduces as unstable.

My understanding is that there is no way to control which "check suite" a check run created through the API ends up attached to: https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run

I'm not creating a check in an explicit "check suite". I'm creating it in an explicit "workflow run".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:squash Automatically squash merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants