Skip to content

feat(taskfiles)!: Unflatten utils taskfile namespace; include any necessary taskfiles in each taskfile.#27

Merged
davidlion merged 2 commits into
y-scope:mainfrom
davidlion:task-namespace-fix
Feb 20, 2025
Merged

feat(taskfiles)!: Unflatten utils taskfile namespace; include any necessary taskfiles in each taskfile.#27
davidlion merged 2 commits into
y-scope:mainfrom
davidlion:task-namespace-fix

Conversation

@davidlion

@davidlion davidlion commented Feb 19, 2025

Copy link
Copy Markdown
Member

Description

Previously, including utils-*.yaml taskfiles that depended on other utils taskfiles would fail as there were no include statements. This relied on a project always using the flattened structure in utils.yaml and all task names inside utils-*.yaml to be completely flat.

This PR changes:

  • the directory+file structure to match a C++ style namespace structure
    • e.g. taskfiles/utils-cmake.yaml -> taskfiles/utils/cmake.yaml
  • have taskfiles include any necessary dependencies (enabling them to work standalone)
  • utils.yaml to include each taskfile category under a namespace
    • e.g. cmake: cmake.yaml
  • renames tasks based on their namespace
    • e.g. cmake-build -> cmake:build

These changes make using the tasks less error prone to incorrect naming.

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

Tested on modified local clp-ffi-go branch using new task names.

Summary by CodeRabbit

  • New Features

    • Introduced a versioned configuration system that consolidates utility tasks and dependencies.
  • Refactor

    • Renamed several task names and updated references to enhance clarity and consistency.
  • Chores

    • Removed an obsolete configuration to simplify the underlying structure for task execution.

@coderabbitai

coderabbitai Bot commented Feb 19, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request removes the old taskfiles/utils.yaml configuration and introduces a new configuration file in taskfiles/utils/utils.yaml. It also updates several utility task files by renaming tasks and revising their references. In particular, the checksum, cmake, and remote task files now use streamlined task names and namespace-based references. Additionally, an includes section has been added in some files to reference remote configurations, reflecting a reorganisation of utility task definitions.

Changes

File(s) Change Summary
taskfiles/utils.yaml (removed) and taskfiles/utils/utils.yaml (new) Removed the old utility configuration that aggregated various task files and introduced a new centralized configuration file (version "3") that includes references to checksum.yaml, cmake.yaml, cpp-lint.yaml, misc.yaml, and remote.yaml.
taskfiles/utils/{checksum, cmake, remote}.yaml Renamed tasks for clarity (e.g., compute-checksumcompute, cmake-buildbuild) and updated task references and dependencies. Additionally, an includes section was added in the cmake file for a remote configuration and task dependencies in the remote file now use namespaced task identifiers.

Possibly related PRs

Suggested reviewers

  • kirkrodrigues

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 368bdf6 and 736da62.

📒 Files selected for processing (5)
  • taskfiles/utils.yaml (0 hunks)
  • taskfiles/utils/checksum.yaml (3 hunks)
  • taskfiles/utils/cmake.yaml (6 hunks)
  • taskfiles/utils/remote.yaml (3 hunks)
  • taskfiles/utils/utils.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • taskfiles/utils.yaml
✅ Files skipped from review due to trivial changes (1)
  • taskfiles/utils/utils.yaml
🔇 Additional comments (10)
taskfiles/utils/checksum.yaml (2)

11-47: Task Renaming: Update of the Compute Task

The renaming from "compute-checksum" to simply "compute" has been executed cleanly. The task description, internal flag, label formatting, and required variables are all consistent with the new naming convention.


53-82: Task Renaming: Update of the Validate Task

The "validate" task now correctly calls the updated "compute" task to generate a temporary checksum before comparing against the expected checksum. The use of a temporary file (TMP_CHECKSUM_FILE) and the subsequent cleanup via defer is a good practice. Ensure thorough testing, particularly when multiple patterns are provided.

taskfiles/utils/remote.yaml (3)

3-5: Includes Section: Incorporation of Checksum Dependencies

The new "includes" section correctly imports "checksum.yaml" as a dependency. This positions the taskfile for better modularity and easier management of checksum-related tasks.


96-100: Namespaced Task Reference: Checksum Validate

The update of the task reference to "checksum:validate" ensures that the validate operation is now namespaced, which aligns with the new modular approach. The variable mapping (e.g., CHECKSUM_FILE and OUTPUT_DIR) appears correctly configured.


122-126: Namespaced Task Reference: Checksum Compute

Similarly, the update to "checksum:compute" is consistent with the namespacing strategy and the overall refactor. The variables passed along maintain the intended functionality.

taskfiles/utils/cmake.yaml (5)

3-5: Includes Section: Integration of Remote Taskfile

The addition of the "includes" section to import "remote.yaml" aids in establishing a clear namespace and dependency structure. This improves modularity and maintainability of the task definitions.


19-42: Task Renaming: CMake Build Task

The "build" task (formerly "cmake-build") has been streamlined nicely. The label formatting and variable references (EXTRA_ARGS, JOBS, TARGETS) are logical and consistent.


48-62: Task Renaming: CMake Clean Task

The "clean" task’s implementation now calls the "build" task with the "clean" target. This reuse of the build infrastructure is efficient, though it may be worthwhile to ensure that the behaviour of invoking "clean" via "build" remains intuitive for users.


70-110: Task Renaming: CMake Generate and Install Tasks

The "generate" and "install" tasks have been updated to reflect the removal of the "cmake-" prefix. Their configurations, including variable defaults and command sequences, are well maintained.


141-199: Composite Task: install-remote-tar

The "install-remote-tar" task effectively orchestrates the process by chaining the dependency on "remote:download-and-extract-tar" with subsequent "generate", "build", and "install" tasks. The variable propagation (e.g., WORK_DIR, SOURCE_DIR, BUILD_DIR, INSTALL_PREFIX) is coherent with the new namespacing, ensuring a seamless integration of the download and build steps.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the PR title, how about:

feat(taskfiles)!: Unflatten utils taskfile namespace; include any necessary taskfiles in each taskfile.

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