Skip to content

Fix mask_secrets in shell_command to Use Mutable String

George Koltsov requested to merge fix-mask-secrets-to-use-mutable-string into master

What does this MR do and why?

We try to perform a gsub operation on a frozen string in mask_secrets in shell_command.rb, causing this error: https://gitlab.com/gitlab-org/gitlab/-/issues/374553

This changes input to return a duplicated, mutable string if it is frozen, or the string itself, if not frozen.

This operator was also used in the previous mask_secrets method before https://gitlab.com/gitlab-org/gitlab-qa/-/merge_requests/1031 was implemented: https://gitlab.com/gitlab-org/gitlab-qa/-/blob/43a3c403457f4d93de4a1ce50cb316d09db00b7a/lib/gitlab/qa/docker/command.rb#L52

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by George Koltsov

Merge request reports