Skip to content

fix: improve ANSI regex, add short-string guard, add debug logging in rm_r#864

Closed
Kaibalya-Mohanty wants to merge 9 commits into
kubeflow:mainfrom
Kaibalya-Mohanty:fix/utils-behaviour-changes
Closed

fix: improve ANSI regex, add short-string guard, add debug logging in rm_r#864
Kaibalya-Mohanty wants to merge 9 commits into
kubeflow:mainfrom
Kaibalya-Mohanty:fix/utils-behaviour-changes

Conversation

@Kaibalya-Mohanty

Copy link
Copy Markdown

This PR separates the behavioral changes from PR #704 (docs-only).

Changes:

  • remove_ansi_color_sequences: Broadened regex to catch more ANSI
    escape sequences, added isinstance check to handle non-string input safely.
  • shorten_long_string: Added early-return guard for strings already
    shorter than chars * 2 to avoid unnecessary slicing.
  • rm_r: Added log.debug() call to trace path removal attempts for
    easier debugging.

Signed-off-by: KAIBALYA MOHANTY <168870673+Kaibalya-Mohanty@users.noreply.github.com>
Signed-off-by: KAIBALYA MOHANTY <168870673+Kaibalya-Mohanty@users.noreply.github.com>
Signed-off-by: KAIBALYA MOHANTY <168870673+Kaibalya-Mohanty@users.noreply.github.com>
Signed-off-by: KAIBALYA MOHANTY <168870673+Kaibalya-Mohanty@users.noreply.github.com>
Signed-off-by: KAIBALYA MOHANTY <168870673+Kaibalya-Mohanty@users.noreply.github.com>
Reverted unintended function renaming and implementation changes.
Kept only the docstring improvements for remove_ansi_color_sequences.

Signed-off-by: KAIBALYA MOHANTY <168870673+Kaibalya-Mohanty@users.noreply.github.com>
Signed-off-by: KAIBALYA MOHANTY <168870673+Kaibalya-Mohanty@users.noreply.github.com>
Signed-off-by: KAIBALYA MOHANTY <168870673+Kaibalya-Mohanty@users.noreply.github.com>
Reverted broader ANSI regex, removed isinstance check, removed early-return guard in shorten_long_string, and removed added log.debug call in rm_r.

Signed-off-by: KAIBALYA MOHANTY <168870673+Kaibalya-Mohanty@users.noreply.github.com>
@google-oss-prow google-oss-prow Bot requested a review from ederign June 30, 2026 20:32
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign stefanofioravanzo for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow Bot requested a review from jesuino June 30, 2026 20:32
@Kaibalya-Mohanty Kaibalya-Mohanty changed the title fix: improve ANSI regex, add short-string guard, add debug logging in rm_rFix/utils behaviour changes fix: improve ANSI regex, add short-string guard, add debug logging in rm_r Jun 30, 2026
@ada333

ada333 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

hi @Kaibalya-Mohanty this PR is the same as https://github.com/kubeflow/kale/pull/704/changes , please close this one.

@ederign

ederign commented Jul 1, 2026

Copy link
Copy Markdown
Member

This PR don't bring too much value for Kale so I'm closing it. feel free to check something in our roadmap.

@ederign ederign closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants