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

Breaking API Change: reorganize Carthage directory structure #93

Merged
merged 6 commits into from
Feb 6, 2025

Conversation

hartmans
Copy link
Member

@hartmans hartmans commented Feb 6, 2025

We create three classes of directories off PathMixin including SetupTaskMixin

  • stamp_path (off config/cache_dir): where completion stamps and other items than can be regenerated are
  • state_path (off config.state_dir) where long-term state like tokens or keys are stored
  • log_path (off config.log_dir) where logs are stored

All these sub directories have the same structure based off stamp_subdir.

PathMixin also always has a config_layout, which never drops a ConfigLayout into the injector.

This is a major incompatible change to the existing output of
Carthage, and to the API for organizing that output:

* New directory cache_dir, similar to output_dir, for things like
  stamps and processed mako files that can be recreated.

* state_dir is clearly documented for things that are hard to
  reproduce.

* New log_dir

* output_dir removed from config

* New PathMixin that provides stamp_path, state_path, and log_path
  based on stamp_subdir.

* SetupTaskMixin is a PathMixin

* Refactor to set stamp_subdir everywhere.

* ContainerVolumes and ImageVolumes no longer store their stamps
  within the volume. As a result, clear out stamps when volumes are
  created.

* To do that introduce clear_stamps_and_cache to PathMixin
Now that container stamps no longer live in containers, bringing a
container to ready from ansible_chroot_helper will try to regenerate
the ssh key.  But the container is already running so this fails.

We never want ansible_chroot_helper to run setup_tasks because it does
not have enough Carthage config to do so safely.  So never bring the
container to ready.
@hartmans hartmans merged commit c28412f into master Feb 6, 2025
12 checks passed
@hartmans hartmans deleted the directory_reorg branch February 6, 2025 23:48
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