Merge branch 'main' into leeoniya/state-timeline-fix-dual-time-multi-series

This commit is contained in:
Sven Grossmann
2025-04-28 15:13:59 +02:00
9 changed files with 63 additions and 191 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
# Note: Github will not trigger other actions from this because it uses
# the GITHUB_TOKEN token
- name: Run auto-milestone
uses: grafana/grafana-github-actions-go/auto-milestone@main
uses: grafana/grafana-github-actions-go/auto-milestone@d4c452f92ed826d515dccf1f62923e537953acd8 # main
with:
pr: ${{ github.event.pull_request.number }}
token: ${{ secrets.GITHUB_TOKEN }}
+9 -3
View File
@@ -11,7 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
with:
persist-credentials: false
- name: "Generate token"
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
@@ -20,8 +22,12 @@ jobs:
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
- run: git config --global user.email '132647405+grafana-delivery-bot[bot]@users.noreply.github.com'
- run: git config --global user.name 'grafana-delivery-bot[bot]'
- run: git remote set-url origin "https://grafana-delivery-bot:${{ steps.generate_token.outputs.token }}@github.com/grafana/grafana.git"
- name: Set remote URL
env:
GIT_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
git remote set-url origin "https://grafana-delivery-bot:$GIT_TOKEN@github.com/grafana/grafana.git"
- name: Run backport
uses: grafana/grafana-github-actions-go/backport@main
uses: grafana/grafana-github-actions-go/backport@d4c452f92ed826d515dccf1f62923e537953acd8 # main
with:
token: ${{ steps.generate_token.outputs.token }}
@@ -1,149 +0,0 @@
name: When epic issues changed in Platform UX squad projects, check if epic is part of specified child projects and update on Platform UX parent project
on:
issues:
types: [opened, closed, edited, reopened, assigned, unassigned, labeled, unlabeled]
labels:
- 'type/epic'
env:
GH_TOKEN: ${{ secrets.GH_BOT_PROJECTS_ACCESS_TOKEN }}
ORGANIZATION: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PARENT_PROJECT: 304
CHILD_PROJECT_1: 78
CHILD_PROJECT_2: 111
CHILD_PROJECT_3: 202
concurrency:
group: issue-add-to-parent-project-${{ github.event.number }}
jobs:
config:
runs-on: "ubuntu-latest"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
- name: "Check for secrets"
id: check
shell: bash
run: |
if [ -n "${{ (secrets.GH_BOT_PROJECTS_ACCESS_TOKEN != '') || '' }}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi
main:
needs: config
if: needs.config.outputs.has-secrets && contains(github.event.issue.labels.*.name, 'type/epic')
runs-on: ubuntu-latest
steps:
- name: Check if issue is in child or parent projects
run: |
gh api graphql -f query='
query($org: String!, $repo: String!) {
repository(name: $repo, owner: $org) {
issue (number: ${{ github.event.issue.number }}) {
projectItems(first:20) {
nodes {
id,
project {
number,
title
},
fieldValueByName(name:"Status") {
... on ProjectV2ItemFieldSingleSelectValue {
optionId
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -f repo=$REPO > projects_data.json
echo 'IN_PARENT_PROJ='$(jq '.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.PARENT_PROJECT }}) | .project != null' projects_data.json) >> $GITHUB_ENV
echo 'PARENT_PROJ_STATUS_ID='$(jq '.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.PARENT_PROJECT }}) | select(.fieldValueByName != null) | .fieldValueByName.optionId' projects_data.json) >> $GITHUB_ENV
echo 'ITEM_ID='$(jq '.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.PARENT_PROJECT }}) | .id' projects_data.json) >> $GITHUB_ENV
echo 'IN_CHILD_PROJ='$(jq 'first(.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.CHILD_PROJECT_1 }} or .project.number==${{ env.CHILD_PROJECT_2 }} or .project.number==${{ env.CHILD_PROJECT_3 }}) | .project != null)' projects_data.json) >> $GITHUB_ENV
echo 'CHILD_PROJ_STATUS='$(jq -r '.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.CHILD_PROJECT_1 }} or .project.number==${{ env.CHILD_PROJECT_2 }} or .project.number==${{ env.CHILD_PROJECT_3 }}) | select(.fieldValueByName != null) | .fieldValueByName.name' projects_data.json) >> $GITHUB_ENV
- name: Get parent project project data
if: env.IN_CHILD_PROJ
run: |
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectV2(number: $number) {
id
fields(first:20) {
nodes {
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -F number=$PARENT_PROJECT > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
echo 'PROGRESS_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV
echo 'DONE_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Done") |.id' project_data.json) >> $GITHUB_ENV
- name: Add issue to parent project
if: env.IN_CHILD_PROJ && !env.IN_PARENT_PROJ
run: |
item_id="$( gh api graphql -f query='
mutation($project:ID!, $issue:ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f issue=${{ github.event.issue.node_id }} --jq '.data.addProjectV2ItemById.item.id')"
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
- name: Set parent project status Done
if: contains(env.CHILD_PROJ_STATUS, 'Done')
run: |
echo 'OPTION_ID='$DONE_OPTION_ID >> $GITHUB_ENV
- name: Set parent project status In Progress
if: contains(env.CHILD_PROJ_STATUS, 'In ') || contains(env.CHILD_PROJ_STATUS, 'Blocked')
run: |
echo 'OPTION_ID='$PROGRESS_OPTION_ID >> $GITHUB_ENV
- name: Set parent project status To do
if: env.CHILD_PROJ_STATUS && !contains(env.CHILD_PROJ_STATUS, 'In ') && !contains(env.CHILD_PROJ_STATUS, 'Blocked') && ! contains(env.CHILD_PROJ_STATUS, 'Done')
run: |
echo 'OPTION_ID='$TODO_OPTION_ID >> $GITHUB_ENV
- name: Set issue status in parent project
if: env.OPTION_ID && (env.OPTION_ID != env.PARENT_PROJ_STATUS_ID)
run: |
gh api graphql -f query='
mutation (
$project: ID!
$item: ID!
$status_field: ID!
$status_value: String!
) {
set_status: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $status_field
value: {
singleSelectOptionId: $status_value
}
}) {
projectV2Item {
id
}
}
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.OPTION_ID }} --silent
+16 -7
View File
@@ -17,6 +17,13 @@ on:
# target branch onto the source branch, to verify compatibility before merging.
jobs:
dispatch-job:
env:
HEAD_REF: ${{ github.head_ref }}
BASE_REF: ${{ github.base_ref }}
REPO: ${{ github.repository }}
SENDER: ${{ github.event.sender.login }}
SHA: ${{ github.sha }}
PR_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
runs-on: ubuntu-latest
steps:
- name: "Generate token"
@@ -31,18 +38,20 @@ jobs:
with:
github-token: ${{ steps.generate_token.outputs.token }}
script: |
const {HEAD_REF, BASE_REF, REPO, SENDER, SHA, PR_COMMIT_SHA} = process.env;
await github.rest.actions.createWorkflowDispatch({
owner: 'grafana',
repo: 'security-patch-actions',
workflow_id: 'test-patches-event.yml',
ref: 'main',
inputs: {
src_repo: "${{ github.repository }}",
src_ref: "${{ github.head_ref }}",
src_merge_sha: "${{ github.sha }}",
src_pr_commit_sha: "${{ github.event.pull_request.head.sha }}",
patch_repo: "${{ github.repository }}-security-patches",
patch_ref: "${{ github.base_ref }}",
triggering_github_handle: "${{ github.event.sender.login }}"
src_repo: REPO,
src_ref: HEAD_REF,
src_merge_sha: SHA,
src_pr_commit_sha: PR_COMMIT_SHA,
patch_repo: REPO + '-security-patches',
patch_ref: BASE_REF,
triggering_github_handle: SENDER
}
})
@@ -503,7 +503,9 @@ function ThresholdExpressionViewer({ model }: { model: ExpressionQuery }) {
{unloadEvaluator && (
<>
<div className={styles.label}>
<Trans i18nKey="alerting.threshold-expression-viewer.stop-alerting-when">Stop alerting when </Trans>
<Trans i18nKey="alerting.threshold-expression-viewer.stop-alerting-when">
Stop alerting (or pending state) when{' '}
</Trans>
</div>
<div className={styles.value}>{expression}</div>
@@ -219,7 +219,7 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
<InlineField
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-outside-range',
'Stop alerting when outside range'
'Stop alerting (or pending state) when outside range'
)}
labelWidth={'auto'}
>
@@ -256,7 +256,7 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
<InlineField
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-inside-range',
'Stop alerting when inside range'
'Stop alerting (or pending state) when inside range'
)}
labelWidth={'auto'}
>
@@ -293,7 +293,7 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
<InlineField
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-inside-range',
'Stop alerting when inside range'
'Stop alerting (or pending state) when inside range'
)}
labelWidth={'auto'}
>
@@ -329,7 +329,7 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
<InlineField
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-outside-range',
'Stop alerting when outside range'
'Stop alerting (or pending state) when outside range'
)}
labelWidth={'auto'}
>
@@ -370,7 +370,10 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
return (
<InlineFieldRow className={styles.hysteresis}>
<InlineField
label={t('alerting.rule-form.threshold.recovery.stop-alerting-bellow', 'Stop alerting when below')}
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-bellow',
'Stop alerting (or pending state) when below'
)}
labelWidth={'auto'}
invalid={Boolean(invalidErrorMsg)}
error={invalidErrorMsg}
@@ -390,7 +393,10 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
return (
<InlineFieldRow className={styles.hysteresis}>
<InlineField
label={t('alerting.rule-form.threshold.recovery.stop-alerting-above', 'Stop alerting when above')}
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-above',
'Stop alerting (or pending state) when above'
)}
labelWidth={'auto'}
invalid={Boolean(invalidErrorMsg)}
error={invalidErrorMsg}
@@ -410,7 +416,10 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
return (
<InlineFieldRow className={styles.hysteresis}>
<InlineField
label={t('alerting.rule-form.threshold.recovery.stop-alerting-equal', 'Stop alerting when equal to')}
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-equal',
'Stop alerting (or pending state) when equal to'
)}
labelWidth={'auto'}
invalid={Boolean(invalidErrorMsg)}
error={invalidErrorMsg}
@@ -432,7 +441,7 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
<InlineField
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-not-equal',
'Stop alerting when not equal to'
'Stop alerting (or pending state) when not equal to'
)}
labelWidth={'auto'}
invalid={Boolean(invalidErrorMsg)}
@@ -453,7 +462,10 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
return (
<InlineFieldRow className={styles.hysteresis}>
<InlineField
label={t('alerting.rule-form.threshold.recovery.stop-alerting-less', 'Stop alerting when less than')}
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-less',
'Stop alerting (or pending state) when less than'
)}
labelWidth={'auto'}
invalid={Boolean(invalidErrorMsg)}
error={invalidErrorMsg}
@@ -473,7 +485,10 @@ function RecoveryThresholdRow({ isRange, condition, onError, dispatch, allowOnbl
return (
<InlineFieldRow className={styles.hysteresis}>
<InlineField
label={t('alerting.rule-form.threshold.recovery.stop-alerting-more', 'Stop alerting when more than')}
label={t(
'alerting.rule-form.threshold.recovery.stop-alerting-more',
'Stop alerting (or pending state) when more than'
)}
labelWidth={'auto'}
invalid={Boolean(invalidErrorMsg)}
error={invalidErrorMsg}
@@ -7,7 +7,6 @@
"@emotion/css": "11.13.5",
"@grafana/data": "workspace:*",
"@grafana/e2e-selectors": "workspace:*",
"@grafana/lezer-logql": "0.2.6",
"@grafana/lezer-traceql": "0.0.21",
"@grafana/monaco-logql": "^0.0.8",
"@grafana/o11y-ds-frontend": "workspace:*",
+9 -9
View File
@@ -1931,14 +1931,14 @@
},
"threshold": {
"recovery": {
"stop-alerting-above": "Stop alerting when above",
"stop-alerting-bellow": "Stop alerting when below",
"stop-alerting-equal": "Stop alerting when equal to",
"stop-alerting-inside-range": "Stop alerting when inside range",
"stop-alerting-less": "Stop alerting when less than",
"stop-alerting-more": "Stop alerting when more than",
"stop-alerting-not-equal": "Stop alerting when not equal to",
"stop-alerting-outside-range": "Stop alerting when outside range",
"stop-alerting-above": "Stop alerting (or pending state) when above",
"stop-alerting-bellow": "Stop alerting (or pending state) when below",
"stop-alerting-equal": "Stop alerting (or pending state) when equal to",
"stop-alerting-inside-range": "Stop alerting (or pending state) when inside range",
"stop-alerting-less": "Stop alerting (or pending state) when less than",
"stop-alerting-more": "Stop alerting (or pending state) when more than",
"stop-alerting-not-equal": "Stop alerting (or pending state) when not equal to",
"stop-alerting-outside-range": "Stop alerting (or pending state) when outside range",
"title": "Custom recovery threshold"
}
}
@@ -2330,7 +2330,7 @@
},
"threshold-expression-viewer": {
"input": "Input",
"stop-alerting-when": "Stop alerting when "
"stop-alerting-when": "Stop alerting (or pending state) when "
},
"timeseries-row": {
"time-series-data": "Time series data",
-10
View File
@@ -2823,7 +2823,6 @@ __metadata:
"@emotion/css": "npm:11.13.5"
"@grafana/data": "workspace:*"
"@grafana/e2e-selectors": "workspace:*"
"@grafana/lezer-logql": "npm:0.2.6"
"@grafana/lezer-traceql": "npm:0.0.21"
"@grafana/monaco-logql": "npm:^0.0.8"
"@grafana/o11y-ds-frontend": "workspace:*"
@@ -3170,15 +3169,6 @@ __metadata:
languageName: node
linkType: hard
"@grafana/lezer-logql@npm:0.2.6":
version: 0.2.6
resolution: "@grafana/lezer-logql@npm:0.2.6"
peerDependencies:
"@lezer/lr": ^1.0.0
checksum: 10/09df02b9934f37e9e58731ce0806923618991dfb46510ab29299040860b590359c9083def93176b1076cb1880302a92e527fb5aad0cbf97557a8025c74a997ed
languageName: node
linkType: hard
"@grafana/lezer-logql@npm:0.2.7":
version: 0.2.7
resolution: "@grafana/lezer-logql@npm:0.2.7"