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

Provide time to filters as Go template #375

Open
polds opened this issue May 28, 2024 · 0 comments
Open

Provide time to filters as Go template #375

polds opened this issue May 28, 2024 · 0 comments

Comments

@polds
Copy link

polds commented May 28, 2024

Is your feature request related to a problem? Please describe.
I would like to create filters for "stale" or "fresh" issues using Github's created: and updated: filters. Github does not allow relative durations but require a ISO_8601 date (with optional additional timestamp) docs.

Due to the requirement of having an absolute timestamp, it's not possible to create a filter that shows PRs created in the last week, or older than a month, etc.

Describe the solution you'd like
Filters are passed through Go's template engine, "now" is provided, along with a duration parsing method. An example could be something like now, date, and dateModify from slim-sprig which would theoretically enable something like this:

- title: Stale PRs
  filters: >-
    is:open
    review-requested:@me
    updated:<={{ now | date_modify "-30d" | date "2006-01-02" }}

I imagine an edge case with a solution like this is the filters would need to be reevaluted during every refetchIntervalMinutes and not computed on dashboard inititialization.

Describe alternatives you've considered
I'm not aware of this being feasible beyond maybe automating the date adjustments in the config.

Additional context
N/A

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

1 participant