Skip to content

Commit 65d1c72

Browse files
committed
Revert "feat:[CI-13780]: Fixed lint issues"
This reverts commit 986ce72.
1 parent 986ce72 commit 65d1c72

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

engine/pids/pidfile.go

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ import (
1212
"time"
1313
)
1414

15-
const (
16-
// filePermission defines the permission for creating/writing PID files
17-
filePermission = 0644
18-
)
19-
2015
// ReadPIDsFromFile reads process IDs (PIDs) from a file at the specified path.
2116
// The file should contain PIDs as comma-separated values.
2217
// It returns a slice of integers representing the PIDs.
@@ -114,7 +109,7 @@ func AppendPIDToFile(pid int, path string) error {
114109
}
115110

116111
// Open file for appending, create if it doesn't exist
117-
file, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, filePermission)
112+
file, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
118113
if err != nil {
119114
return fmt.Errorf("failed to open file %s: %w", path, err)
120115
}
@@ -124,9 +119,9 @@ func AppendPIDToFile(pid int, path string) error {
124119
var content string
125120
if fileExists {
126121
// If file exists, check if it's empty or needs a comma separator
127-
fileInfo, statErr := file.Stat()
128-
if statErr != nil {
129-
return fmt.Errorf("failed to get file info: %w", statErr)
122+
fileInfo, err := file.Stat()
123+
if err != nil {
124+
return fmt.Errorf("failed to get file info: %w", err)
130125
}
131126

132127
if fileInfo.Size() > 0 {
@@ -217,13 +212,13 @@ func killProcessWithGracePeriod(pid int, timeout time.Duration) error {
217212
// Wait for the process to exit or timeout to expire
218213
done := make(chan error)
219214
go func() {
220-
_, waitErr := process.Wait()
221-
done <- waitErr
215+
_, err := process.Wait()
216+
done <- err
222217
}()
223218
select {
224-
case waitErr := <-done:
225-
if waitErr != nil {
226-
return waitErr
219+
case err := <-done:
220+
if err != nil {
221+
return err
227222
}
228223
return nil
229224
case <-time.After(timeout):

engine/spec/spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type (
2121
EnableDockerSetup *bool `json:"mount_docker_socket"`
2222
TTY bool `json:"tty,omitempty" default:"false"`
2323
MtlsConfig MtlsConfig `json:"mtls_config,omitempty"`
24-
ProcessIdsFilePath string `json:"process_ids_file_path,omitempty"` // Path to the file where process IDs are stored. Process IDs are used to track running processes launched by run step on host. //nolint:lll
24+
ProcessIdsFilePath string `json:"process_ids_file_path,omitempty"` // Path to the file where process IDs are stored. Process IDs are used to track running processes launched by run step on host.
2525
}
2626

2727
// Step defines a pipeline step.

logstream/replacer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func NewReplacer(w Writer, secrets []string) Writer {
195195

196196
// NewReplacerWithEnvs returns a replacer that wraps io.Writer w with environment variable support.
197197
// If CI_ENABLE_EXTRA_CHARACTERS_SECRETS_MASKING is set to "true" in envs, uses advanced variant creation.
198-
func NewReplacerWithEnvs(w Writer, secrets []string, envs map[string]string) Writer { //nolint:gocyclo
198+
func NewReplacerWithEnvs(w Writer, secrets []string, envs map[string]string) Writer {
199199
// Check if advanced secret masking is enabled
200200
useAdvancedMasking := false
201201
if envs != nil {

pipeline/runtime/runtestsV2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func getTestsSelection(ctx context.Context, fs filesystem.FileSystem, stepID, wo
280280
}
281281

282282
func getTestsSelectionWithTiModeEnabled(ctx context.Context, fs filesystem.FileSystem, stepID, workspace string, log *logrus.Logger,
283-
isManual bool, tiConfig *tiCfg.Cfg, envs map[string]string, runV2Config *api.RunTestsV2Config, testGlobs []string) (types.SelectTestsResp, bool) { //nolint:unparam
283+
isManual bool, tiConfig *tiCfg.Cfg, envs map[string]string, runV2Config *api.RunTestsV2Config, testGlobs []string) (types.SelectTestsResp, bool) {
284284
selection := types.SelectTestsResp{}
285285
// Question : Here i can see feature state is being defined in Runtest but here we don't have runOnlySelected tests so should we always defined as optimized state
286286
var files []types.File

0 commit comments

Comments
 (0)