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 a mechanism to configure validators for branch actions (sync, merge, and revert) #122

Closed
jeremystretch opened this issue Sep 13, 2024 · 0 comments
Assignees
Labels
type: feature A new feature or functionality
Milestone

Comments

@jeremystretch
Copy link
Contributor

Plugin Version

v0.5.0

Proposed functionality

Enable the configuration of standalone validators to determine whether a particular branch can have some action performed (i.e. be synced, merged, or reverted). Before any of these operations takes place, the configured validator(s), if any, will be run, with the branch passed as an argument. If any validator returns False, the action will not be permitted.

A validator might look something like this:

def merge_is_allowed(branch):
    # No changes on Friday!
    return datetime.datetime.today().weekday() != 4

This would be configured as:

{
    "branch_merge_validators": ["myplugin.utils.merge_is_allowed"]
}

Use case

This feature provides a hook for administrators to enforce custom policies concerning branch actions. For example, an admin might wish to disable merging a branch on certain days (as in the example above), or may require that a branch be logged in some external ticketing system.

External dependencies

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature or functionality
Projects
None yet
Development

No branches or pull requests

1 participant