Skip to content

Commit

Permalink
separate prow url and batch merge in submit-queue
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTheElder committed Jul 21, 2017
1 parent 2c70516 commit cc9a56c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
3 changes: 2 additions & 1 deletion charts/mungegithub/chart/values.kubernetes.kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ config:
admin-port: 9999
chart-url: https://storage.googleapis.com/kubernetes-test-history/k8s-queue-health.svg
history-url: https://storage.googleapis.com/kubernetes-test-history/static/index.html
batch-url: https://prow.k8s.io/data.js
prow-data-url: https://prow.k8s.io/data.js
batch-enabled: true
context-url: https://submit-queue.k8s.io

# options used by the GCS feature.
Expand Down
4 changes: 2 additions & 2 deletions mungegithub/mungers/submit-queue-batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ func (sq *SubmitQueue) batchIsApplicable(batch Batch) (int, error) {
func (sq *SubmitQueue) handleGithubE2EBatchMerge() {
repo := sq.githubConfig.Org + "/" + sq.githubConfig.Project
for range time.Tick(1 * time.Minute) {
allJobs, err := getJobs(sq.BatchURL)
allJobs, err := getJobs(sq.ProwDataURL)
if err != nil {
glog.Errorf("Error reading batch jobs from Prow URL %v: %v", sq.BatchURL, err)
glog.Errorf("Error reading batch jobs from Prow URL %v: %v", sq.ProwDataURL, err)
continue
}
batchJobs := allJobs.batch().repo(repo)
Expand Down
17 changes: 9 additions & 8 deletions mungegithub/mungers/submit-queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,11 @@ type SubmitQueue struct {

features *features.Features

mergeLock sync.Mutex // acquired when attempting to merge a specific PR
BatchURL string
ContextURL string
batchStatus submitQueueBatchStatus
mergeLock sync.Mutex // acquired when attempting to merge a specific PR
ProwDataURL string
BatchEnabled bool
ContextURL string
batchStatus submitQueueBatchStatus
}

func init() {
Expand Down Expand Up @@ -467,7 +468,7 @@ func (sq *SubmitQueue) internalInitialize(config *github.Config, features *featu
http.Handle("/sq-stats", gziphandler.GzipHandler(http.HandlerFunc(sq.serveSQStats)))
http.Handle("/flakes", gziphandler.GzipHandler(http.HandlerFunc(sq.serveFlakes)))
http.Handle("/metadata", gziphandler.GzipHandler(http.HandlerFunc(sq.serveMetadata)))
if sq.BatchURL != "" {
if sq.BatchEnabled {
http.Handle("/batch", gziphandler.GzipHandler(http.HandlerFunc(sq.serveBatch)))
}
config.ServeDebugStats("/stats")
Expand All @@ -486,9 +487,8 @@ func (sq *SubmitQueue) internalInitialize(config *github.Config, features *featu

go sq.handleGithubE2EAndMerge()
go sq.updateGoogleE2ELoop()
if sq.BatchURL != "" {
if sq.BatchEnabled {
go sq.handleGithubE2EBatchMerge()

}

if sq.AdminPort != 0 {
Expand Down Expand Up @@ -551,7 +551,8 @@ func (sq *SubmitQueue) RegisterOptions(opts *options.Options) {
// If you create a StringSliceVar you may wish to check out 'cleanStringSlice()'
opts.RegisterString(&sq.Metadata.HistoryUrl, "history-url", "", "URL to access the submit-queue instance's health history.")
opts.RegisterString(&sq.Metadata.ChartUrl, "chart-url", "", "URL to access the submit-queue instance's health charts.")
opts.RegisterString(&sq.BatchURL, "batch-url", "", "Prow data.json URL to read batch results")
opts.RegisterString(&sq.ProwDataURL, "prow-data-url", "", "Prow data.json URL to read batch results")
opts.RegisterBool(&sq.BatchEnabled, "batch-enabled", false, "Batch merge")
opts.RegisterString(&sq.ContextURL, "context-url", "", "URL where the submit queue is serving - used in Github status contexts")
opts.RegisterBool(&sq.GateApproved, "gate-approved", false, "Gate on approved label")
opts.RegisterBool(&sq.GateCLA, "gate-cla", false, "Gate on cla labels")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ do-not-merge-milestones: ""
admin-port: 9999
chart-url: https://storage.googleapis.com/kubernetes-test-history/k8s-queue-health.svg
history-url: https://storage.googleapis.com/kubernetes-test-history/static/index.html
batch-url: https://prow.k8s.io/data.js
prow-data-url: https://prow.k8s.io/data.js
batch-enabled: true
context-url: https://submit-queue.k8s.io

# options used by the GCS feature.
Expand Down

0 comments on commit cc9a56c

Please sign in to comment.