Skip to content

node-checkout-and-setup: key the test fixture branch by tree SHA #35

Backlog

Description

@rekmarks-consensys-1

Problem

node-checkout-and-setup's tests read their fixture from a single branch, test-fixtures/node-checkout-and-setup, which node-checkout-and-setup/test/publish-fixture.sh force-pushes. The test workflow runs on every pull_request, and one of its jobs fails when the branch differs from the PR's node-checkout-and-setup/test-fixture. So:

  • Republishing the branch for one PR makes the fixture check fail on every other open PR until the change merges and they rebase.
  • Two open PRs that both change the fixture can't both pass.

Proposal

Name the fixture branch after the fixture's tree SHA:

tree="$(git rev-parse HEAD:node-checkout-and-setup/test-fixture)"
commit="$(git commit-tree "$tree" -m "Test fixture for node-checkout-and-setup")"
git push origin "$commit:refs/heads/test-fixtures/node-checkout-and-setup/$tree"
  • The workflow computes the same $tree from its own checkout and uses that branch wherever it now uses FIXTURE_BRANCH (several jobs; compute it per job or pass it as a job output).
  • The up-to-date job checks that the branch for its tree exists.
  • Each fixture version gets its own branch, nothing is force-pushed, and CI still needs no write access.
  • Cost: old fixture branches accumulate and need occasional cleanup. The existing branch must be republished under the new name.

Raised in review of #24.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions