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

OpenAPI: Fix API calls pointing to subpath #1145

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

julienduchesne
Copy link
Member

@julienduchesne julienduchesne commented Nov 9, 2023

Closes #1137
Currently, the test suite is pointing to a subpath BUT Grafana redirects from the root to the subpath
The provider is badly configured but the tests still pass because of the redirect

To fix the test suite, I add a nginx proxy in this PR, so that calling the host directly fails and you have to go through the subpath

I've also reworked the Makefile so that it has more common args (less repetition of configs), so it's harder to make a mistake

Copy link

github-actions bot commented Nov 9, 2023

In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically.
To do so, a Grafana Labs employee must trigger the cloud acceptance tests workflow manually.

Closes #1137
Currently, the test suite is pointing to a subpath BUT Grafana redirects from the root to the subpath
The provider is badly configured but the tests still pass because of the redirect

To fix the test suite, I add a nginx proxy in this PR, so that calling the host directly fails and you have to go through the subpath

I've also reworked the Makefile so that it has more common args (less repetition of configs), so it's harder to make a mistake
@julienduchesne julienduchesne marked this pull request as ready for review November 9, 2023 18:56
@julienduchesne julienduchesne requested a review from a team as a code owner November 9, 2023 18:56
@@ -438,7 +442,7 @@ func createGrafanaOAPIClient(apiURL string, d *schema.ResourceData) (*goapi.Graf

cfg := goapi.TransportConfig{
Host: u.Host,
BasePath: "/api",
BasePath: apiPath,
Copy link
Member Author

Choose a reason for hiding this comment

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

The actual fix is here

@julienduchesne julienduchesne merged commit b19e8db into master Nov 10, 2023
23 checks passed
@julienduchesne julienduchesne deleted the julienduchesne/fix-subpath branch November 10, 2023 15:29
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.

Provider does not work when you run grafana on a sub path: example.com/grafana
2 participants