Skip to content

fix(build): Use mkdir -p to handle missing parent directories in generate-config-schemas task.#1671

Merged
junhaoliao merged 1 commit into
y-scope:mainfrom
junhaoliao:schema-parent-dir
Nov 26, 2025
Merged

fix(build): Use mkdir -p to handle missing parent directories in generate-config-schemas task.#1671
junhaoliao merged 1 commit into
y-scope:mainfrom
junhaoliao:schema-parent-dir

Conversation

@junhaoliao

@junhaoliao junhaoliao commented Nov 26, 2025

Copy link
Copy Markdown
Member

Description

As the title says.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

rm -rf build
rm -rf .task
task generate-config-schemas
# observed the task completed successfully without any error printed

Summary by CodeRabbit

  • Chores
    • Enhanced build process reliability by improving directory creation handling in the config schema generation workflow, preventing potential failures when output directories already exist.

✏️ Tip: You can customize this high-level summary in your review settings.

@junhaoliao junhaoliao requested a review from a team as a code owner November 26, 2025 03:45
@coderabbitai

coderabbitai Bot commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Modified the generate-config-schemas task in taskfile.yaml to use the -p flag with mkdir, enabling idempotent directory creation that avoids errors if the output directory already exists and creates parent directories as needed.

Changes

Cohort / File(s) Summary
Build Configuration
taskfile.yaml
Updated mkdir "{{.OUTPUT_DIR}}" to mkdir -p "{{.OUTPUT_DIR}}" in the generate-config-schemas task for idempotent directory creation

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding the -p flag to mkdir to create parent directories in the generate-config-schemas task, which matches the modification shown in the raw summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 65ac5d7 and 79e4ce1.

📒 Files selected for processing (1)
  • taskfile.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1152
File: components/clp-package-utils/clp_package_utils/general.py:0-0
Timestamp: 2025-08-19T14:41:28.901Z
Learning: In the CLP codebase, prefer explicit failures over automatic directory creation in utility functions like dump_config. The user junhaoliao prefers to let file operations fail when parent directories don't exist, as this helps catch implementation errors during development rather than masking setup issues with automatic directory creation.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1335
File: taskfiles/docker-images.yaml:15-15
Timestamp: 2025-09-25T19:26:32.436Z
Learning: In the CLP project's Taskfile, the `:package` task creates the G_PACKAGE_BUILD_DIR directory structure, so any task that depends on `:package` (like `docker-images:package`) can safely assume this directory exists without needing additional mkdir commands.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Learnt from: quinntaylormitchell
Repo: y-scope/clp PR: 1170
File: tools/deployment/presto-clp/scripts/generate-metadata-filter-file.py:0-0
Timestamp: 2025-09-04T12:26:54.788Z
Learning: The `set-up-config.sh` script in tools/deployment/presto-clp/scripts/ ensures that the output directory for metadata-filter.json already exists before calling generate-metadata-filter-file.py, so directory creation in the Python script is not strictly necessary.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: build-macos (macos-15, false)
  • GitHub Check: rust-checks
🔇 Additional comments (1)
taskfile.yaml (1)

237-237: Improve idempotency and consistency across build tasks.

The addition of the -p flag to mkdir is a solid improvement that aligns with the standard pattern used throughout the Taskfile (e.g., webui task at line 281, python-libs at line 536). This ensures the task succeeds even when parent directories are missing—particularly useful if the build directory is cleaned or removed between task runs.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@junhaoliao junhaoliao merged commit 55f2c9c into y-scope:main Nov 26, 2025
28 checks passed
@junhaoliao junhaoliao deleted the schema-parent-dir branch May 7, 2026 19:46
junhaoliao added a commit to junhaoliao/clp that referenced this pull request May 17, 2026
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.

2 participants