Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: scheduler/appengine/catalog/catalog.go

Issue 2993813002: Revert "[scheduler]: ACLs phase 2 - warn if Job/Trigger don't have ACLs." (Closed)
Patch Set: Updated patchset dependency Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | scheduler/appengine/catalog/catalog_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. 1 // Copyright 2015 The LUCI Authors.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 276 }
277 flavor := JobFlavorTriggered 277 flavor := JobFlavorTriggered
278 if schedule != "triggered" { 278 if schedule != "triggered" {
279 flavor = JobFlavorPeriodic 279 flavor = JobFlavorPeriodic
280 } 280 }
281 acls, err := acl.ValidateTaskAcls(knownAclSets, job.GetAclSets() , job.GetAcls()) 281 acls, err := acl.ValidateTaskAcls(knownAclSets, job.GetAclSets() , job.GetAcls())
282 if err != nil { 282 if err != nil {
283 logging.Errorf(c, "Failed to compute task ACLs: %s/%s: % s", projectID, id, err) 283 logging.Errorf(c, "Failed to compute task ACLs: %s/%s: % s", projectID, id, err)
284 continue 284 continue
285 } 285 }
286 // TODO(tandrii): remove this once this warning stops firing.
287 if len(acls.Owners) == 0 || len(acls.Readers) == 0 {
288 logging.Warningf(c, "Missing some ACLs on %s/%s: R=%d O= %d", projectID, id, len(acls.Owners), len(acls.Readers))
289 }
290 out = append(out, Definition{ 286 out = append(out, Definition{
291 JobID: fmt.Sprintf("%s/%s", projectID, job.Id), 287 JobID: fmt.Sprintf("%s/%s", projectID, job.Id),
292 Acls: *acls, 288 Acls: *acls,
293 Flavor: flavor, 289 Flavor: flavor,
294 Revision: meta.Revision, 290 Revision: meta.Revision,
295 RevisionURL: revisionURL, 291 RevisionURL: revisionURL,
296 Schedule: schedule, 292 Schedule: schedule,
297 Task: packed, 293 Task: packed,
298 }) 294 })
299 } 295 }
(...skipping 19 matching lines...) Expand all
319 } 315 }
320 schedule := trigger.Schedule 316 schedule := trigger.Schedule
321 if schedule == "" { 317 if schedule == "" {
322 schedule = defaultTriggerSchedule 318 schedule = defaultTriggerSchedule
323 } 319 }
324 acls, err := acl.ValidateTaskAcls(knownAclSets, trigger.GetAclSe ts(), trigger.GetAcls()) 320 acls, err := acl.ValidateTaskAcls(knownAclSets, trigger.GetAclSe ts(), trigger.GetAcls())
325 if err != nil { 321 if err != nil {
326 logging.Errorf(c, "Failed to compute task ACLs: %s/%s: % s", projectID, id, err) 322 logging.Errorf(c, "Failed to compute task ACLs: %s/%s: % s", projectID, id, err)
327 continue 323 continue
328 } 324 }
329 // TODO(tandrii): remove this once this warning stops firing.
330 if len(acls.Owners) == 0 || len(acls.Readers) == 0 {
331 logging.Warningf(c, "Missing some ACLs on %s/%s: R=%d O= %d", projectID, id, len(acls.Owners), len(acls.Readers))
332 }
333 out = append(out, Definition{ 325 out = append(out, Definition{
334 JobID: fmt.Sprintf("%s/%s", projectID, trigger.Id) , 326 JobID: fmt.Sprintf("%s/%s", projectID, trigger.Id) ,
335 Acls: *acls, 327 Acls: *acls,
336 Flavor: JobFlavorTrigger, 328 Flavor: JobFlavorTrigger,
337 Revision: meta.Revision, 329 Revision: meta.Revision,
338 RevisionURL: revisionURL, 330 RevisionURL: revisionURL,
339 Schedule: schedule, 331 Schedule: schedule,
340 Task: packed, 332 Task: packed,
341 }) 333 })
342 } 334 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 field := v.Field(i) 465 field := v.Field(i)
474 if field.Type() == taskType { 466 if field.Type() == taskType {
475 field.Set(reflect.ValueOf(task)) 467 field.Set(reflect.ValueOf(task))
476 return proto.Marshal(&wrapper) 468 return proto.Marshal(&wrapper)
477 } 469 }
478 } 470 }
479 // This can happen only if TaskDefWrapper wasn't updated when a new task type 471 // This can happen only if TaskDefWrapper wasn't updated when a new task type
480 // was added. This is a developer's mistake, not a config mistake. 472 // was added. This is a developer's mistake, not a config mistake.
481 return nil, fmt.Errorf("could not find a field of type %T in TaskDefWrap per", task) 473 return nil, fmt.Errorf("could not find a field of type %T in TaskDefWrap per", task)
482 } 474 }
OLDNEW
« no previous file with comments | « no previous file | scheduler/appengine/catalog/catalog_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698