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

Ability to pull in rules from remote repos #1

Closed
3 of 4 tasks
armanrahman22 opened this issue Jul 7, 2021 · 1 comment · Fixed by #28
Closed
3 of 4 tasks

Ability to pull in rules from remote repos #1

armanrahman22 opened this issue Jul 7, 2021 · 1 comment · Fixed by #28
Assignees
Labels
enhancement New feature or request High Priority pending upstream issue exists Add this label when there is a duplicate issue on the upstream repo

Comments

@armanrahman22
Copy link

armanrahman22 commented Jul 7, 2021

Right now the code looks locally for the rules file, but we want to be able to source it from any public URL to allow for reuse of external rule sets

Acceptance Criteria:

  • Implement ability to run the linter on a publicly accessible ruleset file by pointing to it in the cli arguments. e.g. woke -c https://raw.githubusercontent.com/get-woke/woke/main/example.yaml
  • Review comments from maintainer on the PR
  • Apply code changes (some of these might require changing to use git-go package, or make upstream changes to git-go package itself)
  • Ensure PR is merged in source repo
@armanrahman22 armanrahman22 added the enhancement New feature or request label Jul 7, 2021
@mkcomer mkcomer self-assigned this Jul 19, 2021
@armanrahman22 armanrahman22 added the upstream issue exists Add this label when there is a duplicate issue on the upstream repo label Jul 19, 2021
@mkcomer
Copy link

mkcomer commented Jul 20, 2021

When setting a custom config, I noticed:

if rule set contents is just "hello" --> we get error
FTL error="yaml: unmarshal errors:\n line 1: cannot unmarshal !!str hello into config.Config"
exit status 1

if rule set contents is "404: Not Found" --> no error, believes it is a valid yaml in general, but it is not a valid rule set yaml --> therefore doesn't add the custom rules and doesn't log this out.

Suggested enhancement:

  1. Easier lift - add error handling to adding a rulesets - if it fails, tell us your yaml was an invalid rule set config and we didn't add your rules.
  2. Larger lift - Add a schema validator for custom yaml file + add custom error handling while parsing yaml for contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request High Priority pending upstream issue exists Add this label when there is a duplicate issue on the upstream repo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants