Skip to content

refactor rulesets into separate files and add a ruleset compiler cli …#41

Merged
mms-gianni merged 1 commit into
everywall:mainfrom
deoxykev:refactor_rulesets
Nov 16, 2023
Merged

refactor rulesets into separate files and add a ruleset compiler cli …#41
mms-gianni merged 1 commit into
everywall:mainfrom
deoxykev:refactor_rulesets

Conversation

@deoxykev

Copy link
Copy Markdown
Contributor

This PR does the following:

  1. Break out the monolithic ruleset.yaml into an organized directory of smaller rulesets.
rulesets
├── ca
│  └── _multi-metroland-media-group.yaml
├── ch
│  └── nzz-ch.yaml
├── de
│  └── tagesspiegel-de.yaml
├── gb
│  └── ft-com.yaml
└── us
   ├── _multi-conde-nast.yaml
   ├── americanbanker-com.yaml
   ├── medium-com.yaml
   ├── nytimes-com.yaml
   ├── usatoday-com.yaml
   └── washingtonpost-com.yaml

Create a CLI option --merge-ruleset and --merge-ruleset-gzip that optionally merges the rulesets into a single file for release.


I'm not familiar enough with Github CI/CD and goreleaser to make changes with the releaser, but ideally the ruleset.yaml should be distributed with the release files.

Something like this in .github/workflows/release-binaries.yaml

        name: Build rulesets for release
        run: |
          go run cmd/main.go --ruleset "./rulesets" --merge-rulesets --merge-rulesets-output "ruleset.yaml"

@mms-gianni

Copy link
Copy Markdown
Contributor

My first intention was to create a bash script. But this is way better.

  1. It ships with the app.
  2. it aligns automatically with the app.
  3. It is typesafe

Writing an action to install the binary and generate the rules is a challenge. But I think I can handle that.

@mms-gianni mms-gianni merged commit a835031 into everywall:main Nov 16, 2023
Comment thread pkg/ruleset/ruleset.go
} `yaml:"urlMods"`
Domain []Regex `yaml:"domain,omitempty"`
Path []Regex `yaml:"path,omitempty"`
Query []KV `yaml:"queryomitempty"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found this typo and fixed it 😄

andesco pushed a commit to andesco/ladder that referenced this pull request Sep 15, 2025
refactor rulesets into separate files and add a ruleset compiler cli …
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