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

Create basic rule #9

Closed
Bullrich opened this issue Jul 6, 2023 · 0 comments · Fixed by #23
Closed

Create basic rule #9

Bullrich opened this issue Jul 6, 2023 · 0 comments · Fixed by #23
Assignees

Comments

@Bullrich
Copy link
Contributor

Bullrich commented Jul 6, 2023

Create simple rule which works without particular functionality: https://github.com/paritytech/pr-custom-review#basic-rule-syntax-

@Bullrich Bullrich added this to the Project launch milestone Jul 6, 2023
@Bullrich Bullrich self-assigned this Jul 6, 2023
Bullrich added a commit that referenced this issue Jul 18, 2023
Created object for basic rule.

First step towards #9

By using Types in typescript we can differ what is the type of rule
easily. I also added checks to Joi to ensure that the rule has
everything required before individually validating it.

Added tests to evaluate the process thoroughly.
Bullrich added a commit that referenced this issue Jul 25, 2023
## Basic rule
Implemented the functionality of the basic rule.

Because every rule ends up being simplified into:
```typescript
{
  min_approvals: number;
  teams?: string[];
  users?: string[];
}
```

I created a basic logic that evaluates that. After this, we can use the
result of those smaller conditions to evaluate the more complex rules.

I added a lot of tests and tried to do as many comments to explain the
logic as possible.

## Teams API
Created class which handles the teams token and obtains the team members
of a team.

This class is small but handles the token used for such authentication
and separates the concern.

If we decide to replace GitHub teams for on-chain data (like mentioned
in paritytech/opstooling#245) this would let us to simply switch the
implementation with minimal alterations.

Closes #22 and closes #9
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 a pull request may close this issue.

1 participant