commit
44f5cc2dbf
35 changed files with 61 additions and 61 deletions
|
@ -94,13 +94,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- page to view the latest build per branch.
|
- page to view the latest build per branch.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- sync routine not executing asyncronously, being cancelled by http context.
|
- sync routine not executing asynchronously, being cancelled by http context.
|
||||||
- sync routine should ignore gitlab subrepositories
|
- sync routine should ignore gitlab subrepositories
|
||||||
- convert deploy events in 0.8 yaml to promote events.
|
- convert deploy events in 0.8 yaml to promote events.
|
||||||
- do not execute cron job for disabled repositories. [#2931](https://github.com/drone/drone/issues/2931).
|
- do not execute cron job for disabled repositories. [#2931](https://github.com/drone/drone/issues/2931).
|
||||||
- remove trailing slash from gitea url to prevent oauth2 token refresh errors, by [@cmj0121](https://github.com/cmj0121). [#2920](https://github.com/drone/drone/issues/2920).
|
- remove trailing slash from gitea url to prevent oauth2 token refresh errors, by [@cmj0121](https://github.com/cmj0121). [#2920](https://github.com/drone/drone/issues/2920).
|
||||||
- disable font ligatures in build log output. [drone/drone-ui#322](https://github.com/drone/drone-ui/pull/322).
|
- disable font ligatures in build log output. [drone/drone-ui#322](https://github.com/drone/drone-ui/pull/322).
|
||||||
- missing am/pm in timstamps
|
- missing am/pm in timestamps
|
||||||
|
|
||||||
## [1.6.5] - 2020-01-29
|
## [1.6.5] - 2020-01-29
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -77,7 +77,7 @@ type BuildStore interface {
|
||||||
LatestBranches(context.Context, int64) ([]*Build, error)
|
LatestBranches(context.Context, int64) ([]*Build, error)
|
||||||
|
|
||||||
// LatestPulls returns the latest builds from the
|
// LatestPulls returns the latest builds from the
|
||||||
// datastore by pull requeset.
|
// datastore by pull request.
|
||||||
LatestPulls(context.Context, int64) ([]*Build, error)
|
LatestPulls(context.Context, int64) ([]*Build, error)
|
||||||
|
|
||||||
// LatestDeploys returns the latest builds from the
|
// LatestDeploys returns the latest builds from the
|
||||||
|
|
|
@ -16,7 +16,7 @@ package core
|
||||||
|
|
||||||
import "context"
|
import "context"
|
||||||
|
|
||||||
// Transferer handles transfering repository ownership from one
|
// Transferer handles transferring repository ownership from one
|
||||||
// user to another user account.
|
// user to another user account.
|
||||||
type Transferer interface {
|
type Transferer interface {
|
||||||
Transfer(ctx context.Context, user *User) error
|
Transfer(ctx context.Context, user *User) error
|
||||||
|
|
|
@ -101,7 +101,7 @@ type (
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// Validate valides the user and returns an error if the
|
// Validate validates the user and returns an error if the
|
||||||
// validation fails.
|
// validation fails.
|
||||||
func (u *User) Validate() error {
|
func (u *User) Validate() error {
|
||||||
switch {
|
switch {
|
||||||
|
|
|
@ -25,7 +25,7 @@ func init() {
|
||||||
logrus.SetOutput(ioutil.Discard)
|
logrus.SetOutput(ioutil.Discard)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestResitoryList(t *testing.T) {
|
func TestRepositoryList(t *testing.T) {
|
||||||
controller := gomock.NewController(t)
|
controller := gomock.NewController(t)
|
||||||
defer controller.Finish()
|
defer controller.Finish()
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ func TestResitoryList(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestResitoryListErr(t *testing.T) {
|
func TestRepositoryListErr(t *testing.T) {
|
||||||
controller := gomock.NewController(t)
|
controller := gomock.NewController(t)
|
||||||
defer controller.Finish()
|
defer controller.Finish()
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ func HandleSync(syncer core.Syncer, repos core.RepositoryStore) http.HandlerFunc
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
viewer, _ := request.UserFrom(r.Context())
|
viewer, _ := request.UserFrom(r.Context())
|
||||||
|
|
||||||
// performs asyncrhonous account synchronization.
|
// performs asynchronous account synchronization.
|
||||||
// this requires long polling to determine when the
|
// this requires long polling to determine when the
|
||||||
// sync is complete.
|
// sync is complete.
|
||||||
if r.FormValue("async") == "true" {
|
if r.FormValue("async") == "true" {
|
||||||
|
@ -57,7 +57,7 @@ func HandleSync(syncer core.Syncer, repos core.RepositoryStore) http.HandlerFunc
|
||||||
if err != nil {
|
if err != nil {
|
||||||
render.InternalError(w, err)
|
render.InternalError(w, err)
|
||||||
logger.FromRequest(r).WithError(err).
|
logger.FromRequest(r).WithError(err).
|
||||||
Warnln("api: cannot synchrnoize account")
|
Warnln("api: cannot synchronize account")
|
||||||
} else {
|
} else {
|
||||||
render.JSON(w, list, 200)
|
render.JSON(w, list, 200)
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ func HandleCreate(users core.UserStore, service core.UserService, sender core.We
|
||||||
if err != nil {
|
if err != nil {
|
||||||
render.ErrorCode(w, err, 400)
|
render.ErrorCode(w, err, 400)
|
||||||
logger.FromRequest(r).WithError(err).
|
logger.FromRequest(r).WithError(err).
|
||||||
Errorln("api: invlid username")
|
Errorln("api: invalid username")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ func TestCreate(t *testing.T) {
|
||||||
t.Errorf("Want user login %s, got %s", want, got)
|
t.Errorf("Want user login %s, got %s", want, got)
|
||||||
}
|
}
|
||||||
if in.Hash == "" {
|
if in.Hash == "" {
|
||||||
t.Errorf("Expect user secert generated")
|
t.Errorf("Expect user secret generated")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
|
@ -35,7 +35,7 @@ func HandleFind(users core.UserStore) http.HandlerFunc {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// the client can make a user request by providing
|
// the client can make a user request by providing
|
||||||
// the user id as opposed to the username. If a
|
// the user id as opposed to the username. If a
|
||||||
// numberic user id is provided as input, attempt
|
// numeric user id is provided as input, attempt
|
||||||
// to lookup the user by id.
|
// to lookup the user by id.
|
||||||
if id, _ := strconv.ParseInt(login, 10, 64); id != 0 {
|
if id, _ := strconv.ParseInt(login, 10, 64); id != 0 {
|
||||||
user, err = users.Find(r.Context(), id)
|
user, err = users.Find(r.Context(), id)
|
||||||
|
|
|
@ -150,7 +150,7 @@ func HandleLogin(
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the user account has never been synchronized we
|
// If the user account has never been synchronized we
|
||||||
// execute the synchonrization logic.
|
// execute the synchronization logic.
|
||||||
if time.Unix(user.Synced, 0).Add(syncPeriod).Before(time.Now()) {
|
if time.Unix(user.Synced, 0).Add(syncPeriod).Before(time.Now()) {
|
||||||
user.Syncing = true
|
user.Syncing = true
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ func HandleLogin(
|
||||||
logger.Errorf("cannot update user: %s", err)
|
logger.Errorf("cannot update user: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// launch the synchrnoization process in a go-routine,
|
// launch the synchronization process in a go-routine,
|
||||||
// since it is a long-running process and can take up
|
// since it is a long-running process and can take up
|
||||||
// to a few minutes.
|
// to a few minutes.
|
||||||
if user.Syncing {
|
if user.Syncing {
|
||||||
|
|
|
@ -44,7 +44,7 @@ type (
|
||||||
System *core.System `json:"system"`
|
System *core.System `json:"system"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// BuildManager encapsulets complex build operations and provides
|
// BuildManager encapsulates complex build operations and provides
|
||||||
// a simplified interface for build runners.
|
// a simplified interface for build runners.
|
||||||
BuildManager interface {
|
BuildManager interface {
|
||||||
// Request requests the next available build stage for execution.
|
// Request requests the next available build stage for execution.
|
||||||
|
@ -60,13 +60,13 @@ type (
|
||||||
Details(ctx context.Context, stage int64) (*Context, error)
|
Details(ctx context.Context, stage int64) (*Context, error)
|
||||||
|
|
||||||
// Before signals the build step is about to start.
|
// Before signals the build step is about to start.
|
||||||
Before(ctxt context.Context, step *core.Step) error
|
Before(ctx context.Context, step *core.Step) error
|
||||||
|
|
||||||
// After signals the build step is complete.
|
// After signals the build step is complete.
|
||||||
After(ctx context.Context, step *core.Step) error
|
After(ctx context.Context, step *core.Step) error
|
||||||
|
|
||||||
// Before signals the build stage is about to start.
|
// Before signals the build stage is about to start.
|
||||||
BeforeAll(ctxt context.Context, stage *core.Stage) error
|
BeforeAll(ctx context.Context, stage *core.Stage) error
|
||||||
|
|
||||||
// After signals the build stage is complete.
|
// After signals the build stage is complete.
|
||||||
AfterAll(ctx context.Context, stage *core.Stage) error
|
AfterAll(ctx context.Context, stage *core.Stage) error
|
||||||
|
@ -84,7 +84,7 @@ type (
|
||||||
UploadBytes(ctx context.Context, step int64, b []byte) error
|
UploadBytes(ctx context.Context, step int64, b []byte) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request provildes filters when requesting a pending
|
// Request provides filters when requesting a pending
|
||||||
// build from the queue. This allows an agent, for example,
|
// build from the queue. This allows an agent, for example,
|
||||||
// to request a build that matches its architecture and kernel.
|
// to request a build that matches its architecture and kernel.
|
||||||
Request struct {
|
Request struct {
|
||||||
|
|
|
@ -58,7 +58,7 @@ func (Server) Details(ctx context.Context, stage int64) (*manager.Context, error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Before signals the build step is about to start.
|
// Before signals the build step is about to start.
|
||||||
func (Server) Before(ctxt context.Context, step *core.Step) error {
|
func (Server) Before(ctx context.Context, step *core.Step) error {
|
||||||
return errors.New("not implemented")
|
return errors.New("not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ func (Server) After(ctx context.Context, step *core.Step) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Before signals the build stage is about to start.
|
// Before signals the build stage is about to start.
|
||||||
func (Server) BeforeAll(ctxt context.Context, stage *core.Stage) error {
|
func (Server) BeforeAll(ctx context.Context, stage *core.Stage) error {
|
||||||
return errors.New("not implemented")
|
return errors.New("not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ func HandlePing() http.HandlerFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
// HandleRequest returns an http.HandlerFunc that processes an
|
// HandleRequest returns an http.HandlerFunc that processes an
|
||||||
// http.Request to reqeust a stage from the queue for execution.
|
// http.Request to request a stage from the queue for execution.
|
||||||
//
|
//
|
||||||
// POST /rpc/v2/stage
|
// POST /rpc/v2/stage
|
||||||
func HandleRequest(m manager.BuildManager) http.HandlerFunc {
|
func HandleRequest(m manager.BuildManager) http.HandlerFunc {
|
||||||
|
@ -135,7 +135,7 @@ func HandleInfo(m manager.BuildManager) http.HandlerFunc {
|
||||||
writeJSON(w, &details{
|
writeJSON(w, &details{
|
||||||
Context: res,
|
Context: res,
|
||||||
Netrc: netrc,
|
Netrc: netrc,
|
||||||
Repo: &repositroy{
|
Repo: &repository{
|
||||||
Repository: res.Repo,
|
Repository: res.Repo,
|
||||||
Secret: res.Repo.Secret,
|
Secret: res.Repo.Secret,
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,12 +16,12 @@ import (
|
||||||
type details struct {
|
type details struct {
|
||||||
*manager.Context
|
*manager.Context
|
||||||
Netrc *core.Netrc `json:"netrc"`
|
Netrc *core.Netrc `json:"netrc"`
|
||||||
Repo *repositroy `json:"repository"`
|
Repo *repository `json:"repository"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// repository wraps a repository object to include the secret
|
// repository wraps a repository object to include the secret
|
||||||
// when the repository is marshaled to json.
|
// when the repository is marshaled to json.
|
||||||
type repositroy struct {
|
type repository struct {
|
||||||
*core.Repository
|
*core.Repository
|
||||||
Secret string `json:"secret"`
|
Secret string `json:"secret"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ type Config struct {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// heper function reads and unmarshales the docker-machine
|
// helper function reads and unmarshalls the docker-machine
|
||||||
// configuration from a reader.
|
// configuration from a reader.
|
||||||
func parseReader(r io.Reader) (*Config, error) {
|
func parseReader(r io.Reader) (*Config, error) {
|
||||||
out := new(Config)
|
out := new(Config)
|
||||||
|
|
|
@ -37,7 +37,7 @@ func Load(home, match string) ([]*Config, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// If no match logic is defined, the matchine is
|
// If no match logic is defined, the machine is
|
||||||
// automatically used as a build machine.
|
// automatically used as a build machine.
|
||||||
if match == "" {
|
if match == "" {
|
||||||
machines = append(machines, conf)
|
machines = append(machines, conf)
|
||||||
|
|
|
@ -71,7 +71,7 @@ func TestGlobalErr(t *testing.T) {
|
||||||
false, time.Minute)
|
false, time.Minute)
|
||||||
_, err := service.Find(noContext, args)
|
_, err := service.Find(noContext, args)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("Expect http.Reponse error")
|
t.Errorf("Expect http.Response error")
|
||||||
} else if err.Error() != "Not Found" {
|
} else if err.Error() != "Not Found" {
|
||||||
t.Errorf("Expect Not Found error")
|
t.Errorf("Expect Not Found error")
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,13 +29,13 @@ func Parse(req *core.ConvertArgs, template *core.Template, templateData map[stri
|
||||||
}
|
}
|
||||||
|
|
||||||
var jsonnetFile string
|
var jsonnetFile string
|
||||||
var jsonentFileName string
|
var jsonnetFileName string
|
||||||
if template != nil {
|
if template != nil {
|
||||||
jsonnetFile = template.Data
|
jsonnetFile = template.Data
|
||||||
jsonentFileName = template.Name
|
jsonnetFileName = template.Name
|
||||||
} else {
|
} else {
|
||||||
jsonnetFile = req.Config.Data
|
jsonnetFile = req.Config.Data
|
||||||
jsonentFileName = req.Repo.Config
|
jsonnetFileName = req.Repo.Config
|
||||||
}
|
}
|
||||||
// map external inputs
|
// map external inputs
|
||||||
if len(templateData) != 0 {
|
if len(templateData) != 0 {
|
||||||
|
@ -48,9 +48,9 @@ func Parse(req *core.ConvertArgs, template *core.Template, templateData map[stri
|
||||||
|
|
||||||
// convert the jsonnet file to yaml
|
// convert the jsonnet file to yaml
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
docs, err := vm.EvaluateSnippetStream(jsonentFileName, jsonnetFile)
|
docs, err := vm.EvaluateSnippetStream(jsonnetFileName, jsonnetFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
doc, err2 := vm.EvaluateSnippet(jsonentFileName, jsonnetFile)
|
doc, err2 := vm.EvaluateSnippet(jsonnetFileName, jsonnetFile)
|
||||||
if err2 != nil {
|
if err2 != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Encrypted returns a new encrypted registry credentials
|
// Encrypted returns a new encrypted registry credentials
|
||||||
// provider that sournces credentials from the encrypted strings
|
// provider that sources credentials from the encrypted strings
|
||||||
// in the yaml file.
|
// in the yaml file.
|
||||||
func Encrypted() core.RegistryService {
|
func Encrypted() core.RegistryService {
|
||||||
return new(encrypted)
|
return new(encrypted)
|
||||||
|
|
|
@ -67,7 +67,7 @@ func TestEndpointSource_Err(t *testing.T) {
|
||||||
service := EndpointSource("https://company.com/auths", "GMEuUHQfmrMRsseWxi9YlIeBtn9lm6im", false)
|
service := EndpointSource("https://company.com/auths", "GMEuUHQfmrMRsseWxi9YlIeBtn9lm6im", false)
|
||||||
_, err := service.List(noContext, &core.RegistryArgs{Repo: &core.Repository{}, Build: &core.Build{}})
|
_, err := service.List(noContext, &core.RegistryArgs{Repo: &core.Repository{}, Build: &core.Build{}})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("Expect http.Reponse error")
|
t.Errorf("Expect http.Response error")
|
||||||
} else if err.Error() != "Not Found" {
|
} else if err.Error() != "Not Found" {
|
||||||
t.Errorf("Expect Not Found error")
|
t.Errorf("Expect Not Found error")
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ func (q *queue) signal(ctx context.Context) error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the system defines concurrencly limits
|
// if the system defines concurrency limits
|
||||||
// per repository we need to make sure those limits
|
// per repository we need to make sure those limits
|
||||||
// are not exceeded before proceeding.
|
// are not exceeded before proceeding.
|
||||||
if shouldThrottle(item, items, item.LimitRepo) == true {
|
if shouldThrottle(item, items, item.LimitRepo) == true {
|
||||||
|
@ -275,7 +275,7 @@ func withinLimits(stage *core.Stage, siblings []*core.Stage) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func shouldThrottle(stage *core.Stage, siblings []*core.Stage, limit int) bool {
|
func shouldThrottle(stage *core.Stage, siblings []*core.Stage, limit int) bool {
|
||||||
// if no throttle limit is defined (defualt) then
|
// if no throttle limit is defined (default) then
|
||||||
// return false to indicate no throttling is needed.
|
// return false to indicate no throttling is needed.
|
||||||
if limit == 0 {
|
if limit == 0 {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -148,7 +148,7 @@ func TestMatchResource(t *testing.T) {
|
||||||
for i, test := range tests {
|
for i, test := range tests {
|
||||||
got, want := matchResource(test.kinda, test.typea, test.kindb, test.typeb), test.want
|
got, want := matchResource(test.kinda, test.typea, test.kindb, test.typeb), test.want
|
||||||
if got != want {
|
if got != want {
|
||||||
t.Errorf("Unexpectd results at index %d", i)
|
t.Errorf("Unexpected results at index %d", i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ func TestShouldThrottle(t *testing.T) {
|
||||||
for i, test := range tests {
|
for i, test := range tests {
|
||||||
stage := stages[i]
|
stage := stages[i]
|
||||||
if got, want := shouldThrottle(stage, stages, stage.LimitRepo), test.Want; got != want {
|
if got, want := shouldThrottle(stage, stages, stage.LimitRepo), test.Want; got != want {
|
||||||
t.Errorf("Unexpectd results at index %d", i)
|
t.Errorf("Unexpected results at index %d", i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ func TestWithinLimits(t *testing.T) {
|
||||||
},
|
},
|
||||||
|
|
||||||
// stage with concurrency 1, no existing stages
|
// stage with concurrency 1, no existing stages
|
||||||
// exist for same repositroy id. expect true.
|
// exist for same repository id. expect true.
|
||||||
{
|
{
|
||||||
result: true,
|
result: true,
|
||||||
stage: &core.Stage{
|
stage: &core.Stage{
|
||||||
|
@ -316,7 +316,7 @@ func TestWithinLimits(t *testing.T) {
|
||||||
|
|
||||||
for i, test := range tests {
|
for i, test := range tests {
|
||||||
if got, want := withinLimits(test.stage, test.stages), test.result; got != want {
|
if got, want := withinLimits(test.stage, test.stages), test.result; got != want {
|
||||||
t.Errorf("Unexpectd results at index %d", i)
|
t.Errorf("Unexpected results at index %d", i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -352,7 +352,7 @@ func TestWithinLimits_Old(t *testing.T) {
|
||||||
for i, test := range tests {
|
for i, test := range tests {
|
||||||
stage := stages[i]
|
stage := stages[i]
|
||||||
if got, want := withinLimits(stage, stages), test.Want; got != want {
|
if got, want := withinLimits(stage, stages), test.Want; got != want {
|
||||||
t.Errorf("Unexpectd results at index %d", i)
|
t.Errorf("Unexpected results at index %d", i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ type service struct {
|
||||||
func (s *service) Find(ctx context.Context, user *core.User, repo, commit, ref, path string) (*core.File, error) {
|
func (s *service) Find(ctx context.Context, user *core.User, repo, commit, ref, path string) (*core.File, error) {
|
||||||
// TODO(gogs) ability to fetch a yaml by pull request ref.
|
// TODO(gogs) ability to fetch a yaml by pull request ref.
|
||||||
// it is not currently possible to fetch the yaml
|
// it is not currently possible to fetch the yaml
|
||||||
// configuation file from a pull request sha. This
|
// configuration file from a pull request sha. This
|
||||||
// workaround defaults to master.
|
// workaround defaults to master.
|
||||||
if s.client.Driver == scm.DriverGogs &&
|
if s.client.Driver == scm.DriverGogs &&
|
||||||
strings.HasPrefix(ref, "refs/pull") {
|
strings.HasPrefix(ref, "refs/pull") {
|
||||||
|
|
2
service/hook/parser/testdata/gitea_push.json
vendored
2
service/hook/parser/testdata/gitea_push.json
vendored
|
@ -38,4 +38,4 @@
|
||||||
"Email": "noreply@gogs.io",
|
"Email": "noreply@gogs.io",
|
||||||
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
service/hook/parser/testdata/gitea_tag.json
vendored
2
service/hook/parser/testdata/gitea_tag.json
vendored
|
@ -23,4 +23,4 @@
|
||||||
"Email": "noreply@gogs.io",
|
"Email": "noreply@gogs.io",
|
||||||
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,4 +40,4 @@
|
||||||
"Email": "noreply@gogs.io",
|
"Email": "noreply@gogs.io",
|
||||||
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
service/hook/parser/testdata/gogs_push.json
vendored
2
service/hook/parser/testdata/gogs_push.json
vendored
|
@ -38,4 +38,4 @@
|
||||||
"Email": "noreply@gogs.io",
|
"Email": "noreply@gogs.io",
|
||||||
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
service/hook/parser/testdata/gogs_tag.json
vendored
2
service/hook/parser/testdata/gogs_tag.json
vendored
|
@ -23,4 +23,4 @@
|
||||||
"Email": "noreply@gogs.io",
|
"Email": "noreply@gogs.io",
|
||||||
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
"Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import (
|
||||||
"github.com/drone/go-scm/scm"
|
"github.com/drone/go-scm/scm"
|
||||||
)
|
)
|
||||||
|
|
||||||
// merge is a helper function that mergest a subset of
|
// merge is a helper function that merges a subset of
|
||||||
// values from the source to the destination repository.
|
// values from the source to the destination repository.
|
||||||
func merge(dst, src *core.Repository) {
|
func merge(dst, src *core.Repository) {
|
||||||
dst.Namespace = src.Namespace
|
dst.Namespace = src.Namespace
|
||||||
|
|
|
@ -45,7 +45,7 @@ func TestGet_Token_QueryParam(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This test verifies that a user is returned when a valid
|
// This test verifies that a user is returned when a valid
|
||||||
// authorization token included in the Authorzation header.
|
// authorization token included in the Authorization header.
|
||||||
func TestGet_Token_Header(t *testing.T) {
|
func TestGet_Token_Header(t *testing.T) {
|
||||||
controller := gomock.NewController(t)
|
controller := gomock.NewController(t)
|
||||||
defer controller.Finish()
|
defer controller.Finish()
|
||||||
|
|
|
@ -298,7 +298,7 @@ SELECT
|
||||||
,repo_secret
|
,repo_secret
|
||||||
`
|
`
|
||||||
|
|
||||||
const queryColsBulds = queryCols + `
|
const queryColsBuilds = queryCols + `
|
||||||
,build_id
|
,build_id
|
||||||
,build_repo_id
|
,build_repo_id
|
||||||
,build_trigger
|
,build_trigger
|
||||||
|
@ -488,7 +488,7 @@ WHERE repo_id = :repo_id
|
||||||
// INNER JOIN perms ON perms.perm_repo_uid = repos.repo_uid
|
// INNER JOIN perms ON perms.perm_repo_uid = repos.repo_uid
|
||||||
//
|
//
|
||||||
|
|
||||||
const queryRepoWithBuild = queryColsBulds + `
|
const queryRepoWithBuild = queryColsBuilds + `
|
||||||
FROM repos LEFT OUTER JOIN builds ON build_id = (
|
FROM repos LEFT OUTER JOIN builds ON build_id = (
|
||||||
SELECT build_id FROM builds
|
SELECT build_id FROM builds
|
||||||
WHERE builds.build_repo_id = repos.repo_id
|
WHERE builds.build_repo_id = repos.repo_id
|
||||||
|
@ -500,7 +500,7 @@ WHERE perms.perm_user_id = :user_id
|
||||||
ORDER BY repo_slug ASC
|
ORDER BY repo_slug ASC
|
||||||
`
|
`
|
||||||
|
|
||||||
const queryRepoWithBuildPostgres = queryColsBulds + `
|
const queryRepoWithBuildPostgres = queryColsBuilds + `
|
||||||
FROM repos LEFT OUTER JOIN builds ON build_id = (
|
FROM repos LEFT OUTER JOIN builds ON build_id = (
|
||||||
SELECT DISTINCT ON (build_repo_id) build_id FROM builds
|
SELECT DISTINCT ON (build_repo_id) build_id FROM builds
|
||||||
WHERE builds.build_repo_id = repos.repo_id
|
WHERE builds.build_repo_id = repos.repo_id
|
||||||
|
@ -511,7 +511,7 @@ WHERE perms.perm_user_id = :user_id
|
||||||
ORDER BY repo_slug ASC
|
ORDER BY repo_slug ASC
|
||||||
`
|
`
|
||||||
|
|
||||||
const queryRepoWithBuildAll = queryColsBulds + `
|
const queryRepoWithBuildAll = queryColsBuilds + `
|
||||||
FROM repos
|
FROM repos
|
||||||
INNER JOIN perms ON perms.perm_repo_uid = repos.repo_uid
|
INNER JOIN perms ON perms.perm_repo_uid = repos.repo_uid
|
||||||
INNER JOIN builds ON builds.build_repo_id = repos.repo_id
|
INNER JOIN builds ON builds.build_repo_id = repos.repo_id
|
||||||
|
@ -520,7 +520,7 @@ ORDER BY build_id DESC
|
||||||
LIMIT 25;
|
LIMIT 25;
|
||||||
`
|
`
|
||||||
|
|
||||||
const queryRepoWithBuildIncomplete = queryColsBulds + `
|
const queryRepoWithBuildIncomplete = queryColsBuilds + `
|
||||||
FROM repos
|
FROM repos
|
||||||
INNER JOIN builds ON builds.build_repo_id = repos.repo_id
|
INNER JOIN builds ON builds.build_repo_id = repos.repo_id
|
||||||
WHERE EXISTS (
|
WHERE EXISTS (
|
||||||
|
|
|
@ -72,7 +72,7 @@ func pingDatabase(db *sql.DB) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function to setup the databsae by performing automated
|
// helper function to setup the database by performing automated
|
||||||
// database migration steps.
|
// database migration steps.
|
||||||
func setupDatabase(db *sql.DB, driver string) error {
|
func setupDatabase(db *sql.DB, driver string) error {
|
||||||
switch driver {
|
switch driver {
|
||||||
|
|
|
@ -21,8 +21,8 @@ import (
|
||||||
"io"
|
"io"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Aesgcm provides an encryper that uses the aesgcm encryption
|
// Aesgcm provides an encrypter that uses the aesgcm encryption
|
||||||
// alogirthm.
|
// algorithm.
|
||||||
type Aesgcm struct {
|
type Aesgcm struct {
|
||||||
block cipher.Block
|
block cipher.Block
|
||||||
Compat bool
|
Compat bool
|
||||||
|
@ -56,7 +56,7 @@ func (e *Aesgcm) Decrypt(ciphertext []byte) (string, error) {
|
||||||
// mode, it will return the ciphertext as plain text if
|
// mode, it will return the ciphertext as plain text if
|
||||||
// decryption fails. This should be used when running the
|
// decryption fails. This should be used when running the
|
||||||
// database in mixed-mode, where there is a mix of encrypted
|
// database in mixed-mode, where there is a mix of encrypted
|
||||||
// and unecrypted content.
|
// and unencrypted content.
|
||||||
if e.Compat {
|
if e.Compat {
|
||||||
return string(ciphertext), nil
|
return string(ciphertext), nil
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ func (e *Aesgcm) Decrypt(ciphertext []byte) (string, error) {
|
||||||
// mode, it will return the ciphertext as plain text if
|
// mode, it will return the ciphertext as plain text if
|
||||||
// decryption fails. This should be used when running the
|
// decryption fails. This should be used when running the
|
||||||
// database in mixed-mode, where there is a mix of encrypted
|
// database in mixed-mode, where there is a mix of encrypted
|
||||||
// and unecrypted content.
|
// and unencrypted content.
|
||||||
if err != nil && e.Compat {
|
if err != nil && e.Compat {
|
||||||
return string(ciphertext), nil
|
return string(ciphertext), nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ func TestAncestors(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if v := dag.Ancestors("backend"); len(v) != 0 {
|
if v := dag.Ancestors("backend"); len(v) != 0 {
|
||||||
t.Errorf("Expect vertexes with no dependences has zero ancestors")
|
t.Errorf("Expect vertexes with no dependencies has zero ancestors")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ func skipMessageEval(str string) bool {
|
||||||
// case len(paths) == 0:
|
// case len(paths) == 0:
|
||||||
// return false
|
// return false
|
||||||
// // github returns a maximum of 300 changed files from the
|
// // github returns a maximum of 300 changed files from the
|
||||||
// // api response. If there are 300+ chagned files the system
|
// // api response. If there are 300+ changed files the system
|
||||||
// // will force-run all pipelines and pipeline steps.
|
// // will force-run all pipelines and pipeline steps.
|
||||||
// case len(paths) >= 300:
|
// case len(paths) >= 300:
|
||||||
// return false
|
// return false
|
||||||
|
|
Loading…
Reference in a new issue