fix(test): Normalize *_dir variables to always end with trailing slash#365
Merged
Stell0 merged 2 commits intoagentic_developmentfrom Mar 26, 2026
Merged
fix(test): Normalize *_dir variables to always end with trailing slash#365Stell0 merged 2 commits intoagentic_developmentfrom
Stell0 merged 2 commits intoagentic_developmentfrom
Conversation
Each *_dir variable is now normalized immediately after assignment
using the `${var%/}/` pattern. This ensures that overriding
TANCREDI_RW_DIR, TANCREDI_RO_DIR, TANCREDI_SCRIPTS_DIR, or
TANCREDI_TEMPLATE_CUSTOM_DIR without a trailing slash still yields
correct subdirectory paths.
Also remove the overly-restrictive prefix check in
tancredi_reset_rw_dir that limited deletion to /var/lib/tancredi/*,
which blocked local test mode where TANCREDI_RW_DIR points to a
test-runtime directory. The empty/root guard remains.
Co-authored-by: Stell0 <4547897+Stell0@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nethesis/tancredi/sessions/7890c6d0-cae1-44a9-8ac9-b4b59bb546d6
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] [WIP] Address feedback on documentation and development lifecycle maintenance PR
fix(test): Normalize *_dir variables to always end with trailing slash
Mar 26, 2026
Stell0
approved these changes
Mar 26, 2026
Stell0
added a commit
that referenced
this pull request
Mar 26, 2026
* feature(agents): Add repository files for agentic development * test(harness): Improve local test workflow Add a repo-local Bats harness that generates its own Tancredi configuration, writable runtime tree, and PHP server entrypoint. This lets developers run the end-to-end suite without relying on an existing Apache deployment or root-owned CI paths. Keep the Apache-based CI layout available through ./test/run.sh system, update the workflow to call it explicitly, and parameterize the Bats helpers and fixtures so both modes share the same suite. Document the new local and system test paths in test/README.md and AGENTS.md, and make /check/ping respect the tancredi_conf override used by the local harness. * docs(docs): Refresh provisioning documentation Update the docs to match the current Tancredi runtime and API behavior. Document the provisioning flow in more detail, including the tok1/tok2 security model, tokenless bootstrap handling, protected asset delivery, and runtime variables. Refresh the installation, API, auth, templates, and index pages to reflect the current PHP 8.1+/Slim 4 stack and public paths. Exclude local Bundler directories from the Jekyll source tree so documentation builds do not break when gems are installed locally. * Update test/run.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update test/bats/50_template_rendering.bats Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update test/run.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update test/bats/tancredi_client.bash Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(test): Normalize *_dir variables to always end with trailing slash (#365) * Initial plan * fix(test): normalize *_dir vars to always end with trailing slash Each *_dir variable is now normalized immediately after assignment using the `${var%/}/` pattern. This ensures that overriding TANCREDI_RW_DIR, TANCREDI_RO_DIR, TANCREDI_SCRIPTS_DIR, or TANCREDI_TEMPLATE_CUSTOM_DIR without a trailing slash still yields correct subdirectory paths. Also remove the overly-restrictive prefix check in tancredi_reset_rw_dir that limited deletion to /var/lib/tancredi/*, which blocked local test mode where TANCREDI_RW_DIR points to a test-runtime directory. The empty/root guard remains.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Path helpers in
tancredi_client.bashconcatenate subdir names directly onto*_dirvariables (e.g."${tancredi_rw_dir}backgrounds"), silently producing broken paths if anyTANCREDI_*_DIRoverride is supplied without a trailing slash.Changes
Trailing-slash normalization: Each
*_dirvariable is normalized immediately after assignment using${var%/}/, making path construction safe regardless of how the override is provided:Remove overly-restrictive prefix guard in
tancredi_reset_rw_dir: A prior commit added a check that only permitted deletion under/var/lib/tancredi/*, which silently blocked local test mode (whereTANCREDI_RW_DIRresolves tovar/test-runtime/data/). The empty-string and root-/safety guard is retained; the hardcoded prefix check is removed.⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.