Skip to content

Conversation

nfgrep
Copy link
Contributor

@nfgrep nfgrep commented Jun 3, 2025

Closes #135

To fix this, this PR:

  • Added a higher level Roast::DotRoast which currently just has a root method
  • Factored out function cache and initializer code into their own spot.

Bonus:

  • Fixed deadcode around TARGETLESS_FILE_PATH.
  • Fixed .gitignore for nested .roast in fixtures.
  • Added Cache.for_workflow to namespace caches by workflow (to avoid any collisions that sharing a .roast might've caused).

@nfgrep nfgrep force-pushed the use-config-root-for-cache branch from df61907 to a47fb85 Compare June 3, 2025 21:16
@nfgrep nfgrep changed the title Refactor and use a single source .roast config dir Common search for .roast Jun 9, 2025
@nfgrep nfgrep force-pushed the use-config-root-for-cache branch 5 times, most recently from 77edb32 to ae911e1 Compare June 9, 2025 18:30
nfgrep added 7 commits June 9, 2025 16:11
- Added a higher level `Roast::Config` which currently just has a `root` method
- Factored initializers and cache out into their own bits of Roast::Config
More obvious this way.
@nfgrep nfgrep force-pushed the use-config-root-for-cache branch from ae911e1 to db087bc Compare June 9, 2025 20:45
@obie
Copy link
Collaborator

obie commented Jun 10, 2025

@nfgrep progress?

@nfgrep
Copy link
Contributor Author

nfgrep commented Jun 10, 2025 via email

module DotRoast
class << self
def root(starting_path = Dir.pwd, ending_path = File.dirname(Dir.home))
unless starting_path.start_with?(ending_path)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lack of this was a bug in the prev code, pwd wasn't under HOME, you'd end up hanging/looping forever.


if cache_enabled
# Call the original function and pass in the cache
cache = Roast::Helpers::FunctionCache.for_workflow(workflow_configuration.name, workflow_configuration.workflow_path)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used configuration in the prev code instead of workflow_configuration which was silently failing to do any function caching, this fixes that.

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.

Inconsistent .roast usage

2 participants