@@ -150,6 +150,8 @@ func (c *mrpService) makeChangeRevisionPatch(ctx context.Context, logCtx *log.En
150150 "previousRevision" : r .previousRevision ,
151151 }).Debugf ("processing source" )
152152 patchGitRevisions [idx ] = r .currentRevision
153+
154+ // new change revision to be set in the annotation
153155 // keep current change revision if there is no new value calculated
154156 patchChangeRevisions [idx ] = r .changeRevision
155157
@@ -172,9 +174,14 @@ func (c *mrpService) makeChangeRevisionPatch(ctx context.Context, logCtx *log.En
172174 sourceLogCtx .Errorf ("Failed to calculate revision: %v" , err )
173175 continue
174176 }
175- sourceLogCtx .Infof ("New change revision for source is '%s'" , * newChangeRevision )
177+ sourceLogCtx .Infof ("calculated change revision is '%s'" , * newChangeRevision )
176178 if newChangeRevision == nil || * newChangeRevision == "" {
177- sourceLogCtx .Infof ("no new changes found, keeping existing change revision" )
179+ if r .changeRevision == "" {
180+ sourceLogCtx .Infof ("no change revision found, defaulting to current revision" )
181+ patchChangeRevisions [idx ] = r .currentRevision
182+ } else {
183+ sourceLogCtx .Infof ("no new change revision found, keeping existing change revision" )
184+ }
178185 } else if patchChangeRevisions [idx ] == * newChangeRevision {
179186 sourceLogCtx .Infof ("ChangeRevision has not changed" )
180187 } else {
0 commit comments