Commit Graph

12 Commits

Author SHA1 Message Date
Tim Hockin 6af1e6921d Add lint for shellcheck, fix issues 2024-07-04 15:25:25 -07:00
Tim Hockin 750e20e6da Set git `safe.directory` in tool containers
Otherwise it hit the "dubious ownership" case.
2024-06-09 00:57:47 -07:00
Tim Hockin af6b96ab74 Add e2e for username/password over HTTP 2023-09-19 14:57:41 -07:00
Tim Hockin 55f71d55ed Add a test case for submodules with diff SSH keys 2023-09-19 13:31:19 -07:00
Tim Hockin 1894192b0f Run hooks at startup
This ensures we do not miss events.  E.g.

before:
    t0: hash changes to X
    t1: send webhook(X), waiting for response
    t2: hash changes to Y
    t3: queue next webhook(Y) but can't send because previous is not done
    t4: crash
    t5: restart
    t6: find repo at hash Y

    no webhook(Y) was sent.

after:
    t0: hash changes to X
    t1: send webhook(X), waiting for response
    t2: hash changes to Y
    t3: queue next webhook(Y) but can't send because previous is not done
    t4: crash
    t5: restart
    t6: find repo at hash Y
    t7: send webhook(Y), waiting for response
2023-05-29 14:50:24 -07:00
Tim Hockin 10af97f51d Move worktrees to .worktrees/*
This will make it easier to enumerate old worktrees and do better
cleanup.
2023-04-29 10:51:13 -07:00
Tim Hockin ee6664748f Total overhaul of sync loop
The previous (v3) sync loop betrays my lack of understanding about git.
It tried to codify my archaic mental model (e.g. --branch and --rev
being disting things) and was ultimately a patchwork of corner-cases
evolved over a few years.

This commit is less of a "diff" and more of a "rewrite".

The new logic is simpler and more efficient.  It does not `git clone`
ever.  It does not differentiate the first sync from subsequent syncs.
It uses `git fetch` to get the exact SHA and then makes a worktree from
that.

The new `--ref` flag replaces both `--rev` and `--branch`, though it
will use those if specified.  In fact, almost all of the e2e tests
passed without change - using --ref and --branch!

I will follow this commit up with more cleanups and e2es.
2023-04-21 17:25:25 -07:00
Tim Hockin c5dcd87551
e2e: move helper scripts to _test_tools/ 2023-02-15 12:22:29 -08:00
Tim Hockin ec25d1a3f5 e2e: Fix ncsvr to wait for input on HTTP
This caused occasional e2e flakes when the server responded before the
client request had been sent.
2022-07-03 11:36:05 -07:00
Tim Hockin 0222a95f29 Make sure all code files have headers 2021-05-27 08:46:00 -07:00
Tim Hockin a285a770e2 Use docker to run helper servers in e2e
Reliably cleaning up leftover things like `nc` processes is surprisingly
difficult in pure shell.  e2e passes on the master branch now.
2021-01-23 15:59:24 -08:00
Tim Hockin 1a1dd1cbe0 e2e: Add test for SSH
This requires having a docker image for git-over-ssh.
2020-01-07 08:25:36 -08:00