Conversation
7cfc844 to
ee11e3a
Compare
There was a problem hiding this comment.
Maybe CommitStatus is better than StatusTable?
There was a problem hiding this comment.
don't use TEXT since SHA has a fixed length.
There was a problem hiding this comment.
Since there's talk about replacing SHA1 in git with "something else" we probably shouldn't make assumptions about it's length.
There was a problem hiding this comment.
But some databases will be failed if the index column is too long like mysql and mariadb. This happend on #1283 .
There was a problem hiding this comment.
It is the Counter across Repo and SHA. Each SHA has up to 1000 statuses (I don't actually limit, github api docs specifies it though).
|
@lunny All things should be fixed 🙂 |
|
Well, fully working 🎉 |
|
build failed and conflicted |
d16d6cd to
7ba765a
Compare
| // CommitStatusFailure is for when the Status is Failure | ||
| CommitStatusFailure CommitStatusState = "failure" | ||
| // CommitStatusWarning is for when the Status is Warning | ||
| CommitStatusWarning CommitStatusState = "warning" |
There was a problem hiding this comment.
Hm, I never saw that in any other hosting software. From my point of view, this state is not necessary. Warnings are part of the build processes, never the less its still successful.
There was a problem hiding this comment.
It's an idea that I got then I have flaky tests/internet. Basically if a test fails I wanna restart it once automatically, if it success on second try mark with 'warning' 🙂 (good for when you're getting rate-limited by Alpines Repo CDN 😂 )
There was a problem hiding this comment.
In any case, it's a super-set of GitHub API, so it won't hurt to have it 🙂
There was a problem hiding this comment.
Fair point, wasn't sure about the use case. ;-) I never got in touch which such problems since all our company builds run locally without any external dependencies. On the other hand, having such problems in your tests is also not ideal.^^
There was a problem hiding this comment.
Well, got the initial idea when I had intermittant race-conditions in my tests. Re-running the tests made 'em pass, but you should obviously fix the race-condition, hence "warning" 😉
The reason I want it thought is mainly for when you're rate-limited. I want it to return "warning" since you should fix the issue, but it might not be critical to fix it now 🙂
|
You need to have a fixed length for string index (like https://github.com/go-gitea/gitea/pull/1332/files#diff-cbd97f0ad3f0f48c8a314bbcfaf60f0cR19) to be compatible with mysql/mariadb (http://stackoverflow.com/questions/1827063/mysql-error-key-specification-without-a-key-length). If git change the format we only have to upgrade it size or create a sub-object. Trust me, I learned it the hard way ^^ |
|
conflicts |
|
Yeah I'm looking forward to see better CI integration too. 👍 Go !!!! |
7ba765a to
ee1f2c0
Compare
|
@lunny please re-review :) |
| // Use of this source code is governed by a MIT-style | ||
| // license that can be found in the LICENSE file. | ||
|
|
||
| // +build disabled |
There was a problem hiding this comment.
Because the tests were failing 😂 Thanks for pointing that out
|
@bkcsoft build failed. the new table affected the tests. |
|
@lunny now it should build ;) |
|
But it still conflicts @bkcsoft |
9c1a7ce to
5f81701
Compare
|
Rebased, resolved conflicts, squashed, builds and tests passing, ready to go! 🎉 |
|
Done! |
|
LGTM |
| sess.Rollback() | ||
| return fmt.Errorf("newCommitStatus[%s, %s]: %v", opts.Repo.RepoPath(), opts.SHA, err) | ||
| } | ||
| sess.Commit() |
| ID int64 `xorm:"pk autoincr"` | ||
| Index int64 `xorm:"INDEX UNIQUE(repo_sha_index)"` | ||
| RepoID int64 `xorm:"INDEX UNIQUE(repo_sha_index)"` | ||
| State string `xorm:"TEXT NOT NULL"` |
There was a problem hiding this comment.
State should also have a fixed size.
| @@ -0,0 +1,30 @@ | |||
| package migrations | |||
|
@bkcsoft conflicts. |
0b8ad58 to
503015a
Compare
|
@bkcsoft still conflicted |
503015a to
27990d5
Compare
|
@lunny Done! 🎉 Merge It! 😂 |
|
LGTM go go go ! Looking forward to Drone reporting build status of PRs ! :) |
|
@strk Me too, but I'm not gonna be the one doing that unfortunately. I really don't have any time to spare ATM 😢 |
| defer sess.Close() | ||
| if err = sess.Begin(); err != nil { | ||
| return fmt.Errorf("newCommitStatus[%s, %s]: %v", opts.Repo.RepoPath(), opts.SHA, err) | ||
| } |
There was a problem hiding this comment.
This sess & Begin isn't required
|
Can I generate an oauth2 token with limited scope to update the commit status ? (like github or bitbucket does). eg, I could give this token to drone to allow seamless security controlled access |
|
@JohnTheodore You can generate a Deploy Token for use with this. In your Repository goto |
|
This seems to have been merged but I don't see any reference to it in swagger and I can't find any other documentation about it. Should the Status API stuff show up in swagger? |
|
Don't worry. I finally tracked down the new swagger location on try.gitea.io and it looks like a lot of things have been fixed since the v1.2.x release. I look forward to 1.3.x. |
Initial support for Status-API
Closes #357
Depends on go-gitea/go-sdk#49
TODO:
I have no clue