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

Improvements to API package for use in cli #49

Merged
merged 4 commits into from Jun 14, 2022
Merged

Improvements to API package for use in cli #49

merged 4 commits into from Jun 14, 2022

Conversation

samcoe
Copy link
Contributor

@samcoe samcoe commented Jun 14, 2022

This PR helps address feedback received on cli/cli#5614.

This PR does four things:

  • Adds ability to set api cache options with request headers
  • Removes unnecessary preview headers
  • Changes GQL to GraphQL for error messages
  • Fixed a test that was failing locally, but not on CI

cc cli/cli#5560

@samcoe samcoe self-assigned this Jun 14, 2022
@samcoe samcoe marked this pull request as ready for review June 14, 2022 14:19
@samcoe samcoe requested a review from mislav June 14, 2022 14:19
}
c := cache{dir: opts.CacheDir, ttl: opts.CacheTTL}
transport = c.RoundTripper(transport)
Copy link
Contributor Author

@samcoe samcoe Jun 14, 2022

Choose a reason for hiding this comment

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

All requests will now hit the cache layer but if opts.EnableCache is not set the TTL will be 0 and it is a no-op.

@samcoe samcoe changed the title Update api pkg Improvements to API package for use in cli Jun 14, 2022
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

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

Looks great!

@samcoe samcoe merged commit ef2bca9 into trunk Jun 14, 2022
@samcoe samcoe deleted the update-api-pkg branch June 14, 2022 18: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.

None yet

2 participants