Skip to content

Feature request: Synchronize with git repo #4

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

Open
tghosth opened this issue Mar 2, 2025 · 2 comments
Open

Feature request: Synchronize with git repo #4

tghosth opened this issue Mar 2, 2025 · 2 comments

Comments

@tghosth
Copy link

tghosth commented Mar 2, 2025

(Copied from opengrep/opengrep#54 with a focus on the synchronize with git repo aspect)

Is your feature request related to a problem? Please describe.

The Semgrep playground is a great tool and being able to store rules next to it is useful but the functionality around the rule storage there is very basic, e.g. rules there are not sorted in any sane way nor are they stored in a convenient place.

See example:

Describe the solution you'd like

It would be great if the Opengrep playground had the ability to store rules and test cases in a public or private git repo and synchronize within the UI.

Use case
Easier rule development and maintenance.

@dimitris-m
Copy link
Contributor

I think this functionality is orthogonal to the features of the playground, and it would probably require significant resources. Are you suggesting we implement what amounts to a basic git GUI?

Maybe some convenient local file management would help, to quickly access local folders with rules, but git would remain the responsibility of the user.

@tghosth
Copy link
Author

tghosth commented Mar 12, 2025

Maybe some convenient local file management would help, to quickly access local folders with rules, but git would remain the responsibility of the user.

So this is a good idea. Maybe have a pre-defined folder structure and then the user selects the container folder.

So maybe you have:

  • SemgrepRules (directory):
    • Rules (directory):
      • some-sqlirule.yaml (file)
      • some-cust-check.yaml (file)
      • Other rules (directory):
        • another-rule.yaml (file)
    • Tests (directory):
      • some-sqlirule.ts (file)
      • some-cust-check.cs (file)
      • Other rules (directory):
        • another-rule.java (file)

Where the basic rule is that rules are in the "rules" folder and tests are in the "tests" folder and each rule should have a matching test at the same folder and filename but obviously with a file extension which matches what the rule is looking for.

Then it is on the user to handle the git wizardry on disk.

Maybe you could also make the playground into an IDE add-in :)

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

No branches or pull requests

2 participants