PMM-7 Improve GH Actions#5531
Conversation
- Remove `on.push` triggers as useless - use `ubuntu-latest` images
There was a problem hiding this comment.
Pull request overview
This PR updates PMM’s GitHub Actions configuration to reduce unnecessary workflow runs and modernize runner/config defaults, while adjusting the “main” workflow to split checks/build/tests into separate jobs.
Changes:
- Tighten workflow triggers (move many component workflows to
pull_requestwithpathsfilters; ignore*.mdin several workflows). - Standardize GitHub Actions YAML headers (
---) and migrate runners toubuntu-latest. - Rework parts of CI execution/caching (e.g., separate
main.ymljobs; update caches and Go env usage in several workflows).
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile.include | Adjust test-common package filtering used by CI. |
| .github/workflows/vmproxy.yml | Restrict vmproxy CI to PR path filters and update runner/config. |
| .github/workflows/ui.yml | Add YAML doc header and switch runner to ubuntu-latest. |
| .github/workflows/scorecard.yml | Add YAML doc header. |
| .github/workflows/sbom.yml | Add YAML doc header and switch runner to ubuntu-latest. |
| .github/workflows/release-doc.yml | Add YAML doc header and switch runner to ubuntu-latest. |
| .github/workflows/qan-api2.yml | Restrict QAN CI triggers to PR paths and normalize steps/config. |
| .github/workflows/percona-intelligence.yml | Restrict triggers to PR paths and add explicit Go/module/build caching. |
| .github/workflows/merge-gatekeeper.yml | Update ignored checks list for merge gatekeeping. |
| .github/workflows/managed.yml | Restrict Managed workflow triggers to PR paths and revise caching/container setup. |
| .github/workflows/main.yml | Convert to PR-only, split into separate check/build/test jobs, and adjust path filters. |
| .github/workflows/linkspector.yml | Add YAML doc header and switch runner to ubuntu-latest. |
| .github/workflows/labels.yml | Add YAML doc header. |
| .github/workflows/documentation.yml | Add YAML doc header. |
| .github/workflows/dockerhub-readme.yml | Add YAML doc header. |
| .github/workflows/devcontainer.yml | Add YAML doc header and switch runner to ubuntu-latest. |
| .github/workflows/dependabot.yml | Add YAML doc header and rename workflow; switch runner to ubuntu-latest. |
| .github/workflows/dashboards.yml | Normalize YAML header/formatting and switch Node setup to .nvmrc. |
| .github/workflows/clean.yml | Add YAML doc header, switch runner to ubuntu-latest, and reorder steps. |
| .github/workflows/api.yml | Add YAML doc header and exclude *.md from API-doc sync trigger. |
| .github/workflows/api-tests.yml | Add YAML doc header, normalize workflow name, switch runner to ubuntu-latest. |
| .github/workflows/agent.yml | Restrict agent CI triggers to PR paths and switch runner to ubuntu-latest. |
| .github/workflows/admin.yml | Restrict admin CI triggers to PR paths and switch runner to ubuntu-latest. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5531 +/- ##
==========================================
+ Coverage 43.03% 43.54% +0.51%
==========================================
Files 414 544 +130
Lines 43050 45398 +2348
Branches 0 590 +590
==========================================
+ Hits 18525 19768 +1243
- Misses 22679 23693 +1014
- Partials 1846 1937 +91
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 69 out of 75 changed files in this pull request and generated 3 comments.
Files not reviewed (6)
- api/accesscontrol/v1beta1/accesscontrol.pb.go: Generated file
- api/actions/v1/actions.pb.go: Generated file
- api/advisors/v1/advisors.pb.go: Generated file
- api/agent/v1/agent.pb.go: Generated file
- api/agent/v1/collector.pb.go: Generated file
- api/agentlocal/v1/agentlocal.pb.go: Generated file
Comments suppressed due to low confidence (1)
.github/workflows/ui.yml:34
actions/setup-nodeis pointing to.nvmrcandyarn.lockin the repo root, but this repo keeps both files underui/. With the currentdefaults.run.working-directory: .../ui, Node setup will fail to resolve the version file and the Yarn cache key will use a non-existent lockfile.
node-version-file: ui/.nvmrc
cache: yarn
cache-dependency-path: ui/yarn.lock
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 36 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
qan-api2/main.go:267
kingpin.Versionnow reportsversion.FullInfo(), but the startup log later still printsversion.ShortInfo(). That can be confusing when comparing--versionoutput vs logs; consider switching the log toFullInfo()for consistency.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 36 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
.github/workflows/clean.yml:38
go clean -modcache/go clean -cacheonly affects the runner filesystem. Since this job runs on GitHub-hosted runners, it won’t actually clear the persisted Actions caches restored bysetup-go-release(andactions/cachewon’t re-save on a cache hit), so the workflow becomes effectively a no-op for its stated purpose. If the goal is to reclaim Actions cache storage, consider deleting the Go cache entries via the GitHub Actions Cache API using the same keys used by the composite action.
- name: Setup Go release
uses: ./.github/actions/setup-go-release
- name: Clean Go modules cache
run: go clean -modcache
- name: Clean Go build cache
run: go clean -cache
PMM-7
This pull request introduces significant improvements and refactoring to the GitHub Actions workflows, focusing on standardizing the setup for Go-based projects, improving static checks, and enhancing maintainability. The changes include the introduction of a reusable composite GitHub Action for Go environment setup and caching, reorganization of workflow files for better modularity, and updates to job definitions to use the new action. Several new workflows are also added for API documentation and testing, while some obsolete workflows are removed.
The main idea behind this PR: run GH action granularily depending on component/directory where the changes are introduced. in order to achieve this purpose there were changes introduced primarily in Makefiles - split one upper-level action(like code formatting) into the same by logic and results/impact but with isolated context(per component).
Now the whole list of PMM components rebuild is not executed if there is one-line change in documentation.
Key changes include:
Standardization and Reuse
.github/actions/setup-go-releaseto centralize Go environment setup and caching logic, which is now used across all relevant workflows to ensure consistency and reduce duplication.Workflow Refactoring and Enhancements
admin.yml,agent.yml,api.yml,api-tests-static.yml,dashboards.yml) to use the new setup action, improved job structure (separating static checks, build, and test), and updated matrix and notification logic for better reliability and maintainability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]New and Improved Workflows
api.yml) has been renamed to API documentation sync (api-docs.yml) and new one has been introduced for API tests code checks (api-tests-static.yml), and improved existing API test dispatch logic (api-tests.yml). [1] [2] [3] [4]Cleanup and Removal
clean.ymlworkflow has been renamed topr-cache-cleanup.ymland reworked - now it cleans up all PR-related caches once the PR is closed/merged/rejected.Miscellaneous
.nvmrcfor Node.js versioning in dashboard workflows and updating job environments toubuntu-latestfor consistency. [1] [2] [3] [4]These changes collectively modernize and streamline the CI/CD setup, making it easier to maintain and extend in the future.