From 97e948d13292f1d4e4541b01c06375ce0c6c484b Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Tue, 29 Apr 2025 14:11:50 +0300 Subject: [PATCH] Artefact is considered stale if passed changed files match the spec (without additional stale check) --- artefact.inc.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/artefact.inc.php b/artefact.inc.php index f143264..a2de8b6 100644 --- a/artefact.inc.php +++ b/artefact.inc.php @@ -89,11 +89,19 @@ class TaskmanArtefact { if(!isset($this->sources_affected[$idx])) { - $sources = $this->task->getFileChanges() != null ? - //tries to match changed files with sources spec - $this->getChangedSources($idx) : - $this->getSources($idx); - $this->sources_affected[$idx] = is_stale($this->getPath(), $sources); + //NOTE: more conservative implementation which always checks for staleness + //$sources = $this->task->getFileChanges() != null ? + // //tries to match changed files with sources spec + // $this->getChangedSources($idx) : + // $this->getSources($idx); + //$this->sources_affected[$idx] = is_stale($this->getPath(), $sources); + + //NOTE: if there any file changes we simply check if there are any changed sources, + // and if yes then we mark the artefact as affected + if($this->task->getFileChanges() != null) + $this->sources_affected[$idx] = count($this->getChangedSources($idx)) > 0; + else + $this->sources_affected[$idx] = is_stale($this->getPath(), $this->getSources($idx)); } return $this->sources_affected[$idx];