Skip to content
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

mark_as_read api inconsistent with file api #3982

Open
2 tasks
odgrim opened this issue Mar 7, 2025 · 0 comments
Open
2 tasks

mark_as_read api inconsistent with file api #3982

odgrim opened this issue Mar 7, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@odgrim
Copy link
Contributor

odgrim commented Mar 7, 2025

Describe the enhancement

Right now mark_as_read requires an absolute path to function correctly but file can use a relpath. The docs (until very recently) explain the desired usage pattern is something like file(mark_as_read('myfile.txt')). If we use a relpath for this then this has the opportunity to break!

The inconsistency of api for both mark_as_read vs file is a UX issue.

Example breaking code (ignore the lack of fileset here- I didn't write it!)

locals {
  _all_files        = split("\n", run_cmd("--terragrunt-quiet", "ls", "-p", "src"))
  _all_files_marked = [for f in local._all_files : mark_as_read("src/${f}")]
}

Example that correctly marks as read:

locals {
  _all_files        = split("\n", run_cmd("--terragrunt-quiet", "ls", "-p", "src"))
  _all_files_marked = [for f in local._all_files : mark_as_read(abspath("${get_terragrunt_dir()}/src/${f}"))]
}

Additional context

Flagged by a customer relying on tf files in their infrastructure live repo.

Link to a Proof of Concept if you have one:

Including a PoC can help others understand the feature better and implement it faster.

RFC Not Needed

  • I have evaluated the complexity of this enhancement, and I believe it does not require an RFC.
@odgrim odgrim added the enhancement New feature or request label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant