Skip to content

Commit

Permalink
Track revs that intentionally fork the reconciler (#24671)
Browse files Browse the repository at this point in the history
* Track revs that intentionaly fork the reconciler

When we fork the the "old" and "new" reconciler implementations, it can
be difficult to keep track of which commits introduced the delta
in behavior. This makes bisecting difficult if one of the changes
introduces a bug.

I've added a new file called `forked-revisions` that contains the list
of commits that intentionally forked the reconcilers.

In CI, we'll confirm that the reconcilers are identical except for the
changes in the listed revisions. This also ensures that the revisions
can be cleanly reverted.

* [TEST] Add trivial divergence between forks

This should fail CI. We'll see if the next commit fixes it.

* [TEST] Update list of forked revisions

This should fix CI

* Revert temporary fork

This reverts the temporary fork added in the previous commits that was
used to test CI.

* Update error message when CI fails
  • Loading branch information
acdlite authored Jun 6, 2022
1 parent 652dcf6 commit 4ddd8b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,24 @@ jobs:
- checkout
- run: yarn workspaces info | head -n -1 > workspace_info.txt
- *restore_node_modules
- run:
name: Fetch revisions that contain an intentional fork
# This will fetch each revision listed in the `forked-revisions` file,
# which may be necessary if it's not part of main. For example, it
# may have been part of a PR branch that was squashed on merge.
command: |
cut -d " " -f 1 scripts/merge-fork/forked-revisions | xargs -r git fetch origin
- run:
name: Revert forked revisions
# This will revert the changes without committing. At the end, it's
# expected that both forks will be identical.
command: |
cut -d " " -f 1 scripts/merge-fork/forked-revisions | xargs -r git revert --no-commit
- run:
name: Confirm reconciler forks are the same
command: |
yarn replace-fork
git diff --quiet || (echo "Reconciler forks are not the same! Run yarn replace-fork. Or, if this was intentional, disable this CI check." && false)
git diff --quiet || (echo "Reconciler forks are not the same! Run yarn replace-fork. Or, if this was intentional, add the commit SHA to scripts/merge-fork/forked-revisions." && false)
workflows:
Expand Down
Empty file.

0 comments on commit 4ddd8b4

Please sign in to comment.