Commit graph

184 commits

Author SHA1 Message Date
4276964f4d refactor: split server storage creation out from startup
Closes kemitix/git-next#75
2024-07-11 19:18:50 +01:00
9c20e780d0 feat: update auth of interal repos when changed in config
Closes kemitix/git-next#100
2024-07-10 09:05:36 +01:00
df352443b7 feat: GitDir tracks when repo is cloned by git-next 2024-07-06 15:08:13 +01:00
4e60be61f7 refactor: extract git::repository::factory module 2024-07-05 20:31:16 +01:00
5ab075c181 refactor: split git::repository::tests module 2024-07-05 20:12:17 +01:00
d9feaeaa7b chore: remove unused FakeOpenRepository 2024-07-05 20:12:17 +01:00
2e374d317a refactor: split git::repository::open::tests module 2024-07-05 20:12:17 +01:00
694135a10b fix: default log level is info
When RUST_LOG isn't set, the default log level is INFO rather than
ERROR.

Closes kemitix/git-next#104
2024-07-05 07:23:40 +01:00
c2953adba5 chore: remove unused token from github tests 2024-07-05 07:04:27 +01:00
7b19f3b66f chore: directly re-export function and type 2024-07-05 06:59:54 +01:00
12849d5a69 refactor: server no longer depends directly on git crate 2024-07-03 07:42:11 +01:00
3dec12de20 refactor: cli don't depend directly on git crate 2024-07-03 07:35:01 +01:00
83ce95776e fix: messages should always get delivered
Remove the async wrapper for sending messages as they were never being
delivered.
2024-07-02 18:51:40 +01:00
dfc0c1dc80 refactor: only start actor system when server starts 2024-07-01 06:54:07 +01:00
77d35e8a09 feat: load log levels from env RUST_LOG 2024-06-30 20:12:47 +01:00
c85eee85e9 refactor: file-watcher doesn't debug log on each loop 2024-06-30 20:12:35 +01:00
40c61fa9ff test: add more debug tracing 2024-06-30 19:42:09 +01:00
73ab149aba fix: github commit should use common headers 2024-06-30 19:30:22 +01:00
ae7933c79e fix: don't retry validation when non-retryable error
Closes kemitix/git-next#90
2024-06-30 18:48:49 +01:00
c9efbb9936 fix: ReceiveRepoConfig tries to send two messages
Similar to CloneRepo the handler tries to send two messages one after
the other. Leave it to WebhookRegistered handler to kick off the
ValidateRepo. Also update the README with the correct message sequence.
2024-06-30 16:59:24 +01:00
68005d757d fix: start validating repo after registering webhook
Clone Repo wasn't sending the second message, so workaround: have it be
sent after registering the webhook.
2024-06-30 16:54:26 +01:00
55d8ccb0bd feat: ignore github ping webhook messages
Closes kemitix/git-next#101
2024-06-30 15:20:00 +01:00
8fceafc3e1 refactor: repo-actor: replace Mutex with RwLock 2024-06-30 13:17:33 +01:00
73b416e3a0 refactor: git: replace Mutex with RwLock in Repository 2024-06-30 13:14:50 +01:00
52df2114e5 refactor: tests: repo-actor: use methods on RepoActorLog 2024-06-30 13:12:12 +01:00
3e137c6480 refactor: repo-actor: RepoActorLog: replace Mutex with RwLock 2024-06-30 12:40:17 +01:00
db90280641 fix: github: restarting server creates duplicate webhook for repo
The Github routine for registering a new webhook, wasn't removing any
existing matching webhooks. There is a test for this, but it doesn't
assert that the delete requests are made. (This is a limitation of
kxio).

Closes kemitix/git-next#102
2024-06-30 12:23:42 +01:00
975c9e315c fix: where repo config is in server should register webhook 2024-06-30 08:09:10 +01:00
0796df00d4 docs: fix typo 2024-06-30 08:00:51 +01:00
c571e9ee8d refactor: CloneRepo use actor::do_send to send LoadConfigFromRepo 2024-06-30 07:55:55 +01:00
32fb92fb8d refactor: remove dead code 2024-06-29 19:24:18 +01:00
717cc8b0bc refactor: update macro signatures and add documentation support 2024-06-29 18:26:19 +01:00
0fd33739c1 refactor: server: collapse tests to base of crate 2024-06-29 11:16:46 +01:00
113192042b refactos: extract server-actor crate 2024-06-29 11:14:09 +01:00
52d442f2b0 refactor: extract file-watcher-actor crate 2024-06-29 10:57:18 +01:00
2008afa4dd refactor: extract actor-macros crate 2024-06-29 10:49:12 +01:00
eba00a112f refactor: extract webhook actor 2024-06-29 08:25:16 +01:00
6d9eb0ab86 refactor: remove dead code 2024-06-29 07:01:31 +01:00
f460cd4b49 refactor: remove unused Forge Deref implementation 2024-06-29 07:01:31 +01:00
e585b07f6b tests: repo-actor: add more tests 2024-06-29 07:01:26 +01:00
ffab1986a7 refactor: repo-actor: rewrite tests using mockall 2024-06-27 18:58:47 +01:00
601e400300 refactor: forgejo: explain todo warnings 2024-06-20 19:09:50 +01:00
2cdaf39c0f refactor: git: use newtype 2024-06-20 19:06:24 +01:00
b9940cd205 tests: use println rather then eprintln in tests
This should reduce the noise in output when a test is running and passing.
2024-06-20 18:54:01 +01:00
8ce4528c88 chore: remove unused Fake repo facade 2024-06-20 18:28:05 +01:00
94ad2c441c refactor: create a RepositoryFactory trait 2024-06-20 18:28:01 +01:00
ea20afee12 refactor: config: use newtype 2024-06-19 08:16:54 +01:00
5e9f9eb80f refactor: start to use newtype macro 2024-06-19 06:45:45 +01:00
2e71e40378 refactor: add newtype macro 2024-06-16 08:00:00 +01:00
be78597331 tests: make TestRepository from git crate available to other crates 2024-06-14 09:05:11 +01:00
2acc43d3d6 chore: remove dead code 2024-06-14 08:19:55 +01:00
9b970835c8 refactor: clean up eprintln use 2024-06-13 20:00:04 +01:00
588666ffe1 tests: add more tests to git crate 2024-06-13 19:50:19 +01:00
926851db19 refactor: rewrite git crate's mock repository 2024-06-09 10:02:57 +01:00
dcd94736a9 refactor: git::push::reset takes all params as refs 2024-06-09 09:49:54 +01:00
c6a1d2c21b refactor: merge git::branch module into git::push 2024-06-09 09:49:54 +01:00
65e9ddf5db fix: remove unused GitDir::into_string() function 2024-06-09 09:49:54 +01:00
b5c0f5bd36 refactor: use given::a_name in config tests 2024-06-08 20:16:15 +01:00
aa817a8e95 refactor: tests: expand test given modules 2024-06-07 20:03:14 +01:00
271f4ec1dc tests: tidy up config, forgejo and git tests
Coverage for config, forge, forgejo and github is now 100%.
2024-06-06 17:45:33 +01:00
309e523cfe test: add more tests to forge-github crate 2024-06-06 07:57:44 +01:00
7b280a2a0a fix: github: as soon as any check fails, ignore any pending 2024-06-04 08:25:22 +01:00
46e2871e17 fix: github: use correct url to check CI status
There was a stray $ in the string interpolation (blame working on
Typescript for other projects) and the wrong query path.
2024-06-04 08:23:06 +01:00
e29c274aaf refactor: server: use thiserror 2024-06-03 20:34:01 +01:00
621e599b31 refactor: git: use thiserror and cleanup errors 2024-06-03 20:31:39 +01:00
0b8e41a8ec refactor: config: use thiserror and move tests about 2024-06-03 07:38:59 +01:00
235aee8b11 chore: remove unused dependencies
Identified using: cargo +nightly udeps --all-targets
2024-06-02 20:30:35 +01:00
c189aa3ad3 test: add more tests to forge-forgejo crate 2024-06-02 18:55:02 +01:00
98839c8a00 test: add more tests to forge crate 2024-06-01 12:03:30 +01:00
1010eaec64 tests: add more tests to config crate 2024-06-01 11:44:36 +01:00
1eb4ed6d23 fix: add missing list webhooks implementation 2024-05-31 08:09:00 +01:00
46b6d8680c feat: Add support for GitHub
This doesn't include GitHub Enterprise

Closes kemitix/git-next#86
2024-05-31 07:23:48 +01:00
206e64cd5b feat: Webhook query paths include forge alias
This allows for more than one forge to be configured and for the webhook
to correctly route incoming messages.
2024-05-29 19:35:50 +01:00
9f04b1ae6c fix: remove old implementation of forgejo get all branches 2024-05-28 06:45:49 +01:00
012668dd0a refactor: move git::remote_branches to git crate 2024-05-28 06:37:08 +01:00
f259179274 refactor: move git::read_file implementation to git crate 2024-05-26 18:22:15 +01:00
d0638fdbc4 refactor: move repo_clone implementation to git crate 2024-05-26 13:30:46 +01:00
f10dc25aeb refactor: merge git::validate module into git::validation 2024-05-26 09:20:08 +01:00
dd5532d3a3 refactor: move validate_positions into git crate 2024-05-26 09:20:05 +01:00
8a35911d00 refactor: get commit from from local repo (part 2/3)
Remove the legacy implementation
2024-05-26 08:07:12 +01:00
3642b2cdd1 fix: new commit_log matches original from API request
The original was including a lot of extra commits, those are now trimmed
to match the expected.
2024-05-25 20:36:24 +01:00
7a0247ea03 refactor: get commit log from local repo (step 1)
Avoid using a forge-specific API to get a commit log when the
information is already available locally in the cloned repo through a
generic git command.

The commit adds the new method of getting the commit log and compares it
with the original methods, logging if they match or not.

The updated results are returned only if they match.
2024-05-25 08:10:02 +01:00
7818b25a5c refactor: move forgejo branch test to forgejo crate 2024-05-24 07:07:01 +01:00
0202be19fe refactor: remove unused git branch error 2024-05-23 20:52:16 +01:00
4cd797ac0a build: forge only include forgejo crate when feature enabled 2024-05-23 19:41:50 +01:00
5253e136cc refactor: extract forge-forgejo crate 2024-05-23 19:36:05 +01:00
9e37c073c2 refactor(repo_actor): consitent use of config crate 2024-05-23 17:56:47 +01:00
17b1629cdf refactor(repo_actor): merge config and load modules 2024-05-23 17:53:36 +01:00
64cbe36dac refactor: move ForgeLike to git 2024-05-23 16:50:36 +01:00
639223fcaa refactor: improve consistency of use of git types 2024-05-23 16:19:28 +01:00
f2af849d0b refactor(forge): rename gitforge crate as forge 2024-05-23 16:04:38 +01:00
ebbb655bfc feat(server): config file watcher will respond to touch
You can now trigger a server reload by `touch`ing the
`git-next-server.toml` file.
2024-05-23 09:01:57 +01:00
d76be1197a test: don't record coverage for mock forge 2024-05-23 08:53:16 +01:00
4053563b30 refactor: move MessageToken to repo-actor crate 2024-05-23 08:52:42 +01:00
564e14a370 refactor(gitforge): disolve gitforge:errors module 2024-05-23 08:01:16 +01:00
db9b4220ee refactor: extract repo-actor and gitforge crates 2024-05-22 19:57:48 +01:00
ac25c9985e chore: remove feature declarations
git crate doesn't have and feature dependent code
2024-05-21 19:58:18 +01:00
df8ebc6af7 refactor(server): collapse type module into gitforge module 2024-05-21 19:47:01 +01:00
341dc97a51 refactor(git): add mock repository and tests
Repository is now behind an enum to allow selection of a mock Repsitory
for use in tests.
2024-05-21 19:47:01 +01:00
e5744e85ad fix(server): invalid webhook authorisations
Parameters had been passed in wrong order. Added strong types to prevent
a repeat.
2024-05-21 09:01:44 +01:00