Skip to content

Fix bug with placeholder conflict and add tests to guard against this! - #44

Merged
trey-stafford merged 1 commit into
mainfrom
fix-python-version-str-py-script-template
Sep 24, 2026
Merged

trey-stafford merged 1 commit into
mainfrom
fix-python-version-str-py-script-template

Conversation

@trey-stafford

Copy link
Copy Markdown
Contributor

The placeholder VERSION_PLACEHOLDER was a substr of PYTHON_VERSION_PLACEHOLDER. VERSION_PLACEHOLDER got subsituted first, which resulted in the PYTHON_VERSION_PLACEHOLDER not being replaced with the expected value (instead, it got PYTHON_{VERSION_PLACEHOLDER}.

Resolves #43

@trey-stafford trey-stafford changed the title Fix bug with placeholder conflict and add tests to gaurd against this! Fix bug with placeholder conflict and add tests to guard against this! Sep 24, 2026
The placeholder `VERSION_PLACEHOLDER` was a substr of
`PYTHON_VERSION_PLACEHOLDER`. `VERSION_PLACEHOLDER` got subsituted first, which
resulted in the `PYTHON_VERSION_PLACEHOLDER` not being replaced with the
expected value (instead, it got `PYTHON_{VERSION_PLACEHOLDER}`.
@trey-stafford
trey-stafford force-pushed the fix-python-version-str-py-script-template branch from 282e9b5 to 2bca645 Compare September 24, 2026 23:24
@trey-stafford
trey-stafford marked this pull request as ready for review September 24, 2026 23:25
@trey-stafford
trey-stafford requested a lite review from Copilot September 24, 2026 23:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Fixes placeholder substitution conflicts in generated Python download scripts and adds regression coverage.

Changes:

  • Renames the dataset version placeholder.
  • Adds placeholder integrity and collision tests.
  • Verifies generated scripts include the backend Python version.
File Summary
test/​unit/​test_python_script_template.py Adds placeholder validation and collision tests.
test/​unit/​test_api.py Verifies Python version substitution.
src/​dat_backend/​templates/​python_script.py Uses the renamed dataset version placeholder.
src/​dat_backend/​routes/​python_script.py Defines and replaces the updated placeholders.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@trey-stafford
trey-stafford merged commit cbc4943 into main Sep 24, 2026
3 checks passed
@trey-stafford
trey-stafford deleted the fix-python-version-str-py-script-template branch September 24, 2026 23:34
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.

Bug: python script python version malformed

2 participants