fix: ReceiveRepoConfig tries to send two messages
All checks were successful
Rust / build (push) Successful in 1m26s
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful

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.
This commit is contained in:
Paul Campbell 2024-06-30 16:59:24 +01:00
parent 68005d757d
commit c9efbb9936
3 changed files with 0 additions and 37 deletions

View file

@ -3,7 +3,6 @@ stateDiagram-v2
[*] --> CloneRepo :on start
CloneRepo --> LoadConfigFromRepo :on repo config
CloneRepo --> ValidateRepo :on server config
CloneRepo --> RegisterWebhook :on server config
LoadConfigFromRepo --> ReceiveRepoConfig

View file

@ -14,12 +14,6 @@ impl Handler<actor::messages::ReceiveRepoConfig> for actor::RepoActor {
let repo_config = msg.unwrap();
self.repo_details.repo_config.replace(repo_config);
actor::do_send(
ctx.address(),
actor::messages::ValidateRepo::new(self.message_token),
&self.log,
);
actor::do_send(
ctx.address(),
actor::messages::RegisterWebhook::new(),

View file

@ -32,36 +32,6 @@ async fn should_store_repo_config_in_actor() -> TestResult {
Ok(())
}
#[actix::test]
async fn should_validate_repo() -> TestResult {
//given
let fs = given::a_filesystem();
let (open_repository, repo_details) = given::an_open_repository(&fs);
let new_repo_config = given::a_repo_config();
//when
let (addr, log) = when::start_actor_with_open_repository(
Box::new(open_repository),
repo_details,
given::a_forge(),
);
addr.send(actor::messages::ReceiveRepoConfig::new(
new_repo_config.clone(),
))
.await?;
System::current().stop();
//then
tracing::debug!(?log, "");
log.read().map_err(|e| e.to_string()).map(|l| {
assert!(l
.iter()
.any(|message| message.contains("send: ValidateRepo")))
})?;
Ok(())
}
#[actix::test]
async fn should_register_webhook() -> TestResult {
//given