This repository has been archived by the owner on Jan 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 124
First pr merge semver #27
Open
jonbodner
wants to merge
18
commits into
lgtmco:master
Choose a base branch
from
jonbodner:first_pr_merge_semver
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c3ceee2
First part of auto merge and versioning
1d995f0
Merge branch 'master' of https://github.com/lgtmco/lgtm
f2b46bc
Fix imports
a49a2af
delete the status hook when removing the integration
31bb3ca
go back to a single webhook, because that's all we get.
51190da
Add merging of branches with success status
5e2214c
Add property support for managing versioning and merging. Add initial…
249b0d3
Fix bug in LGTM that wipes out existing contexts when LGTM context is…
19bd637
Merge branch 'fix_status_checks_on_create' into merge_status_check_fix
e6dd925
Merge status check fix and fix compilation issues.
6b31038
Version support in comments added.
18cc997
Put in some fixes for getting pull requests via search
0da11a3
Get the combined status for a branch. Also be sure that the pong mess…
f2f12e2
Stop trying to run the status hook when a comment hook was received
1d407bd
Remove shazbot references.
88f076b
go fmt code
jonbodner ccd9950
rename model.Branch.BranchStatus to model.Branch.Status
jonbodner 34ccb73
Removed GetStatusHook from remote API and merged it with GetHook. Rem…
jonbodner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ bindata.go | |
web/react/node_modules | ||
web/static/files/script.js | ||
#web/static/files/*.css | ||
|
||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package api | ||
|
||
import ( | ||
log "github.com/Sirupsen/logrus" | ||
"github.com/gin-gonic/gin" | ||
"github.com/lgtmco/lgtm/cache" | ||
"github.com/lgtmco/lgtm/model" | ||
"github.com/lgtmco/lgtm/router/middleware/session" | ||
"github.com/lgtmco/lgtm/store" | ||
) | ||
|
||
func GetTags(c *gin.Context) { | ||
var ( | ||
owner = c.Param("owner") | ||
name = c.Param("repo") | ||
user = session.User(c) | ||
) | ||
repo, err := store.GetRepoOwnerName(c, owner, name) | ||
if err != nil { | ||
log.Errorf("Error getting repository %s. %s", name, err) | ||
c.AbortWithStatus(404) | ||
return | ||
} | ||
tags, err := cache.GetTags(c, user, repo) | ||
if err != nil { | ||
log.Errorf("Error getting remote tag list. %s", err) | ||
c.String(500, "Error getting remote tag list") | ||
return | ||
} | ||
|
||
// copy the slice since we don't | ||
// want any nasty data races if the slice came from the cache. | ||
tagsc := make(model.TagList, len(tags)) | ||
copy(tagsc, tags) | ||
|
||
c.JSON(200, tagsc) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package model | ||
|
||
type BranchStatus string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package model | ||
|
||
type StatusHook struct { | ||
SHA string | ||
Repo *Repo | ||
} | ||
|
||
type PullRequest struct { | ||
Issue | ||
Branch Branch | ||
} | ||
|
||
type Branch struct { | ||
Name string | ||
Status string | ||
Mergeable bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package model | ||
|
||
import ( | ||
log "github.com/Sirupsen/logrus" | ||
"github.com/hashicorp/go-version" | ||
) | ||
|
||
type Tag string | ||
|
||
type TagList []Tag | ||
|
||
func (tl TagList) GetMaxTag() (Tag, *version.Version) { | ||
//find the previous largest semver value | ||
var maxVer *version.Version | ||
var maxTag Tag | ||
|
||
for _, tag := range tl { | ||
curVer, err := version.NewVersion(string(tag)) | ||
if err != nil { | ||
continue | ||
} | ||
if maxVer == nil || curVer.GreaterThan(maxVer) { | ||
maxVer = curVer | ||
maxTag = tag | ||
} | ||
} | ||
|
||
if maxVer == nil { | ||
maxVer, _ = version.NewVersion("v0.0.0") | ||
} | ||
log.Debugf("maxVer found is %s", maxVer.String()) | ||
return maxTag, maxVer | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is
gofmt
run on the code? I would expect it to remove the spacing after re