Skip to content

Fix NUM_COMPONENTS_TO_STRIP default behavior when 0 is specified #96

@coderabbitai

Description

@coderabbitai

Issue Description

In taskfiles/utils-remote.yaml, the download-and-extract-tar task has a parameter NUM_COMPONENTS_TO_STRIP with a default value of 1. However, due to sprig's default function treating numeric 0 as an empty value, explicitly setting NUM_COMPONENTS_TO_STRIP=0 results in 1 being used instead.

Reference: https://masterminds.github.io/sprig/defaults.html#default

Workaround

Users can specify NUM_COMPONENTS_TO_STRIP="0" (as a string) in the caller to work around this issue.

Potential Solutions

  1. Change the default value to 0
  2. Check if the user explicitly specifies the var; only if the var is not specified, default to 1
  3. Document the behavior and mitigation/expected usage explicitly

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions