-
Notifications
You must be signed in to change notification settings - Fork 1
created a workflow and added a valid test for testing #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
runs-on: ubuntu-latest | ||
# needs: define-matrix | ||
# strategy: | ||
# matrix: | ||
# files: ${{ fromJSON(needs.define-matrix.outputs.rule_files) }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: install PromTool | ||
run: | | ||
curl -O -L https://github.com/prometheus/prometheus/releases/download/v3.2.0/prometheus-3.2.0.linux-amd64.tar.gz | ||
tar -xvf prometheus-3.2.0.linux-amd64.tar.gz | ||
sudo cp prometheus-3.2.0.linux-amd64/promtool /usr/local/bin/ | ||
sudo chmod +x /usr/local/bin/promtool | ||
sudo rm -rf prometheus* | ||
|
||
- name: Format rule files with yq and remove unwanted fields for testing | ||
run: | | ||
for file in $(ls observability/rules);do yq eval -i '.spec | del(.groups[].params, .groups[].concurrency)' ./observability/rules/$file ;done | ||
|
||
- name: Run syntax check on rule files | ||
run: | | ||
for file in $(ls observability/rules);do /usr/local/bin/promtool check rules ./observability/rules/$file ;done | ||
|
||
- name: Run unit tests | ||
run: | | ||
for test in $(ls observability/tests);do /usr/local/bin/promtool test rules ./observability/tests/$test ;done | ||
|
||
|
||
|
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 days ago
To fix the issue, we need to add a permissions
block to the workflow. Since the workflow primarily involves checking out the repository and running tests, it likely only requires read access to the repository contents. We will add the permissions
block at the root level of the workflow to apply it to all jobs. The block will specify contents: read
, which is the minimal permission required for the workflow to function securely.
-
Copy modified lines R2-R3
@@ -1,2 +1,4 @@ | ||
name: Run unit tests for Alerts | ||
permissions: | ||
contents: read | ||
on: |
Tofu Plan Output - observability_stack_ctrl_plane_k8s
|
Tofu Plan Output - observability_stack_ctrl_plane_infra
|
fix #119