Skip to content

Commit 587936c

Browse files
committed
ci/renovate: use shared renovate presets and actions
1 parent 1fd23e7 commit 587936c

7 files changed

+99
-87
lines changed

.github/renovate.json5

+3-45
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,8 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"config:best-practices",
5-
":semanticCommitsDisabled"
6-
],
7-
8-
"branchPrefix": "grafanarenovatebot/",
9-
"commitMessagePrefix": "Chore: ",
10-
// Used when renovate runs as a github app.
11-
// https://docs.renovatebot.com/configuration-options/#platformcommit
12-
// Setting platformCommit to "enabled", as required by Grafana policy, seems to make renovate think all PRs are modified,
13-
// as the dynamic author configured by github does not match the author set in `gitAuthor`. It is recommended to
14-
// leave it unset: https://github.com/renovatebot/renovate/discussions/29106.
15-
"platformCommit": "enabled",
16-
"dependencyDashboard": false,
17-
"forkProcessing": "disabled",
18-
"rebaseWhen": "behind-base-branch",
19-
"prHourlyLimit": 0,
20-
"prConcurrentLimit": 10,
21-
"branchConcurrentLimit": 10,
22-
23-
"enabledManagers": ["custom.regex", "gomod"],
24-
25-
"labels": ["dependencies"],
26-
27-
"gomod": {
28-
"enabled": true
29-
},
30-
31-
"postUpdateOptions": [
32-
"gomodTidyE"
33-
],
34-
35-
"customManagers": [
36-
{
37-
// Update renovate version in GHA workflow file.
38-
"customType": "regex",
39-
"depNameTemplate": "ghcr.io/renovatebot/renovate",
40-
"datasourceTemplate": "docker",
41-
"fileMatch": [
42-
"^\\.github/workflows/.*\\.ya?ml$",
43-
],
44-
"matchStrings": [
45-
"renovate-version: (?<currentValue>[^@\\s]+)(?:@(?<currentDigest>\\S+))?",
46-
"RENOVATE_IMAGE=ghcr.io/renovatebot/renovate:(?<currentValue>[^@\\s]+)(?:@(?<currentDigest>\\S+))?"
47-
],
48-
},
4+
"github>grafana/sm-renovate//presets/grafana.json5",
5+
"github>grafana/sm-renovate//presets/synthetic-monitoring.json5",
6+
"github>grafana/sm-renovate//presets/go.json5",
497
],
508
}

.github/workflows/renovate-validate.yaml

+15-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@ name: Validate renovate config
22
on:
33
pull_request:
44
paths:
5-
- "**renovate*.*"
5+
# When renovate config changes:
6+
- "renovate.*"
7+
- ".renovate.*"
8+
- ".github/renovate.*"
9+
# Also when renovate version changes:
10+
- ".github/workflows/renovate*"
11+
612
jobs:
7-
validate:
13+
renovate:
14+
permissions:
15+
# Needed for logging into vault.
16+
contents: read
17+
id-token: write
818
runs-on: ubuntu-latest
919
timeout-minutes: 5
1020
steps:
1121
- name: Checkout Code
12-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
13-
- name: Validate renovate config
14-
run: |-
15-
# Renovate updates the line below. Please keep its formatting as it is.
16-
export RENOVATE_IMAGE=ghcr.io/renovatebot/renovate:39.38.0@sha256:5a53ef5d0488e54ad36194453f012cce7926660d46076e424053d445d4ff0225
17-
docker run -i --rm -v $(realpath .):/repo -w /repo --entrypoint renovate-config-validator "$RENOVATE_IMAGE" --strict
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
- name: Self-hosted renovate
24+
uses: grafana/sm-renovate/actions/renovate-validate@main

.github/workflows/renovate.yaml

+8-34
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,20 @@
1-
name: Renovate
1+
name: Self-hosted Renovate
22

33
on:
44
schedule:
5-
- cron: "18 */4 * * *"
5+
- cron: "29 */4 * * *"
66
workflow_dispatch:
77

88
jobs:
99
renovate:
1010
permissions:
11-
contents: read # needed to read the contents of the repository
12-
id-token: write # needed to create a GitHub App token
11+
# Needed for logging into vault.
12+
contents: read
13+
id-token: write
1314
runs-on: ubuntu-latest
1415
timeout-minutes: 5
1516
steps:
1617
- name: Checkout Code
17-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
18-
- name: retrieve secrets
19-
id: get-secrets
20-
uses: grafana/shared-workflows/actions/get-vault-secrets@332fb1cf3349234b5b1940f3f2797410e6ccd5d2
21-
with:
22-
common_secrets: |
23-
GRAFANA_RENOVATE_APP_ID=grafana-renovate-app:app-id
24-
GRAFANA_RENOVATE_PRIVATE_KEY=grafana-renovate-app:private-key
25-
26-
- name: create GitHub app token
27-
id: app-token
28-
# Beware that the token generated here has elevated permissions wrt to
29-
# the ones set in the action. In particular, it will be able to write
30-
# to the repository (e.g. create branches) and create pull requests.
31-
uses: actions/create-github-app-token@v1
32-
with:
33-
app-id: ${{ env.GRAFANA_RENOVATE_APP_ID }}
34-
private-key: ${{ env.GRAFANA_RENOVATE_PRIVATE_KEY }}
35-
owner: ${{ github.repository_owner }}
36-
37-
- name: Self-hosted Renovate
38-
uses: renovatebot/github-action@dd4d265eb8646cd04fc5f86ff8bc8d496d75a251 # v40.2.8
39-
with:
40-
renovate-version: 39.38.0@sha256:5a53ef5d0488e54ad36194453f012cce7926660d46076e424053d445d4ff0225
41-
configurationFile: .github/renovate-app.json
42-
token: "${{ steps.app-token.outputs.token }}"
43-
env:
44-
LOG_LEVEL: debug
45-
RENOVATE_PLATFORM: github
46-
RENOVATE_REPOSITORIES: ${{ github.repository }}
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
- name: Self-hosted renovate
20+
uses: grafana/sm-renovate/actions/renovate@main

example.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { browser } from 'k6/browser';
2+
import { check } from 'https://jslib.k6.io/k6-utils/1.5.0/index.js';
3+
4+
export const options = {
5+
scenarios: {
6+
ui: {
7+
executor: 'shared-iterations',
8+
options: {
9+
browser: {
10+
type: 'chromium',
11+
},
12+
},
13+
},
14+
},
15+
thresholds: {
16+
checks: ['rate==1.0'],
17+
},
18+
};
19+
20+
export default async function () {
21+
const context = await browser.newContext();
22+
const page = await context.newPage();
23+
24+
try {
25+
await page.goto("https://www.amazon.es");
26+
27+
await page.locator('input[name="login"]').type("admin");
28+
await page.locator('input[name="password"]').type("123");
29+
30+
await Promise.all([
31+
page.waitForNavigation(),
32+
page.locator('input[type="submit"]').click(),
33+
]);
34+
35+
await check(page.locator("h2"), {
36+
'header': async h2 => await h2.textContent() == "Welcome, admin!"
37+
});
38+
} finally {
39+
await page.close();
40+
}
41+
}

logs.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
time="2024-11-27T11:24:51+01:00" level=error msg="Failed to load resource: net::ERR_CONNECTION_REFUSED" browser_source=network line_number=0 source=browser stacktrace="<nil>" url="https://fls-na.amazon.com/1/batch/1/OP/ATVPDKIKX0DER:143-9756348-9333813:E6SGF3ST4DKW80F9RTV4$uedata=s:%2Frd%2Fuedata%3Fstaticb%26id%3DE6SGF3ST4DKW80F9RTV4:0"
2+
time="2024-11-27T11:24:54+01:00" level=error msg="Failed to load resource: net::ERR_CONNECTION_REFUSED" browser_source=network line_number=0 source=browser stacktrace="<nil>" url="https://fls-na.amazon.com/1/batch/1/OP/ATVPDKIKX0DER:143-9756348-9333813:E6SGF3ST4DKW80F9RTV4$uedata=s:%2Frd%2Fuedata%3Ful%26v%3D0.300971.0%26id%3DE6SGF3ST4DKW80F9RTV4%26m%3D1%26sc%3DE6SGF3ST4DKW80F9RTV4%26ue%3D2%26bb%3D836%26ns%3D842%26ne%3D866%26cf%3D906%26be%3D973%26fp%3D871%26fcp%3D871%26af%3D1188%26fn%3D1188%26pc%3D3526%26tc%3D-955%26na_%3D-955%26ul_%3D-1732703090602%26_ul%3D-1732703090602%26rd_%3D-1732703090602%26_rd%3D-1732703090602%26fe_%3D-955%26lk_%3D-955%26_lk%3D-905%26co_%3D-905%26_co%3D-525%26sc_%3D-718%26rq_%3D-525%26rs_%3D-14%26_rs%3D841%26dl_%3D-7%26di_%3D1006%26de_%3D1007%26_de%3D1007%26_dc%3D-1732703090602%26ld_%3D-1732703090602%26_ld%3D-1732703090602%26ntd%3D0%26ty%3D0%26rc%3D0%26hob%3D1%26hoe%3D3%26ul%3D3527%26t%3D1732703094129%26ctb%3D1%26rt%3Dcf%3A6-0-3-3-3-0-1_af%3A65-4-3-57-3-0-1_%26csmtags%3Daui%7Caui%3Aaui_build_date%3A3.24.9-2024-11-08%7Cnavbar%7CgwCFImgCache%7CFWCIMEnabled%7Cfls-na-amazon-com%7Ccf_cdn_fr%7Ccf_cdn_mp%7Caui%3Asw%3Apage_proxy%3Ano_ctrl%7Cadblk_no%7CfourColumn%7CthreeColumnRevised%7CflexLayout%7CcssGridLayout%7Caui%3Acss%3Anetwork%7Caui%3Ajs%3Anetwork%7Caui%3Aajax%26viz%3Dvisible%3A2%26pty%3DGateway%26spty%3Ddesktop%26pti%3Ddesktop%26tid%3DE6SGF3ST4DKW80F9RTV4%26aftb%3D1%26lob%3D1:3545"
3+
time="2024-11-27T11:24:54+01:00" level=error msg="Failed to load resource: net::ERR_CONNECTION_REFUSED" browser_source=network line_number=0 source=browser stacktrace="<nil>" url="https://fls-na.amazon.com/1/batch/1/OP/ATVPDKIKX0DER:143-9756348-9333813:E6SGF3ST4DKW80F9RTV4$uedata=s:%2Frd%2Fuedata%3Ful%26v%3D0.300971.0%26id%3DE6SGF3ST4DKW80F9RTV4%26sc0%3Daui%3Asw%3Appft%3Acallback_ricb%26bb0%3D736%26pc0%3D1013%26ld0%3D1013%26t0%3Dundefined%26sc1%3Dportal-bb%26pc1%3D1%26ld1%3D1%26t1%3Dundefined%26sc2%3Dgw-ftGr-desktop-hero-1-visible%26cf2%3D868%26pc2%3D868%26ld2%3D868%26t2%3Dundefined%26sc3%3DheroAf%26cf3%3D869%26pc3%3D869%26ld3%3D869%26t3%3Dundefined%26sc4%3Dh1Af%26cf4%3D869%26pc4%3D869%26ld4%3D869%26t4%3Dundefined%26sc5%3Ddesktop-banner-stripe-visible%26cf5%3D870%26pc5%3D870%26ld5%3D870%26t5%3Dundefined%26sc6%3DnavCF%26cf6%3D907%26pc6%3D907%26ld6%3D907%26t6%3Dundefined%26sc7%3DcsmCELLSframework%26bb7%3D976%26pc7%3D976%26ld7%3D976%26t7%3Dundefined%26sc8%3DcsmCELLSpdm%26bb8%3D976%26pc8%3D986%26ld8%3D986%26t8%3Dundefined%26sc9%3DcsmCELLSvpm%26bb9%3D987%26pc9%3D987%26ld9%3D987%26t9%3Dundefined%26sc10%3DcsmCELLSfem%26bb10%3D987%26pc10%3D987%26ld10%3D987%26t10%3Dundefined%26sc11%3Due_sushi_v1%26bb11%3D987%26pc11%3D987%26ld11%3D987%26t11%3Dundefined%26sc12%3Ddesktop-grid-1-visible%26cf12%3D993%26pc12%3D993%26ld12%3D993%26t12%3Dundefined%26sc13%3Ddesktop-grid-2-visible%26cf13%3D1013%26pc13%3D1013%26ld13%3D1013%26t13%3Dundefined%26sc14%3Ddesktop-grid-4-visible%26cf14%3D1022%26pc14%3D1022%26ld14%3D1022%26t14%3Dundefined%26sc15%3Ddesktop-grid-5-visible%26cf15%3D1060%26pc15%3D1060%26ld15%3D1060%26t15%3Dundefined%26sc16%3Ddesktop-grid-6-visible%26cf16%3D1095%26pc16%3D1095%26ld16%3D1095%26t16%3Dundefined%26sc17%3DjQueryReady%26cf17%3D1129%26pc17%3D1129%26ld17%3D1129%26t17%3Dundefined%26sc18%3DgwGridInit%26cf18%3D1131%26pc18%3D1131%26ld18%3D1131%26t18%3Dundefined%26sc19%3DgwBTFGridInit%26cf19%3D1133%26pc19%3D1133%26ld19%3D1133%26t19%3Dundefined%26sc20%3Ddesktop-grid-7-visible%26cf20%3D1136%26pc20%3D1136%26ld20%3D1136%26t20%3Dundefined%26sc21%3Ddesktop-grid-3-visible%26cf21%3D1136%26pc21%3D1136%26ld21%3D1136%26t21%3Dundefined%26sc22%3Dgateway-asset-load%26cf22%3D1145%26pc22%3D1145%26ld22%3D1145%26t22%3Dundefined%26sc23%3Dhero-first-image%26cf23%3D1188%26pc23%3D1188%26ld23%3D1188%26t23%3Dundefined%26sc24%3Ddesktop-grid-8-visible%26cf24%3D1188%26pc24%3D1188%26ld24%3D1188%26t24%3Dundefined%26sc25%3DspLoadJs%26cf25%3D1188%26pc25%3D1188%26ld25%3D1188%26t25%3Dundefined%26sc26%3Ddesktop-top-visible%26cf26%3D1238%26pc26%3D1238%26ld26%3D1238%26t26%3Dundefined%26sc27%3Ddesktop-btf-grid-2-visible%26cf27%3D1243%26pc27%3D1243%26ld27%3D1243%26t27%3Dundefined%26sc28%3Ddesktop-btf-grid-3-visible%26cf28%3D1243%26pc28%3D1243%26ld28%3D1243%26t28%3Dundefined%26sc29%3Ddesktop-2-visible%26cf29%3D1243%26pc29%3D1243%26ld29%3D1243%26t29%3Dundefined%26sc30%3Ddesktop-btf-grid-4-visible%26cf30%3D1249%26pc30%3D1249%26ld30%3D1249%26t30%3Dundefined%26sc31%3Ddesktop-btf-grid-1-visible%26cf31%3D1254%26pc31%3D1254%26ld31%3D1254%26t31%3Dundefined%26sc32%3Ddesktop-btf-grid-5-visible%26cf32%3D1262%26pc32%3D1262%26ld32%3D1262%26t32%3Dundefined%26sc33%3Ddesktop-btf-grid-7-visible%26cf33%3D1264%26pc33%3D1264%26ld33%3D1264%26t33%3Dundefined%26sc34%3Ddesktop-btf-grid-9-visible%26cf34%3D1270%26pc34%3D1270%26ld34%3D1270%26t34%3Dundefined%26sc35%3Ddesktop-btf-grid-6-visible%26cf35%3D1286%26pc35%3D1286%26ld35%3D1286%26t35%3Dundefined%26sc36%3Ddesktop-btf-grid-8-visible%26cf36%3D1290%26pc36%3D1290%26ld36%3D1290%26t36%3Dundefined%26sc37%3Ddesktop-btf-grid-10-visible%26cf37%3D1299%26pc37%3D1299%26ld37%3D1299%26t37%3Dundefined%26sc38%3Ddesktop-btf-grid-11-visible%26cf38%3D1305%26pc38%3D1305%26ld38%3D1305%26t38%3Dundefined%26sc39%3Ddesktop-btf-grid-12-visible%26cf39%3D1312%26pc39%3D1312%26ld39%3D1312%26t39%3Dundefined%26sc40%3Ddesktop-4-visible%26cf40%3D1347%26pc40%3D1347%26ld40%3D1347%26t40%3Dundefined%26sc41%3Ddesktop-6-visible%26cf41%3D1353%26pc41%3D1353%26ld41%3D1353%26t41%3Dundefined%26sc42%3Ddesktop-7-visible%26cf42%3D1362%26pc42%3D1362%26ld42%3D1362%26t42%3Dundefined%26sc43%3DgwLayoutReady%26cf43%3D1447%26pc43%3D1447%26ld43%3D1447%26t43%3Dundefined%26sc44%3DgwAUIReady%26cf44%3D1448%26pc44%3D1448%26ld44%3D1448%26t44%3Dundefined%26sc45%3Ddesktop-2-active%26cf45%3D1454%26pc45%3D1454%26ld45%3D1454%26t45%3Dundefined%26sc46%3Ddesktop-4-active%26cf46%3D1454%26pc46%3D1454%26ld46%3D1454%26t46%3Dundefined%26sc47%3Ddesktop-6-active%26cf47%3D1454%26pc47%3D1454%26ld47%3D1454%26t47%3Dundefined%26sc48%3Ddesktop-7-active%26cf48%3D1454%26pc48%3D1454%26ld48%3D1454%26t48%3Dundefined%26sc49%3Dglow-toaster-api-timer-DESKTOP%26bb49%3D1462%26pc49%3D1995%26ld49%3D1995%26t49%3Dundefined%26sc50%3Dgw-hero-btf-populate%26cf50%3D1488%26pc50%3D1488%26ld50%3D1488%26t50%3Dundefined%26sc51%3DgwHerotatorActive%26cf51%3D1501%26pc51%3D1501%26ld51%3D1501%26t51%3Dundefined%26sc52%3Dgw-ftGr-desktop-hero-5-visible%26cf52%3D1994%26pc52%3D1994%26ld52%3D1994%26t52%3Dundefined%26sc53%3Dgw-ftGr-desktop-hero-2-visible%26cf53%3D2120%26pc53%3D2120%26ld53%3D2120%26t53%3Dundefined%26sc54%3Dgw-ftGr-desktop-hero-3-visible%26cf54%3D2123%26pc54%3D2123%26ld54%3D2123%26t54%3Dundefined%26sc55%3Dgw-ftGr-desktop-hero-4-visible%26cf55%3D2123%26pc55%3D2123%26ld55%3D2123%26t55%3Dundefined%26sc56%3Dgw-ftGr-desktop-hero-6-visible%26cf56%3D2123%26pc56%3D2123%26ld56%3D2123%26t56%3Dundefined%26sc57%3Dgw-ftGr-desktop-hero-7-visible%26cf57%3D2240%26pc57%3D2240%26ld57%3D2240%26t57%3Dundefined%26ctb%3D1:3545"
4+
time="2024-11-27T11:24:54+01:00" level=error msg="Failed to load resource: net::ERR_CONNECTION_REFUSED" browser_source=network line_number=0 source=browser stacktrace="<nil>" url="https://fls-na.amazon.com/1/batch/1/OE/"
5+
time="2024-11-27T11:24:54+01:00" level=error msg="Failed to load resource: net::ERR_CONNECTION_REFUSED" browser_source=network line_number=0 source=browser stacktrace="<nil>" url="https://fls-na.amazon.com/1/remote-weblab-triggers/1/OE/ATVPDKIKX0DER:143-9756348-9333813:E6SGF3ST4DKW80F9RTV4$s:wl-client-id%3DCSMTriger%2Cwl%3DUEDATA_AA_SERVERSIDE_ASSIGNMENT_CLIENTSIDE_TRIGGER_190249%2FC:1234"
6+
time="2024-11-27T11:24:54+01:00" level=warning msg="[GroupMarkerNotSet(crbug.com/242999)!:A03015001C110000]Automatic fallback to software WebGL has been deprecated. Please use the --enable-unsafe-swiftshader flag to opt in to lower security guarantees for trusted content." browser_source=rendering line_number=0 source=browser url="https://www.amazon.com/"
7+
time="2024-11-27T11:24:54+01:00" level=error msg="communicating with browser: websocket: close 1006 (abnormal closure): unexpected EOF" category=cdp elapsed="0 ms" source=browser
8+
time="2024-11-27T11:25:19+01:00" level=warning error="context is done before all 'IterEnd' events were processed"
9+
time="2024-11-27T11:25:20+01:00" level=error msg="test run was aborted because k6 received a 'interrupt' signal"

simple-request.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import http from 'k6/http';
2+
3+
export const options = {
4+
iterations: 1,
5+
};
6+
7+
export default function () {
8+
const response = http.get('https://test-api.k6.io/public/crocodiles/');
9+
}

use-cases.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- `page.goto`
2+
- Clicks on buttons/links (user actions?)
3+
- Redirects (HTTP)
4+
5+
- Potentially the "Initiator" for a request helps
6+
- What about SPA?
7+
8+
```
9+
K6_BROWSER_URL_METRIC_SOURCES='navigation,redirects'
10+
```
11+
12+
- Actions
13+
- Create detailed issue (NS)
14+
- Find an SPA for testing

0 commit comments

Comments
 (0)