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

v1.9.20 #4965

Merged
merged 2 commits into from
Aug 30, 2024
Merged

v1.9.20 #4965

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion grafana-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test:e2e:watch": "yarn test:e2e --ui",
"test:e2e-expensive:watch": "yarn test:e2e-expensive --ui",
"test:e2e:gen": "yarn playwright codegen http://localhost:3000",
"e2e-show-report": "yarn playwright show-report",
"e2e-show-report": "yarn playwright show-report --port 31000",
"generate-types": "cd ./src/network/oncall-api/types-generator && yarn generate",
"watch": "NODE_ENV=development webpack -w -c ./webpack.config.ts --env development",
"sign": "npx --yes @grafana/sign-plugin@latest",
Expand Down
14 changes: 13 additions & 1 deletion grafana-plugin/pkg/plugin/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"errors"
"fmt"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
"io"
"net/http"
"net/url"
"strconv"
Expand Down Expand Up @@ -83,7 +84,7 @@ func (a *App) doSync(ctx context.Context, forceSend bool) {
var cacheAlreadyLocked *SyncCacheAlreadyLocked
if errors.As(err, &cacheAlreadyLocked) {
log.DefaultLogger.Info("Skipping sync", "message", err)
} else {
} else if err != nil {
log.DefaultLogger.Error("Error making sync request", "error", err)
}
}()
Expand Down Expand Up @@ -175,6 +176,17 @@ func (a *App) makeSyncRequest(ctx context.Context, forceSend bool) error {
}
defer res.Body.Close()

if res.StatusCode != http.StatusOK {
bodyBytes, err := io.ReadAll(res.Body)
if err != nil {
log.DefaultLogger.Error("failed to read response body", "error", err, "status", res.StatusCode)
} else {
log.DefaultLogger.Error("sync not ok", "status", res.StatusCode, "message", string(bodyBytes))
}
} else {
log.DefaultLogger.Info("sync ok", "status", res.StatusCode)
}

a.lastOnCallSync = onCallSync
return nil
}
11 changes: 10 additions & 1 deletion grafana-plugin/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ export default defineConfig({
/* Maximum time all the tests can run for. */
globalTimeout: 20 * 60 * 1_000, // 20 minutes

reporter: [['html', { open: IS_CI ? 'never' : 'always' }]],
reporter: [
[
'html',
{
open: IS_CI ? 'never' : 'always',
port: 31000, // explicitly specify a port for k8s port forwarding to avoid clashes with Incident and IRM
},
],
['list', { printSteps: true }],
],

/* Maximum time one test can run for. */
timeout: 60_000,
Expand Down
Loading