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

Add API bindings for the pipeline scheduling REST API #702

Merged
merged 1 commit into from
May 17, 2022
Merged

Conversation

sulami
Copy link
Contributor

@sulami sulami commented May 11, 2022

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.

}

type ScheduleInterface interface {
Schedules(vcs, org, project string) (*[]Schedule, error)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

@sulami sulami marked this pull request as ready for review May 11, 2022 11:45
@sulami sulami requested a review from a team May 11, 2022 13:55
@codecov
Copy link

codecov bot commented May 12, 2022

Codecov Report

Merging #702 (a229deb) into master (2b4b295) will increase coverage by 1.04%.
The diff coverage is 45.86%.

@@            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     
Impacted Files Coverage Δ
api/schedule_rest.go 45.86% <45.86%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b4b295...a229deb. Read the comment docs.

@sulami sulami force-pushed the schedule-api branch 4 times, most recently from ac2ffef to 244b188 Compare May 12, 2022 14:18
Copy link
Contributor

@corinnesollows corinnesollows left a 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.
@sulami sulami merged commit 60f56cc into master May 17, 2022
@sulami sulami deleted the schedule-api branch May 17, 2022 07:33
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.

3 participants