Skip to content
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

chore: remove need for extract_alerts.sh #1

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

grdryn
Copy link

@grdryn grdryn commented Nov 15, 2024

Make excels at tracking generated output files from specified input files (it might be the only thing it's good at).

By having a convention of naming the generated rule files and their corresponding unit test files based on the file names in the ConfigMap, then we don't need a separate script to track the difference in what the files are called inside and outside the ConfigMap, which would need to be updated each time a new unit test file is added. With this change, as long as you name your unit test file in the appropriate way, and there's a corresponding entry in the ConfigMap, then the rule file should get extracted in the expected way.

Description

How Has This Been Tested?

  • Run make test-alerts
    • See that the files get generated as expected
    • See that the tests run as expected
  • Run make test-alerts again
    • See that the files don't get generated again, since Make determines there's no need (if any of the input files is newer, it will regenerate the corresponding output file, but not otherwise
    • See that the tests run as expected
  • Run make -B test-alerts
    • See that the files get generated as expected, because of the -B
    • See that the tests run as expected

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@@ -62,6 +62,3 @@ local.mk

# Ignore temporary files created by the Makefile
*.mktmp.*

#Ignore temporary alert yaml files created by the Makefile
*_alerts.yaml
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grdryn This I think is needed. Not only for these changes but so that anyone running prometheus-alert tests locally doesn't push these files by mistake.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I see you've added a separate .gitignore. But I'm not sure if there is a benefit of having a separate file for this.

Copy link
Owner

@biswassri biswassri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Make excels at tracking generated output files from specified input
files (it might be the only thing it's good at).

By having a convention of naming the generated rule files and their
corresponding unit test files based on the file names in the
ConfigMap, then we don't need a separate script to track the
difference in what the files are called inside and outside the
ConfigMap, which would need to be updated each time a new unit test
file is added. With this change, as long as you name your unit test
file in the appropriate way, and there's a corresponding entry in the
ConfigMap, then the rule file should get extracted in the expected
way.
@biswassri biswassri merged commit 5a453e9 into biswassri:unit-test-makefile Nov 15, 2024
1 check passed
@grdryn grdryn deleted the prom-test-things branch November 15, 2024 19:47
biswassri pushed a commit that referenced this pull request Nov 20, 2024
Current implementation incorrectly calls removal of a header which is
manifested in ingress gateway proxy logs:

```
envoy lua external/envoy/source/extensions/filters/http/lua/lua_filter.cc:930  script log: [string "function envoy_on_request(request_handle)..."]:10: bad argument #1 to 'remove' (N5Envoy10Extensions11HttpFilters3Lua16HeaderMapWrapperE expected, got string`
```

This fixes the Lua syntax and marks Service Mesh Features related to
KServe setup as `Managed()`. This ensures that updating the existing
filters will happen on operator upgrade or next reconcile.
biswassri pushed a commit that referenced this pull request Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants