Skip to content

Conversation

@europaul
Copy link
Contributor

@europaul europaul commented Nov 13, 2025

Description

Closes #5296

  • Add pr_base_ref capture in pr-gate.yml
  • Create eden-version-map.yml with branch-to-version mapping
  • Modify eden-trusted.yml to select Eden version dynamically
  • Map LTS branches (13.4-stable, 14.5-stable) to Eden 1.0.9
  • Map all other branches to latest Eden 1.0.13

GH actions don't support dynamic workflow names, so we have to take a workaround through scripts.

I didn't find a way to test it without merging, if somebody knows how - please let me know. On a PR to my own fork the Eden actions don't run.

PR dependencies

None

How to test and validate this PR

Run it in the CI.

Changelog notes

CI: add Eden version selection based on PR target branch

PR Backports

- 16.0: To be backported.
- 14.5-stable: To be backported.
- 13.4-stable: To be backported.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

- Add pr_base_ref capture in pr-gate.yml
- Create eden-version-map.yml with branch-to-version mapping
- Modify eden-trusted.yml to select Eden version dynamically
- Map LTS branches (13.4-stable, 14.5-stable) to Eden 1.0.9
- Map all other branches to Eden 1.0.13

GH actions don't support dynamic workflow names, so we have to take a workaround through scripts.

Signed-off-by: Paul Gaiduk <[email protected]>
echo "pr_id=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
echo "pr_sha=$pr_sha" >> "$GITHUB_OUTPUT"
echo "original_run_id=$original_run_id" >> "$GITHUB_OUTPUT"
echo "pr_base_ref=${{ github.event.pull_request.base.ref }}" >> "$GITHUB_OUTPUT"

Check failure

Code scanning / zizmor

code injection via template expansion Error

code injection via template expansion
Comment on lines +187 to +188
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Check warning

Code scanning / zizmor

credential persistence through GitHub Actions artifacts Warning

credential persistence through GitHub Actions artifacts
echo "pr_id=${{ steps.from_run.outputs.pr_id || steps.from_review.outputs.pr_id }}" >> "$GITHUB_OUTPUT"
echo "pr_sha=${{ steps.from_run.outputs.pr_sha || steps.from_review.outputs.pr_sha }}" >> "$GITHUB_OUTPUT"
echo "original_run_id=${{ steps.from_run.outputs.original_run_id || steps.from_review.outputs.original_run_id }}" >> "$GITHUB_OUTPUT"
echo "pr_base_ref=${{ steps.from_run.outputs.pr_base_ref || steps.from_review.outputs.pr_base_ref }}" >> "$GITHUB_OUTPUT"

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion
echo "pr_id=${{ steps.from_run.outputs.pr_id || steps.from_review.outputs.pr_id }}" >> "$GITHUB_OUTPUT"
echo "pr_sha=${{ steps.from_run.outputs.pr_sha || steps.from_review.outputs.pr_sha }}" >> "$GITHUB_OUTPUT"
echo "original_run_id=${{ steps.from_run.outputs.original_run_id || steps.from_review.outputs.original_run_id }}" >> "$GITHUB_OUTPUT"
echo "pr_base_ref=${{ steps.from_run.outputs.pr_base_ref || steps.from_review.outputs.pr_base_ref }}" >> "$GITHUB_OUTPUT"

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion
echo '{ "pr_id": "${{ steps.meta.outputs.pr_id }}",
"original_run_id": "${{ steps.meta.outputs.original_run_id }}",
"pr_sha": "${{ steps.meta.outputs.pr_sha }}",
"pr_base_ref": "${{ steps.meta.outputs.pr_base_ref }}",

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion
eve_artifact_name: "eve-${{ needs.context.outputs.hv }}-${{ needs.context.outputs.arch }}-${{ needs.context.outputs.platform }}"
artifact_run_id: ${{ needs.context.outputs.original_run_id }}
eden_version: "1.0.13"
runs-on: ubuntu-latest
Copy link
Member

Choose a reason for hiding this comment

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

This part (replacing shared action with the script) should be extra carefully tested in some other repo first. It can break how Eden tests are reported, how we set statuses for them, how we check the statuses between restarts, how we decide on which tests to restart, etc.
In general, can we avoid replacing shared action with the script?...

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Select Eden version based on target branch
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I expected an approach like this...

@OhmSpectator
Copy link
Member

Here is my recomendations for the PR testing.

I assume that the basic part is already covered by the @europaul: for PRs that target different branches, check that the GitHub Action picks the correct Eden version according to the current selection logic.

The list below is about extra checks. They focus on how approval and build order interact with Eden, and on the fragile, hand-written logic for rendering and restarting tests.

PR is approved first, build finishes later

When the PR is approved by a maintainer before the build is done, check that Eden tests start automatically after the build completes. Confirm that the Eden version is the right one for this PR. This path uses one way of collecting metadata, so it is important to see that the version choice is correct here.

Build finishes first, PR is approved later

Now do the opposite: let the build finish first, and only then approve the PR.
After approval, Eden tests must start and again use the correct Eden version for this PR.
Internally this uses a different metadata path than case 1, so both directions must be tested, even if they look very similar from the outside.

Rendering of Eden subtests and initial yellow state

Once Eden tests start, the PR page should show the full list of Eden subtests.
This list is not something that comes for free from GitHub; it is rendered manually, so it is easy to break.
While at least one subtest is still running, all of them should be yellow or “pending”.

Final state after the first Eden run finishes

When the first Eden run is completely done, every subtest should move from yellow to its final color: green if it passed, red if it failed.
The overall Eden status on the PR page must match the aggregate result: green if everything is green, red if there is at least one red test.
Yes, tests status on the PR page is hand-written and not comes from GH.

Restarting tests via maintainer “Restart ALL tests”

After the first run you should have a realistic situation with some green and some red subtests. Ask a maintainer to click “Restart ALL tests” (not "restart failed tests"!!! in this case the status will not be updated on the PR page!).
Check the statuses from the PR page, not only from the action page! We check here how we render this info for the PR page!
The expected behaviour is: all tests that were red are restarted and become yellow again, and all tests that were green stay green and are not restarted.
The overall Eden status should go back to yellow while the restarted tests are running, and then again to green or red based on the second run.
This part is important because the restart logic is manual and partly based on parsing the names of tests in the rendered status, which makes it quite fragile.

Restarting tests via /restart red comment from a developer

Take the same situation: the first run is finished, we have a mix of green and red tests.
This time, instead of the maintainer button, a regular developer posts a comment /restart red on the PR.
The expected behaviour is exactly the same as above: previously red tests are restarted and turn yellow, previously green tests stay green and are not touched and all this is rendered properly on the PR page.
The overall status should again go to yellow during the rerun and then settle into green or red according to the results.
This flow is just as important as the maintainer button, because it uses the similar (but not the same!) fragile logic underneath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Eden version selection per PR target branch in workflows

2 participants