fix(hack): make get-grafana-dashboards.sh more robust#6643
fix(hack): make get-grafana-dashboards.sh more robust#6643ti-chi-bot[bot] merged 1 commit intopingcap:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the Grafana dashboard download script to be more robust and maintainable by adding comprehensive error handling, cleanup mechanisms, and better code organization.
Key Changes:
- Removed the non-existent
tidb/metrics/grafanapath that was causing 404 errors - Added structured error handling with
clone_repo()andcopy_if_exists()helper functions to gracefully handle missing directories and git clone failures - Implemented automatic cleanup of temporary directories using a trap handler and enabled stricter bash error detection with
set -euo pipefail
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6643 +/- ##
=======================================
Coverage 39.33% 39.33%
=======================================
Files 351 351
Lines 20665 20665
=======================================
Hits 8129 8129
Misses 12536 12536
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
5403e0b to
657493a
Compare
- Add copy_if_exists() to safely handle missing directories - Add clone_repo() with error handling for git clone failures - Add trap cleanup for automatic temp directory removal - Use set -euo pipefail for stricter error detection - Add usage documentation and code comments - Pass destination as explicit parameter to copy_if_exists()
657493a to
6b08d7e
Compare
|
/test pull-e2e |
1 similar comment
|
/test pull-e2e |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liubog2008 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/cherry-pick release-2.0 |
|
@liubog2008: new pull request created to branch DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
/cherry-pick release-2.0 |
|
@fgksgf: new pull request could not be created: failed to create pull request against pingcap/tidb-operator#release-2.0 from head ti-chi-bot:cherry-pick-6643-to-release-2.0: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"No commits between pingcap:release-2.0 and ti-chi-bot:cherry-pick-6643-to-release-2.0"}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request","status":"422"} DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Uh oh!
There was an error while loading. Please reload this page.