Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor commands #167

Merged
merged 2 commits into from
Dec 21, 2023
Merged

Refactor commands #167

merged 2 commits into from
Dec 21, 2023

Conversation

dfarr
Copy link
Member

@dfarr dfarr commented Dec 20, 2023

Refactors the serve and dst commands to conform to new style.

Additionally:

  • changes the client to use a response client
  • minor changes to the openapi spec
  • pretty prints promises and schedule responses
  • adds tick time to promise timeout time in schedule promises coroutine
  • some additional renaming

@dfarr dfarr requested a review from guergabo December 21, 2023 00:00
Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 285 lines in your changes are missing coverage. Please review.

Comparison is base (657098b) 67.29% compared to head (67353ab) 66.08%.
Report is 13 commits behind head on main.

Files Patch % Lines
cmd/promises/promises.go 0.00% 92 Missing ⚠️
cmd/promises/complete.go 0.00% 76 Missing ⚠️
cmd/promises/search.go 0.00% 53 Missing ⚠️
cmd/promises/get.go 0.00% 38 Missing ⚠️
cmd/promises/create.go 77.94% 11 Missing and 4 partials ⚠️
cmd/util/flags.go 0.00% 5 Missing ⚠️
cmd/util/util.go 0.00% 5 Missing ⚠️
internal/app/coroutines/schedulePromises.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #167      +/-   ##
==========================================
- Coverage   67.29%   66.08%   -1.22%     
==========================================
  Files          76       78       +2     
  Lines        7308     7698     +390     
==========================================
+ Hits         4918     5087     +169     
- Misses       2071     2275     +204     
- Partials      319      336      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -53,7 +53,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/PromiseList"
$ref: "#/components/schemas/PromiseSearchResponse"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's update durable-promise repo with this new spec.

@@ -108,7 +108,7 @@ func schedulePromise(tid string, schedule *schedule.Schedule) *scheduler.Corouti
Id: id,
State: state,
Param: schedule.PromiseParam,
Timeout: schedule.PromiseTimeout,
Timeout: crontime + schedule.PromiseTimeout,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch.

cmd.Println(string(promise))
}
} else {
prettyPrintPromises(cmd, *resp.JSON200.Promises...)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: smart formatting thing. let's do if { return } prett instead of if else{} more idiomatic and nicer to read. would love this standard for this repo in general.

@dfarr dfarr merged commit 0f66f64 into main Dec 21, 2023
4 of 6 checks passed
@dfarr dfarr deleted the refactor/cmd branch December 21, 2023 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants