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

Allow configuring http client timeout #1012

Closed
or-shachar opened this issue Oct 23, 2023 · 2 comments · Fixed by #1013
Closed

Allow configuring http client timeout #1012

or-shachar opened this issue Oct 23, 2023 · 2 comments · Fixed by #1013

Comments

@or-shachar
Copy link
Contributor

What problem does this feature solve?:

  • Our CI validates the circleci configuration size by running circleci config process / validate commands
  • Ocassianally the circleci fails to execute due to timeout.
  • Looking at the code it seems like the http client is configured to 10s timeout (here)
  • I think this should be configurable by either env variable or global flag

Provide an example:

export HTTP_TIMEOUT=30s
circleci config validate config.yml

or

circleci --http_timeout 30s config validate config.yml
@loderunner
Copy link
Contributor

Love the idea! This should be simple to merge. I think the feature has a few more requirements:

  1. I don't see where the global flag --http_timeout is setup? Did you do that part? Also, from the user's point of view, I don't think it matters that this is HTTP in the flag. Let's just call it --timeout and add the HTTP part to the inline help.
  2. HTTP_TIMEOUT seems like too generic a term. Can we add a prefix to "namespace" the environment variable? CIRCLECI_CLI_TIMEOUT=30s should do fine.
  3. There is another HTTP client in the CLI, used for exchanging with the GraphQL API (mostly for Orbs). Can we make sure the timeout is applied to both clients? (source)

Finally, I'd like to see at least one test in there. You can add an integration test to config/commands_test.go, creating a new mock server with httptest.NewServer that takes longer time to respond than the timeout.

Let me know if any of this is unclear, I'll be glad to help.

@abdelDriowya
Copy link
Contributor

@or-shachar cli released you can define http timeout now

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 a pull request may close this issue.

3 participants