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

feat(filters): add note filter #50

Merged
merged 6 commits into from
Feb 24, 2024
Merged

feat(filters): add note filter #50

merged 6 commits into from
Feb 24, 2024

Conversation

shouya
Copy link
Owner

@shouya shouya commented Feb 24, 2024

This filter allows you to add comments. Just insert a note: <your comment> line in the filter list.

The note filter does not affect the pipeline in any way, although it does count as a filter in the limit_filters setting.

Example:

- path: /foo.xml
  source: https://example.com/foo.xml
  note: This is the note for the endpoint
  filters:
    - full_text: {}
    - note: You can add a note filter to add comments to the pipeline.
    - merge: https://example.com/bar.xml
    - note: |
        This is a multiline note.
        It can be useful to add more detailed comments.

An alternative approach I considered was to add a note field to all filters. However, this approach is limited because many filters are configured not as a struct. Often the case the config is just a single literal value, or a list of values. It would be inconsistent to add note field to those filters. I made an attempt in 2a38701, but reverted it due to the above reason.

@shouya shouya merged commit 3260408 into master Feb 24, 2024
2 checks passed
@shouya shouya deleted the add-note-filter branch February 24, 2024 14:17
@shouya shouya mentioned this pull request Feb 24, 2024
shouya added a commit that referenced this pull request Feb 25, 2024
This filter allows you to add comments. Just insert a `note: <your
comment>` line in the filter list.

The `note` filter does not affect the pipeline in any way, although it
does count as a filter in the `limit_filters` setting.

Example:

```yaml
- path: /foo.xml
  source: https://example.com/foo.xml
  note: This is the note for the endpoint
  filters:
    - full_text: {}
    - note: You can add a note filter to add comments to the pipeline.
    - merge: https://example.com/bar.xml
    - note: |
        This is a multiline note.
        It can be useful to add more detailed comments.
```

---------

An alternative approach I considered was to add a `note` field to all
filters. However, this approach is limited because many filters are
configured not as a struct. Often the case the config is just a single
literal value, or a list of values. It would be inconsistent to add
`note` field to those filters. I made an attempt in
2a38701, but reverted it due to the
above reason.

---------

Co-authored-by: shouya <shouya@users.noreply.github.com>
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.

1 participant