Skip to content

removes arbitrary whitespace before unicode char/emojis #2680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/common/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func gitOptions(token string) (fetchOptions git.FetchOptions, pullOptions git.Pu
func NewGitCloneExecutor(input NewGitCloneExecutorInput) common.Executor {
return func(ctx context.Context) error {
logger := common.Logger(ctx)
logger.Infof(" \u2601 git clone '%s' # ref=%s", input.URL, input.Ref)
logger.Infof("\U00002601 git clone '%s' # ref=%s", input.URL, input.Ref)
logger.Debugf(" cloning %s to %s", input.URL, input.Dir)

cloneLock.Lock()
Expand Down
2 changes: 1 addition & 1 deletion pkg/container/docker_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type dockerMessage struct {
Progress string `json:"progress"`
}

const logPrefix = " \U0001F433 "
const logPrefix = "\U0001F433 "

func logDockerResponse(logger logrus.FieldLogger, dockerResponse io.ReadCloser, isError bool) error {
if dockerResponse == nil {
Expand Down
28 changes: 14 additions & 14 deletions pkg/runner/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

if resumeCommand != "" && command != resumeCommand {
logger.Infof(" \U00002699 %s", line)
logger.Infof("\U00002699 %s", line)
return false
}
arg = unescapeCommandData(arg)
Expand All @@ -54,27 +54,27 @@
case "add-path":
rc.addPath(ctx, arg)
case "debug":
logger.Debugf(" \U0001F4AC %s", line)
logger.Debugf("\U0001f4ac %s", line)
case "warning":
logger.Warnf(" \U0001F6A7 %s", line)
logger.Warnf("\U0001f6a7 %s", line)
case "error":
logger.Errorf(" \U00002757 %s", line)
logger.Errorf("\U00002757 %s", line)
case "add-mask":
rc.AddMask(arg)
logger.Infof(" \U00002699 %s", "***")
logger.Infof("\U00002699 %s", "***")
case "stop-commands":
resumeCommand = arg
logger.Infof(" \U00002699 %s", line)
logger.Infof("\U00002699 %s", line)
case resumeCommand:
resumeCommand = ""
logger.Infof(" \U00002699 %s", line)
logger.Infof("\U00002699 %s", line)
case "save-state":
logger.Infof(" \U0001f4be %s", line)
logger.Infof("\U0001f4be %s", line)
rc.saveState(ctx, kvPairs, arg)
case "add-matcher":
logger.Infof(" \U00002753 add-matcher %s", arg)
logger.Infof("\U00002753 add-matcher %s", arg)
default:
logger.Infof(" \U00002753 %s", line)
logger.Infof("\U00002753 %s", line)
}

return false
Expand All @@ -83,7 +83,7 @@

func (rc *RunContext) setEnv(ctx context.Context, kvPairs map[string]string, arg string) {
name := kvPairs["name"]
common.Logger(ctx).Infof(" \U00002699 ::set-env:: %s=%s", name, arg)
common.Logger(ctx).Infof("\U00002699 ::set-env:: %s=%s", name, arg)
if rc.Env == nil {
rc.Env = make(map[string]string)
}
Expand Down Expand Up @@ -111,15 +111,15 @@

result, ok := rc.StepResults[stepID]
if !ok {
logger.Infof(" \U00002757 no outputs used step '%s'", stepID)
logger.Infof("\U00002757 no outputs used step '%s'", stepID)

Check warning on line 114 in pkg/runner/command.go

View check run for this annotation

Codecov / codecov/patch

pkg/runner/command.go#L114

Added line #L114 was not covered by tests
return
}

logger.Infof(" \U00002699 ::set-output:: %s=%s", outputName, arg)
logger.Infof("\U00002699 ::set-output:: %s=%s", outputName, arg)
result.Outputs[outputName] = arg
}
func (rc *RunContext) addPath(ctx context.Context, arg string) {
common.Logger(ctx).Infof(" \U00002699 ::add-path:: %s", arg)
common.Logger(ctx).Infof("\U00002699 ::add-path:: %s", arg)
extraPath := []string{arg}
for _, v := range rc.ExtraPath {
if v != arg {
Expand Down
8 changes: 4 additions & 4 deletions pkg/runner/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestStopCommands(t *testing.T) {
messages = append(messages, entry.Message)
}

a.Contains(messages, " \U00002699 ::set-env name=x::abcd\n")
a.Contains(messages, "\U00002699 ::set-env name=x::abcd\n")
}

func TestAddpathADO(t *testing.T) {
Expand All @@ -116,8 +116,8 @@ func TestAddmask(t *testing.T) {
handler := rc.commandHandler(loggerCtx)
handler("::add-mask::my-secret-value\n")

a.Equal(" \U00002699 ***", hook.LastEntry().Message)
a.NotEqual(" \U00002699 *my-secret-value", hook.LastEntry().Message)
a.Equal("\U00002699 ***", hook.LastEntry().Message)
a.NotEqual("\U00002699 *my-secret-value", hook.LastEntry().Message)
}

// based on https://stackoverflow.com/a/10476304
Expand Down Expand Up @@ -171,7 +171,7 @@ func TestAddmaskUsemask(t *testing.T) {
handler("::set-output:: token=secret\n")
})

a.Equal("[testjob] \U00002699 ***\n[testjob] \U00002699 ::set-output:: = token=***\n", re)
a.Equal("[testjob] \U00002699 ***\n[testjob] \U00002699 ::set-output:: = token=***\n", re)
}

func TestSaveState(t *testing.T) {
Expand Down
16 changes: 8 additions & 8 deletions pkg/runner/job_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func newJobExecutor(info jobInfo, sf stepFactory, rc *RunContext) common.Executo
defer cancel()

logger := common.Logger(ctx)
logger.Infof("Cleaning up container for job %s", rc.JobName)
logger.Infof("\U0001f9f9 Cleaning up container for job %s", rc.JobName)
if err = info.stopContainer()(ctx); err != nil {
logger.Errorf("Error while stop job container: %v", err)
}
Expand All @@ -129,9 +129,9 @@ func newJobExecutor(info jobInfo, sf stepFactory, rc *RunContext) common.Executo

return common.NewPipelineExecutor(
common.NewFieldExecutor("step", "Set up job", common.NewFieldExecutor("stepid", []string{"--setup-job"},
common.NewPipelineExecutor(common.NewInfoExecutor("\u2B50 Run Set up job"), info.startContainer(), rc.InitializeNodeTool()).
Then(common.NewFieldExecutor("stepResult", model.StepStatusSuccess, common.NewInfoExecutor(" \u2705 Success - Set up job"))).
OnError(common.NewFieldExecutor("stepResult", model.StepStatusFailure, common.NewInfoExecutor(" \u274C Failure - Set up job")).ThenError(setJobError)))),
common.NewPipelineExecutor(common.NewInfoExecutor("\U00002B50 Run Set up job"), info.startContainer(), rc.InitializeNodeTool()).
Then(common.NewFieldExecutor("stepResult", model.StepStatusSuccess, common.NewInfoExecutor("\U00002705 Success - Set up job"))).
OnError(common.NewFieldExecutor("stepResult", model.StepStatusFailure, common.NewInfoExecutor("\U0000274C Failure - Set up job")).ThenError(setJobError)))),
common.NewPipelineExecutor(pipeline...).
Finally(func(ctx context.Context) error { //nolint:contextcheck
var cancel context.CancelFunc
Expand All @@ -144,11 +144,11 @@ func newJobExecutor(info jobInfo, sf stepFactory, rc *RunContext) common.Executo
return postExecutor(ctx)
}).
Finally(common.NewFieldExecutor("step", "Complete job", common.NewFieldExecutor("stepid", []string{"--complete-job"},
common.NewInfoExecutor("\u2B50 Run Complete job").
common.NewInfoExecutor("\U00002B50 Run Complete job").
Finally(stopContainerExecutor).
Finally(
info.interpolateOutputs().Finally(info.closeContainer()).Then(common.NewFieldExecutor("stepResult", model.StepStatusSuccess, common.NewInfoExecutor(" \u2705 Success - Complete job"))).
OnError(common.NewFieldExecutor("stepResult", model.StepStatusFailure, common.NewInfoExecutor(" \u274C Failure - Complete job"))),
info.interpolateOutputs().Finally(info.closeContainer()).Then(common.NewFieldExecutor("stepResult", model.StepStatusSuccess, common.NewInfoExecutor("\U00002705 Success - Complete job"))).
OnError(common.NewFieldExecutor("stepResult", model.StepStatusFailure, common.NewInfoExecutor("\U0000274C Failure - Complete job"))),
)))).Finally(setJobResultExecutor))
}

Expand Down Expand Up @@ -177,7 +177,7 @@ func setJobResult(ctx context.Context, info jobInfo, rc *RunContext, success boo
jobResultMessage = "failed"
}

logger.WithField("jobResult", jobResult).Infof("\U0001F3C1 Job %s", jobResultMessage)
logger.WithField("jobResult", jobResult).Infof("\U0001F3C1 Job %s", jobResultMessage)
}

func setJobOutputs(ctx context.Context, rc *RunContext) {
Expand Down
8 changes: 4 additions & 4 deletions pkg/runner/run_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
return fmt.Errorf("failed to handle credentials: %s", err)
}

logger.Infof("\U0001f680 Start image=%s", image)
logger.Infof("\U0001f680 Start image=%s", image)
name := rc.jobContainerName()

envList := make([]string, 0)
Expand Down Expand Up @@ -353,7 +353,7 @@
Then(container.NewDockerVolumeRemoveExecutor(rc.jobContainerName()+"-env", false)).IfNot(reuseJobContainer).
Then(func(ctx context.Context) error {
if len(rc.ServiceContainers) > 0 {
logger.Infof("Cleaning up services for job %s", rc.JobName)
logger.Infof("\U0001f9f9 Cleaning up services for job %s", rc.JobName)
if err := rc.stopServiceContainers()(ctx); err != nil {
logger.Errorf("Error while cleaning services: %v", err)
}
Expand All @@ -362,7 +362,7 @@
// if using service containers
// it means that the network to which containers are connecting is created by `act_runner`,
// so, we should remove the network at last.
logger.Infof("Cleaning up network for job %s, and network name is: %s", rc.JobName, networkName)
logger.Infof("\U0001f9f9 Cleaning up network for job %s, and network name is: %s", rc.JobName, networkName)
if err := container.NewDockerNetworkRemoveExecutor(networkName)(ctx); err != nil {
logger.Errorf("Error while cleaning network: %v", err)
}
Expand Down Expand Up @@ -783,7 +783,7 @@
jobType, jobTypeErr := job.Type()

if runJobErr != nil {
return false, fmt.Errorf(" \u274C Error in if-expression: \"if: %s\" (%s)", job.If.Value, runJobErr)
return false, fmt.Errorf("\U0000274C Error in if-expression: \"if: %s\" (%s)", job.If.Value, runJobErr)

Check warning on line 786 in pkg/runner/run_context.go

View check run for this annotation

Codecov / codecov/patch

pkg/runner/run_context.go#L786

Added line #L786 was not covered by tests
}

if jobType == model.JobTypeInvalid {
Expand Down
10 changes: 5 additions & 5 deletions pkg/runner/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
if strings.Contains(stepString, "::add-mask::") {
stepString = "add-mask command"
}
logger.Infof("\u2B50 Run %s %s", stage, stepString)
logger.Infof("\U00002B50 Run %s %s", stage, stepString)

// Prepare and clean Runner File Commands
actPath := rc.JobContainer.GetActPath()
Expand Down Expand Up @@ -144,7 +144,7 @@
err = executor(timeoutctx)

if err == nil {
logger.WithField("stepResult", stepResult.Outcome).Infof(" \u2705 Success - %s %s", stage, stepString)
logger.WithField("stepResult", stepResult.Outcome).Infof("\U00002705 Success - %s %s", stage, stepString)
} else {
stepResult.Outcome = model.StepStatusFailure

Expand All @@ -162,7 +162,7 @@
stepResult.Conclusion = model.StepStatusFailure
}

logger.WithField("stepResult", stepResult.Outcome).Errorf(" \u274C Failure - %s %s", stage, stepString)
logger.WithField("stepResult", stepResult.Outcome).Errorf("\U0000274C Failure - %s %s", stage, stepString)
}
// Process Runner File Commands
orgerr := err
Expand Down Expand Up @@ -263,7 +263,7 @@

runStep, err := EvalBool(ctx, rc.NewStepExpressionEvaluatorExt(ctx, step, stage == stepStageMain), expr, defaultStatusCheck)
if err != nil {
return false, fmt.Errorf(" \u274C Error in if-expression: \"if: %s\" (%s)", expr, err)
return false, fmt.Errorf("\U0000274C Error in if-expression: \"if: %s\" (%s)", expr, err)

Check warning on line 266 in pkg/runner/step.go

View check run for this annotation

Codecov / codecov/patch

pkg/runner/step.go#L266

Added line #L266 was not covered by tests
}

return runStep, nil
Expand All @@ -279,7 +279,7 @@

continueOnError, err := EvalBool(ctx, rc.NewStepExpressionEvaluator(ctx, step), expr, exprparser.DefaultStatusCheckNone)
if err != nil {
return false, fmt.Errorf(" \u274C Error in continue-on-error-expression: \"continue-on-error: %s\" (%s)", expr, err)
return false, fmt.Errorf("\U0000274C Error in continue-on-error-expression: \"continue-on-error: %s\" (%s)", expr, err)
}

return continueOnError, nil
Expand Down
Loading