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

Remote: new ListContext function #278

Merged
merged 1 commit into from Apr 21, 2021

Conversation

xiujuan95
Copy link
Contributor

@xiujuan95 xiujuan95 commented Apr 1, 2021

It's from this discussion: #246 (comment)

When a user calls go-git package to do git ls-remote check, we should provide a timeout. Otherwise, this will be stuck in some situation, and cause a controller which is using List alway waits again and again.. This is not expected I think.

This pull request add a ListContext for List func and pass context. For context, I set 10s timeout. If exceed 10s, then List func will exit. Maybe 10s is too short, we can discuss a reasonable value about it.

Also I add a unit test to test timeout case. Locally, all unit tests passed.

@xiujuan95
Copy link
Contributor Author

Does anyone know how can I re-run my tests directly rather than change my codes and push again. (Because these failed tests are not related with my changes)

@xiujuan95 xiujuan95 force-pushed the timeout-ctx-ls-remote branch 2 times, most recently from dd236a3 to d8220e5 Compare April 1, 2021 13:02
@xiujuan95 xiujuan95 changed the title Add timeout context for remote List function plumbing: Add timeout context for remote List function Apr 2, 2021
@xiujuan95 xiujuan95 force-pushed the timeout-ctx-ls-remote branch 5 times, most recently from 37bd7e1 to 44978de Compare April 9, 2021 04:25
@xiujuan95
Copy link
Contributor Author

Could anyone pls help review this PR? Maybe @mcuadros, can you help review it pls? Thanks in advance!

@mcuadros
Copy link
Member

Looks great can you rebase it?

@xiujuan95
Copy link
Contributor Author

Looks great can you rebase it?

@mcuadros Sure, done! Please take a look again, thanks a lot!

go.sum Outdated
@@ -25,24 +25,16 @@ github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agR
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-billy/v5 v5.1.0 h1:4pl5BV4o7ZG/lterP4S6WzJ6xr49Ba5ET9ygheTYahk=
github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-git-fixtures/v4 v4.0.1 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp/pqnefH+Bc=
Copy link
Member

Choose a reason for hiding this comment

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

please don't update the go.sum

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mcuadros May I know why?

Copy link
Member

Choose a reason for hiding this comment

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

Because the purpose of this PR is to add the ListContext function not update the dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, done! @mcuadros Please take a look again, thanks!

@xiujuan95 xiujuan95 requested a review from mcuadros April 19, 2021 04:58
@xiujuan95 xiujuan95 force-pushed the timeout-ctx-ls-remote branch 5 times, most recently from 2867215 to 0cc02f5 Compare April 21, 2021 07:15
@mcuadros mcuadros changed the title plumbing: Add timeout context for remote List function Remote: new ListContext function Apr 21, 2021
@mcuadros mcuadros merged commit 67d3490 into go-git:master Apr 21, 2021
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.

None yet

2 participants