Skip to content

Commit

Permalink
Merge branch 'main' into dwhiteddsoft/port-hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeee authored Mar 21, 2024
2 parents 4197373 + 372522a commit 06eb70e
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/dapr-bot-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
- ".github/workflows/dapr-bot-test.yml"
- ".github/workflows/dapr-bot/*"
pull_request:
branches:
- main
paths: # Explicitly declare which paths (could potentially be combined into dapr-bot*
- ".github/workflows/dapr-bot.yml"
- ".github/workflows/dapr-bot-test.yml"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/dapr-bot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ async fn main() -> octocrab::Result<()> {

if github_event_name != ISSUE_COMMENT_EVENT_NAME {
println!("Event is not an issue_comment, the app will now exit.");
exit(exitcode::TEMPFAIL);
exit(exitcode::TEMPFAIL); // This failure is because the bot is not
// designed to process anything other than an issue_comment
}

// deserialize event payload
Expand All @@ -52,7 +53,7 @@ async fn main() -> octocrab::Result<()> {
// check the issue body
if !event.clone().comment.body.unwrap().starts_with("/assign") {
println!("Event does not start with /assign");
exit(exitcode::TEMPFAIL);
exit(exitcode::OK);
}

let assignee: String = event.comment.user.login;
Expand All @@ -68,6 +69,7 @@ async fn main() -> octocrab::Result<()> {
.await
{
Ok(_) => {
println!("Assigned issue to user successfully");
match github_client
.create_comment(
OWNER,
Expand Down
90 changes: 82 additions & 8 deletions examples/pubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,88 @@ To run this example:
<!-- STEP
name: Run Subscriber
output_match_mode: substring
match_order: none
match_order: sequential
expected_stdout_lines:
- '== APP - rust-subscriber == Message: 0 => hello from rust!'
- '== APP - rust-subscriber == Content-Type: text/plain'
- '== APP - rust-subscriber == Message: 1 => hello from rust!'
- '== APP - rust-subscriber == Content-Type: text/plain'
- '== APP - rust-subscriber == Message: 2 => hello from rust!'
- '== APP - rust-subscriber == Content-Type: text/plain'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 0,'
- '== APP - rust-subscriber == order_details: "Count is 0",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 1,'
- '== APP - rust-subscriber == order_details: "Count is 1",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 2,'
- '== APP - rust-subscriber == order_details: "Count is 2",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 3,'
- '== APP - rust-subscriber == order_details: "Count is 3",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 4,'
- '== APP - rust-subscriber == order_details: "Count is 4",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 5,'
- '== APP - rust-subscriber == order_details: "Count is 5",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 6,'
- '== APP - rust-subscriber == order_details: "Count is 6",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 7,'
- '== APP - rust-subscriber == order_details: "Count is 7",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 8,'
- '== APP - rust-subscriber == order_details: "Count is 8",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic A - Order {'
- '== APP - rust-subscriber == order_number: 9,'
- '== APP - rust-subscriber == order_details: "Count is 9",'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 0,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 1,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 2,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 3,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 4,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 5,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 6,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 7,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 8,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-subscriber == Topic B - Refund {'
- '== APP - rust-subscriber == order_number: 9,'
- '== APP - rust-subscriber == refund_amount: 1200,'
- '== APP - rust-subscriber == }'
- '== APP - rust-publisher == messages published'
background: true
sleep: 30
Expand All @@ -54,4 +128,4 @@ dapr run --app-id rust-subscriber --app-protocol grpc --app-port 50051 cargo run
2. Run the publisher with dapr
```bash
dapr run --app-id rust-publisher --app-protocol grpc cargo run -- --example publisher
```
```

0 comments on commit 06eb70e

Please sign in to comment.