File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ func createDefaultBranchPolicy(branch *models.Branch) *ProtectedBranch {
5151 return & ProtectedBranch {
5252 Name : branch .Name ,
5353 Since : timestamppb .Now (),
54- TargetSlsaSourceLevel : string (slsa .SlsaSourceLevel1 ),
54+ TargetSlsaSourceLevel : string (slsa .SlsaSourceLevel0 ),
5555 RequireReview : false ,
5656 }
5757}
@@ -338,13 +338,22 @@ func laterTime(time1, time2 time.Time) time.Time {
338338
339339// Computes the time since these controls have been eligible for the level, nil if not eligible.
340340func ComputeEligibleSince (controls * slsa.ControlSet , level slsa.SlsaSourceLevel ) (* time.Time , error ) {
341+ // Get the required controls for the taget SLSA level
341342 requiredControls := slsa .GetRequiredControlsForLevel (level )
342343 var newestTime time.Time
344+ // Range the controls and get the latest time. This is the time when
345+ // the repo started being elegible for the target level
343346 for _ , rc := range requiredControls {
344347 ac := controls .GetControl (rc )
345348 if ac == nil {
349+ // TODO(puerco): Here we should report which controls are missing
350+ // to inform the user somehow.
346351 return nil , nil
347352 }
353+
354+ // If a control is missing it since date, then ignore it for "ElegibleSince"
355+ // computation. Here we have a problem on how we compute since for provenance.
356+ // See https://github.com/slsa-framework/source-tool/issues/365
348357 since := ac .GetSince ()
349358 if since == nil {
350359 continue
You can’t perform that action at this time.
0 commit comments