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

prStalenessThreshold #34060

Open
rarkins opened this issue Feb 6, 2025 · 3 comments
Open

prStalenessThreshold #34060

rarkins opened this issue Feb 6, 2025 · 3 comments
Labels
priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Feb 6, 2025

As discussed with @felipecrs in #34012

Add a new configuration option prStalenessThreshold. It should support a duration string with same supported syntax as minimumReleaseAge, e.g. "90 days". It should default to null to retain backwards-compatible behavior, although in future we may choose to give it a non-null default in a new major release.

The behavior should be like this:

  • prStalenessThreshold can be configured in packageRules, even down to per-package or update type if users wish
  • A branch's prStalenessThreshold will be null if all updates within it are null, otherwise it will be the largest of the non-null values
  • If a branch has a prStalenessThreshold defined, and it hasn't been exceeded yet (calculated as "current timestamp minus PR creation timestamp"), then there's no change of behavior
  • If a branch has a prStalenessThreshold defined, and it has been exceeded, then no rebasing or updating (e.g. if a newer version is available) will be done automatically
  • Calculation of staleness should be done post-branchifying and before branch processing
    • Each update should have isStale=true if a prStalenessThreshold exists and is exceeded, isStale=false if a prStalenessThreshold exists and is not exceeded, and no isStale field if no prStalenessThreshold is defined
    • A branch should have no isStale field if no updates have an isStale field, it should have isStale=false if any update has isStale=false, and it should have isStale=true otherwise (i.e. which means if all isStale fields in updates are true)
  • During branch processing, rebasing/updating will be done only if manually triggered by a user (e.g. checkbox or label in PR, or checkbox in Dependency Dashboard)
  • Dependency Dashboard should add new category "Stale" to go below "Open", and PRs which have exceeded it are grouped there instead of Open. It should use the same logic as the branch.isStale described above
@rarkins rarkins added priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality) labels Feb 6, 2025
@felipecrs
Copy link
Contributor

Fantastic. Maybe you should also mention something like Stale PRs should not be counted towards the prConcurrentLimit.

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 6, 2025

I don't think that's a good default behavior, but instead could be configurable

@felipecrs
Copy link
Contributor

Oh ok. We can keep that as a separate, later improvement then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

2 participants