Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
MacOS committed Mar 1, 2025
2 parents fe68d60 + 2cc6f39 commit 6370c37
Show file tree
Hide file tree
Showing 129 changed files with 3,404 additions and 2,008 deletions.
8 changes: 8 additions & 0 deletions .betterer.results
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ exports[`better eslint`] = {
"packages/grafana-data/src/transformations/standardTransformersRegistry.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"packages/grafana-data/src/transformations/transformDataFrame.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
],
"packages/grafana-data/src/transformations/transformers/nulls/nullInsertThreshold.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
Expand Down
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -754,14 +754,16 @@ embed.go @grafana/grafana-as-code
/.github/pr-checks.json @tolzhabayev
/.github/pr-commands.json @tolzhabayev
/.github/renovate.json5 @grafana/frontend-ops
/.github/actions/report-coverage @grafana/grafana-backend-group
/.github/actions/run-backend-tests @grafana/grafana-backend-group
/.github/actions/setup-enterprise @grafana/grafana-backend-group
/.github/workflows/add-to-whats-new.yml @grafana/docs-tooling
/.github/workflows/auto-triager/ @grafana/plugins-platform-frontend
/.github/workflows/alerting-swagger-gen.yml @grafana/alerting-backend
/.github/workflows/alerting-update-module.yml @grafana/alerting-backend
/.github/workflows/auto-milestone.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/backport.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/bump-version.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/backend-coverage.yml @Proximyst
/.github/workflows/close-milestone.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/release-pr.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/release-comms.yml @grafana/grafana-developer-enablement-squad
Expand All @@ -787,6 +789,7 @@ embed.go @grafana/grafana-as-code
/.github/workflows/pr-codeql-analysis-python.yml @DanCech
/.github/workflows/pr-commands.yml @tolzhabayev
/.github/workflows/pr-patch-check.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/pr-test-backend.yml @grafana/grafana-backend-group
/.github/workflows/sync-mirror.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/publish-technical-documentation-next.yml @grafana/docs-tooling
/.github/workflows/publish-technical-documentation-release.yml @grafana/docs-tooling
Expand Down
46 changes: 46 additions & 0 deletions .github/actions/report-coverage/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Report Coverage'
description: 'Processes and uploads coverage reports from Go tests'

inputs:
unit-cov-path:
description: 'Path to unit test coverage file'
required: true
integration-cov-path:
description: 'Path to integration test coverage file'
required: true

runs:
using: "composite"
steps:
- name: Join coverage outputs
shell: bash
run: |
cp ${{ inputs.unit-cov-path }} backend.cov
tail -n+2 ${{ inputs.integration-cov-path }} >> backend.cov
- name: Convert coverage info to per-func stats
shell: bash
run: go tool cover -func backend.cov > backend-funcs.log

- name: Convert coverage info to HTML
shell: bash
run: go tool cover -html backend.cov -o backend.html

- name: Upload coverage file
uses: actions/upload-artifact@v4
with:
name: backend-cov
path: |
backend.cov
backend-funcs.log
backend.html
retention-days: 30
compression-level: 9

- name: Set summary to total coverage
shell: bash
run: |
echo '# Coverage' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
grep 'total:' backend-funcs.log | tr '\t' ' ' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
24 changes: 24 additions & 0 deletions .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Run Backend Tests'
description: 'Runs Grafana backend test suites'

inputs:
coverage-opts:
description: 'Coverage options to pass to the test command (empty for no coverage)'
required: false
default: ''
test-command:
description: 'The test command to run'
required: false
default: 'make gen-go test-go-unit'

runs:
using: "composite"
steps:
- name: Run tests
shell: bash
run: |
if [ -n "${{ inputs.coverage-opts }}" ]; then
COVER_OPTS="${{ inputs.coverage-opts }}" ${{ inputs.test-command }}
else
${{ inputs.test-command }}
fi
48 changes: 48 additions & 0 deletions .github/actions/setup-enterprise/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 'Setup Grafana Enterprise'
description: 'Clones and sets up Grafana Enterprise repository for testing'

inputs:
github-app-name:
description: 'Name of the GitHub App in Vault'
required: false
default: 'grafana-ci-bot'

runs:
using: "composite"
steps:
- name: Retrieve GitHub App secrets
id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets-v1.0.1
with:
repo_secrets: |
APP_ID=${{ inputs.github-app-name }}:app-id
APP_INSTALLATION_ID=${{ inputs.github-app-name }}:app-installation-id
PRIVATE_KEY=${{ inputs.github-app-name }}:private-key
- name: Generate GitHub App token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}
repositories: "grafana-enterprise"
owner: "grafana"

- name: Setup Enterprise
shell: bash
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
git clone https://x-access-token:${GH_TOKEN}@github.com/grafana/grafana-enterprise.git ../grafana-enterprise;
cd ../grafana-enterprise
if git checkout ${GITHUB_HEAD_REF}; then
echo "checked out ${GITHUB_HEAD_REF}"
elif git checkout ${GITHUB_BASE_REF}; then
echo "checked out ${GITHUB_BASE_REF}"
else
git checkout main
fi
./build.sh
11 changes: 8 additions & 3 deletions .github/workflows/alerting-update-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,19 @@ jobs:
FROM_COMMIT=$(go list -m -json github.com/grafana/alerting | jq -r '.Version' | grep -oP '(?<=-)[a-f0-9]+$')
echo "from_commit=$FROM_COMMIT" >> $GITHUB_OUTPUT
- name: Get current branch name
id: current-branch-name
run: echo "name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT"

- name: Get latest commit
id: latest-commit
env:
GH_TOKEN: ${{ github.token }}
run: |
TO_COMMIT=$(gh api repos/grafana/alerting/commits/main --jq '.sha')
if [ -z "$TO_COMMIT" ]; then
echo "Failed to fetch latest commit"
BRANCH="${{ steps.current-branch-name.outputs.name }}"
TO_COMMIT=$(gh api repos/grafana/alerting/commits/$BRANCH --jq '.sha')
if [ -z "$TO_COMMIT" ]; then
echo "Branch $BRANCH not found in alerting repo, falling back to main branch"
exit 1
fi
echo "to_commit=$TO_COMMIT" >> $GITHUB_OUTPUT
Expand Down
109 changes: 0 additions & 109 deletions .github/workflows/backend-coverage.yml

This file was deleted.

Loading

0 comments on commit 6370c37

Please sign in to comment.