Skip to content

ci: hclogvet does not run on entire codebase #25628

Open
@jrasell

Description

@jrasell

hclogvet is currently triggered within CI (via our makefile) using the command hclogvet . which does not run across all sub-directories within the Nomad project. In order to run this correctly, hclogvet should be triggered with the argument ./... and when done, the following errors are found:

client/widmgr/widmgr.go:124:16: invalid number of log arguments to Warn (1 valid pair only)
# github.com/hashicorp/nomad/client/allocrunner/taskrunner
# [github.com/hashicorp/nomad/client/allocrunner/taskrunner]
client/allocrunner/taskrunner/api_hook.go:100:19: invalid number of log arguments to Debug (1 valid pair only)
client/allocrunner/taskrunner/dynamic_users_hook.go:80:17: invalid number of log arguments to Error (1 valid pair only)
client/allocrunner/taskrunner/identity_hook.go:137:19: invalid number of log arguments to Error (1 valid pair only)
client/allocrunner/taskrunner/identity_hook.go:151:19: invalid number of log arguments to Warn (1 valid pair only)
# github.com/hashicorp/nomad/client
# [github.com/hashicorp/nomad/client]
client/alloc_endpoint.go:278:18: invalid number of log arguments to Info (1 valid pair only)
client/client.go:1335:18: invalid number of log arguments to Error (2 valid pairs only)
# github.com/hashicorp/nomad/scheduler
# [github.com/hashicorp/nomad/scheduler]
scheduler/scheduler_system.go:365:18: invalid number of log arguments to Debug (1 valid pair only)
# github.com/hashicorp/nomad/nomad
# [github.com/hashicorp/nomad/nomad]
nomad/job_endpoint.go:2110:17: invalid number of log arguments to Error (1 valid pair only)
nomad/leader.go:2627:15: invalid number of log arguments to Error (1 valid pair only)
nomad/leader.go:2656:15: invalid number of log arguments to Error (1 valid pair only)
nomad/locks.go:60:17: invalid number of log arguments to Error (1 valid pair only)
nomad/locks.go:149:17: invalid number of log arguments to Error (1 valid pair only)

All but one error is easily fixable. The problem found at client/alloc_endpoint.go:278 is a false positive as hclogvet is unable to understand the log line is being passed an array of k/v pairs as its arguments. hclogvet will need to be updated, before CI can be modified to run the command correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions