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

Feature: Add Include/Exclude Class regular expression matcher #4937

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ying-jeanne
Copy link

@ying-jeanne ying-jeanne commented May 15, 2024

What's being changed:

/claim #2481

Never used bounty before, just for fun, thank you for building this nice project.

This PR aims to address issue #2481.

I think it is just a bad idea trying to guess whether users intend to use an exact match or a regular expression. So in order to distinguish the intention and give more flexibility on settings, whether we could change include list to a list of struct:

{
  "include": [
      {
          "expression": "foo",
          "is_regex": false
      }
  ]
}

This approach offers clarity in distinguishing between exact matches and regular expressions. However, it may increase verbosity.

or adding a new array:

{
    "include_patterns": []{}
}

This alternative maintains backward compatibility with existing APIs and reduces verbosity. This PR use the second approach, if the direction seems ok, i would update docs and examples accordingly, please let me know.

Review checklist

  • Documentation has been updated, if necessary. Link to changed documentation:
  • Chaos pipeline run or not necessary. Link to pipeline:
  • All new code is covered by tests where it is reasonable.
  • Performance tests have been run or not necessary.

@ying-jeanne ying-jeanne marked this pull request as ready for review May 15, 2024 23:33
Signed-off-by: Ying WANG <ying.wang@grafana.com>
Copy link

algora-pbc bot commented May 15, 2024

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe/Alipay.

Signed-off-by: Ying WANG <ying.wang@grafana.com>
Copy link

sonarcloud bot commented Jun 4, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
8.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud


# Target to format code using gofumpt
.PHONY: install-gofumpt format
format: install-gofumpt
Copy link
Author

Choose a reason for hiding this comment

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

add make format and make generate-code, I used them to fix CI.

@ying-jeanne
Copy link
Author

After running make generate-code, sonar failed for duplication, i think we should exclude certain folder from duplication check. I am not very familiar with sonar code analysis config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant