-
Notifications
You must be signed in to change notification settings - Fork 237
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
Add API bindings for the pipeline scheduling REST API #702
Conversation
} | ||
|
||
type ScheduleInterface interface { | ||
Schedules(vcs, org, project string) (*[]Schedule, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ should we add ctx context.Context
ad the first argument to all of these functions?
Will whatever is calling this ever care about us honouring timeouts or cancellations of requests that could be in-flight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case it seems that neither the CLI nor the terraform provider seem to, at least in existing code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very fair, it's not worth adding in this case then
Codecov Report
@@ Coverage Diff @@
## master #702 +/- ##
==========================================
+ Coverage 26.95% 28.00% +1.04%
==========================================
Files 41 42 +1
Lines 4529 4795 +266
==========================================
+ Hits 1221 1343 +122
- Misses 3165 3267 +102
- Partials 143 185 +42
Continue to review full report at Codecov.
|
ac2ffef
to
244b188
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to see more comments added before each func declaration. This is one of the top rated 'best practises' in Golang. (I linked a reference for you :) )
"Use comments
Using comments might seem very basic practice but it’s very helpful when there are so many developers working on the same project and for transferring knowledge as well. The comments should have a brief description stating the purpose of the business logic. In this way, any other developer going through your logic will have an idea of what a particular block does."
This is actually meant to be used in the CircleCI terraform provider, which uses the CLI as a library. As such I'm not adding any CLI-user-visible way of interacting with schedules as part of this.
This is actually meant to be used in the CircleCI terraform provider,
which uses the CLI as a library. As such I'm not adding any
CLI-user-visible way of interacting with schedules as part of this.