Skip to content

feat(2304): update checksum and timestamp file paths to include task … #2305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

deicon
Copy link

@deicon deicon commented Jun 21, 2025

Description

This PR addresses #2304 where checksum and timestamp files were not being created in the correct directory when tasks were executed in a subdirectory. The changes ensure that these files are stored within a directory structure that mirrors the task's execution directory, relative to the temporary directory. Additionally a test has been added to verify the correct behaviour.

Motivation

Previously, the checksum and timestamp files were always created in a flat checksum or timestamp directory within the temporary directory, regardless of the task's execution directory. This could lead to conflicts and incorrect up-to-date checks when multiple tasks with the same name were executed in different subdirectories.

The motivation behind this change is to ensure that the fingerprinting mechanism correctly tracks task dependencies and execution state, even when tasks are executed in different directories. This is crucial for maintaining the reliability and correctness of the task execution process.

What was changed

  • internal/fingerprint/sources_checksum.go: The IsUpToDate function was modified to create the checksum directory within a subdirectory that mirrors the task's execution directory (t.Dir). The checksumFilePath function was also updated accordingly.
  • internal/fingerprint/sources_timestamp.go: The timestampFilePath function was updated to create the timestamp directory within a subdirectory that mirrors the task's execution directory (t.Dir).
  • internal/fingerprint/sources_timestamp_test.go: A new test file sources_timestamp_test.go was added to verify the correct creation of timestamp files in the appropriate subdirectories.
  • internal/fingerprint/timestamp_checker_test.go: A new test file timestamp_checker_test.go was added to improve testing the functionality of timestamp checker.
  • task_test.go: The checksum path generation in the TestStatusChecksum was adapted to the changed directory structure.

Tests

  • New unit tests were added in internal/fingerprint/sources_timestamp_test.go to specifically verify the correct creation of timestamp files in the appropriate subdirectories.
  • New unit tests were added in internal/fingerprint/timestamp_checker_test.go to improve testing the functionality of timestamp checker.
  • Changed path to checksum files in existing test in task_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant