Skip to content

Commit

Permalink
Revert "Add mergeable for PRs"
Browse files Browse the repository at this point in the history
This reverts commit 2c48333.

Something is borked, nothing is saved anylonger.
  • Loading branch information
chelmertz committed Jun 4, 2024
1 parent 2c48333 commit 0af8d8e
Showing 8 changed files with 5 additions and 27 deletions.
3 changes: 0 additions & 3 deletions internal/github/github.go
Original file line number Diff line number Diff line change
@@ -40,7 +40,6 @@ type prSearchResultGraphQl struct {
}
}
ReviewDecision string
Mergeable bool
UpdatedAt string
Author struct {
Login string
@@ -265,7 +264,6 @@ func QueryGithub(token string, username string, logger *slog.Logger) ([]types.Vi
RepoOwner: pr.Repository.Owner.Login,
RepoUrl: pr.Repository.Url,
IsDraft: pr.IsDraft,
Mergeable: pr.Mergeable,
LastUpdated: updatedAt,
LastPrCommenter: lastPrCommenter,
ThreadsActionable: threadsActionable,
@@ -364,7 +362,6 @@ func querySearchPrsInvolvingUser(username string) string {
}
}
reviewDecision
mergeable
updatedAt
author {
login
8 changes: 0 additions & 8 deletions internal/points/points.go
Original file line number Diff line number Diff line change
@@ -57,10 +57,6 @@ func StandardPrPoints(pr types.ViewPr, username string) *Points {
// at it
points.Add(10, "You should add reviewers")
}

if !pr.Mergeable {
points.Add(150, "Some checks failed (failed build/test, merge conflicts, github actions, etc.)")
}
} else {
// someone else's pr, or our but the username is not set
if pr.ReviewStatus == "APPROVED" {
@@ -96,10 +92,6 @@ func StandardPrPoints(pr types.ViewPr, username string) *Points {
case diff > 300:
points.Add(10, fmt.Sprintf("PR is bigish, %d loc changed is >300", diff))
}

if !pr.Mergeable {
points.Remove(150, "Some checks failed (failed build/test, merge conflicts, github actions, etc.)")
}
}

if pr.ThreadsActionable > 0 {
1 change: 0 additions & 1 deletion internal/storage/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions internal/storage/query.sql
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@ insert into prs (
repo_owner,
repo_url,
is_draft,
mergeable,
last_updated,
last_pr_commenter,
threads_actionable,
@@ -21,7 +20,7 @@ insert into prs (
review_requested_from_users,
buried
) values (
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
) returning *;

-- name: DeletePrs :exec
14 changes: 4 additions & 10 deletions internal/storage/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion internal/storage/schema.sql
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ create table if not exists prs (
repo_owner text not null,
repo_url text not null,
is_draft boolean not null,
mergeable boolean not null,
last_updated text not null,
last_pr_commenter text not null,
threads_actionable integer not null,
1 change: 0 additions & 1 deletion internal/storage/storage.go
Original file line number Diff line number Diff line change
@@ -117,7 +117,6 @@ func (s *Storage) StoreRepoPrs(orderedPrs []types.ViewPr) error {
RepoName: pr.RepoName,
RepoOwner: pr.RepoOwner,
RepoUrl: pr.RepoUrl,
Mergeable: pr.Mergeable,
IsDraft: pr.IsDraft,
LastUpdated: pr.LastUpdated.Format(time.RFC3339),
LastPrCommenter: pr.LastPrCommenter,
1 change: 0 additions & 1 deletion internal/types/types.go
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@ type ViewPr struct {
RepoOwner string
RepoUrl string
IsDraft bool
Mergeable bool
LastUpdated time.Time
LastPrCommenter string
ThreadsActionable int

0 comments on commit 0af8d8e

Please # to comment.