Commit Graph

69 Commits

Author SHA1 Message Date
Davanum Srinivas
fa7cdf81cc
Drop typecheck-providerless verification
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-05-07 08:24:15 -04:00
Patrick Ohly
c1f2fe7bcb golangci-lint: optionally skip it during "make verify", II
The pull-kubernetes-verify job is using this to run the base
verify-golangci.sh only in the pull-kubernetes-verify-lint job.
Because the file name was not quite right, it still ran.
2024-02-16 10:07:51 +01:00
Patrick Ohly
39606af8c3 golangci-lint: optionally skip it during "make verify"
The pull-kubernetes-verify job is going to use this to run the base
verify-golangci.sh only in the pull-kubernetes-verify-lint job.
2024-02-13 17:35:15 +01:00
Kubernetes Prow Robot
c0618cf947
Merge pull request #122769 from thockin/bump_shellcheck_version
Bump shellcheck to 0.9.0
2024-02-05 08:45:29 -08:00
Tim Hockin
a7cf7fe55a
Bump shellcheck to 0.9.0
Fix everything it flagged.
2024-01-26 16:26:40 -08:00
Tim Hockin
8b8f0a70cd
Make verify-fieldname-docs actually error
Sadly, cmd/fieldnamedocscheck did not exit non-zero when it needed to.

Fix the one thing it flagged.
Add it to verify-quick
2024-01-14 10:32:08 -08:00
Patrick Ohly
f538be659c hack: fix update of golangci-lint verify scripts
b190ea0c9 accidentally enabled verify-golangci-lint-pr-hints.sh (non-blocking!)
in the normal "make verify" (blocking!).
2023-10-10 09:03:20 +02:00
Patrick Ohly
b190ea0c96 hack: update golangci-lint verify scripts
Instead of invoking verify-golangci-lint.sh directly from Prow jobs,
those Prow jobs should use "make verify WHAT=...". The advantage is
that the common code for running verify targets will be used, which
includes producing JUnit files.

Providing simple wrappers for strict linting of PRs (=
verify-golangci-lint-pr.sh) and event stricter linting of PRs with hints
enabled (= verify-golangci-lint-pr-hints.sh) enables those WHAT targets.
2023-10-09 20:14:47 +02:00
Patrick Ohly
dbbb21469f verify: pick relevant lines from verify-golangci-lint.sh as failure message
When sh2ju.sh was called to generate the junit_verify.xml, it used to include
the entire output of a failed script twice: once as failure message, once as
log output.

This output can be large and often the actual failure isn't near the top, but
rather at the end or (in the case of the different golangci-lint invocations)
embedded in the log. This makes them hard to see at a glance when looking at
the Prow result page for a job.

Now a verify script can prefix relevant lines with "ERROR: " and then only
those lines are used as failure message in JUnit, without that prefix.

That string was chosen because Prow itself also then picks up those lines when
viewing the entire build log and it is unlikely that some script prints such
lines when they are not meant to be part of the failure.

If some script outputs no such lines, "see stderr for details" is used as
failure message. This is better than before because it avoids the redundancy.
2023-06-02 15:37:50 +02:00
Tim Allclair
3808920328 Add a script to verify that URLs in API documentation are valid 2023-03-13 11:37:59 -07:00
Patrick Ohly
04700e97d3 hack: prepare for strict golangci-lint in pull-verify-kubernetes
The long-term goal is that when "make verify" is invoked in pull job, it will
also run golangci-lint with the strict configuration and write an
$ARTIFACTS/golangci-lint-githubactions.log file with GitHub actions
annotations. How to get those published for the GitHub PR is open.

When "make verify" is invoked manually or in any other job, the stricter check
will be skipped. That works because "PR_NUMBER" is only set for pre-merge
jobs (https://github.com/kubernetes/test-infra/blob/master/prow/jobs.md#job-environment-variables).

Because strict linting is still new and might not be useful without a better
UI (= GitHub annotations), this PR does not fully enable the integration into
"make verify". Instead, the new verify-golangci-lint-pr.sh is excluded from it
and needs to be run in a separate job.
2023-03-07 19:38:32 +01:00
Patrick Ohly
c496c92f4d verify: include "govet-levee" in normal "make verify"
The corresponding feature was already moved to stable:

https://github.com/kubernetes/enhancements/blob/master/keps/sig-security/1933-secret-logging-static-analysis/kep.yaml

Including this check in the normal "make verify" and "pull-kubernetes-verify"
is the first step. The next step is to remove the separate
"pull-kubernetes-verify-govet-levee".
2023-03-03 11:53:22 +01:00
Tim Hockin
e477d45f56
Neutralize obsolete verify scripts
This is all obsolete or covered by verify-codegen now.
2022-10-04 08:50:31 -07:00
Davanum Srinivas
837d3b4ca2
drop scripts and files related to linkcheck
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-09-23 13:55:45 -04:00
Mario Jason Braganza
066fd90f26
add verify-licenses.sh to the EXCLUDED_PATTERNS in make-rules/verify.sh 2022-05-06 19:03:03 +05:30
Patrick Ohly
17e3c555c5 hack: integrate logcheck into golangci-lint
Running logcheck as part of golangci-lint has several advantages:
- faster checking because finding files and parsing is shared
  with other linters
- gets rid of the complex and buggy
  hack/verify-structured-logging.sh (https://github.com/kubernetes/kubernetes/issues/106746)
- support for // nolint:logcheck
- works with Go 1.18
2022-03-24 11:21:03 +01:00
Kir Kolyshkin
e3ed3ba7c9 update golangci-lint to 1.45.0
This should fix Go 1.18 compatibility woes.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-03-23 10:19:16 -07:00
Davanum Srinivas
0a5f9115f2
re-add govet and stable metrics
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-03-23 08:02:54 -04:00
Davanum Srinivas
031da66841
Temporarily ignore some verify failures in go1.18"
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-03-22 20:42:03 -04:00
Ciprian Hacman
6cdb1c225d Clean up dockerless build tag
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2021-12-18 12:18:25 +02:00
David Eads
156fefa36a add verify script to catch most validation mutations 2021-10-08 14:37:55 -04:00
Davanum Srinivas
75748c185e
enable verify-golangci-lint.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-07-14 08:53:33 -04:00
Benjamin Elder
f32bfe10b7 drop bazel from make verify QUICK=true
it's faster than ever, but also more pointless than ever. most future development has no need to run this
2021-03-07 13:03:17 -08:00
Davanum Srinivas
865fd2f04f
Use golangci-lint to find unused/dead code
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-02-19 12:12:02 -05:00
Patrick Rhomberg
e67ab309b7 Exclude KEP-1933 from verify-all.sh until after alpha status. 2020-11-04 20:18:57 +00:00
Kubernetes Prow Robot
e0f7d0ce3e
Merge pull request #95659 from makhov/fix-verify-sh
fix unbound variable issue in verify.sh
2020-10-20 11:22:44 -07:00
Aleksei Makhov
1777a356c8 fix unbound variable issue in verify.sh 2020-10-16 21:39:25 +03:00
hasheddan
8accd354b0
Run make verify with python3 to fix publishing bot issue
verify-publishing-bot is experiencing errors importing pyyaml since
python3 was added to kubekins-e2e image. This changes make verify to run
verify-publishing-bot with python3.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-08-01 09:46:13 -05:00
Stephen Augustus
edb98fb493 verify: Exclude verify-external-dependencies from make verify
Also adds verify-external-dependencies to QUICK_PATTERNS

Signed-off-by: Stephen Augustus <saugustus@vmware.com>
2020-05-12 18:07:14 -04:00
mattjmcnaughton
4a8da5e7b4
Add typecheck-dockerless
Ensure that k8s still passes the typecheck when the `dockerless` tag is
enabled. We perform a similar verify step for `providerless`.
2020-05-07 17:18:50 -04:00
Davanum Srinivas
14a0e86d1d
Avoid running files-remake in verify-all
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-04-30 11:35:35 -04:00
Benjamin Elder
b24dbac09a add hack/verify-typecheck-providerless.sh 2019-12-04 22:30:23 -08:00
Kenichi Omichi
1b165fc440 Enable verify-import-aliases check in CI
To block violation of import-aliases rule, this enables
verify-import-aliases in CI system.
2019-11-08 19:17:39 +00:00
Lubomir I. Ivanov
2c54160021 remove usage of the test/test_owners.* files
- remove update_owners.py; seems responsible for generating
test_owners files
- remove the existing test/test_owners.* files
- remove verify-test-owners.sh and references to it
2019-10-18 03:01:21 +03:00
Davanum Srinivas
9f0050cb44
verify import aliases
- Added scripts for update and verify
- golang AST code for scanning and fixing imports
- default regex allows it to run on just test/e2e.* file paths
- exclude verify-import-aliases.sh from running in CI jobs

Change-Id: I7f9c76f5525fb9a26ea2be60ea69356362957998
Co-Authored-By: Aaron Crickenberger <spiffxp@google.com>
2019-06-15 22:31:39 -04:00
toyoda
9a5655c915 fix shellcheck failures in /hack/make-rules/update.sh,verify.sh 2019-05-07 14:27:26 +09:00
Kubernetes Prow Robot
92562d5bc0
Merge pull request #76253 from YoubingLi/bugfix
Fixes # 76094 - Check the content of WHAT for Makefile's verify target
2019-04-15 18:05:05 -07:00
Youbing Li
8a56ebed82 Check the content of WHAT for Makefile's verify target 2019-04-08 22:53:23 -04:00
Christoph Blecker
668a288595
Remove unneeded scripts 2019-04-07 12:08:41 -07:00
Jordan Liggitt
2ea3cbdcbc Update hack scripts to use go mod 2019-04-03 10:19:39 -04:00
Roy Lenferink
b18bc2ea79 Improved some more bash script variable definitions 2019-01-21 23:11:58 +01:00
Sen Lu
7e76524766 add an env to skip readonly-packages check 2019-01-11 16:46:51 -08:00
Christoph Blecker
b19fb0a77e
Clean up artifacts variables in hack scripts 2018-12-19 15:17:13 -08:00
Christoph Blecker
d90ae78a86
Provide option to split godeps tests from main verify job 2018-12-11 16:42:45 -08:00
Jordan Liggitt
91980a0f61 Add verification script for test feature gate modification 2018-11-21 11:51:33 -05:00
Jordan Liggitt
3bd1824ed6
Add verify script for staging repo metadata files 2018-08-24 09:14:33 -04:00
Christoph Blecker
2b9022cf38
Add script to verify generated files 2018-07-05 14:06:54 -07:00
Matthias Bertschy
9b15af19b2 Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
Ryan Hitchman
d295ca1134 Add support for make verify WHAT=typecheck.
This will be used to make the typecheck job emit junit and avoids
duplicating the rest of the verify logic.
2018-03-01 15:03:24 -08:00
Ryan Hitchman
dd40e612dd Add test/typecheck, a fast typecheck for all build platforms.
Most of the time spent compiling is spent optimizing and linking
binary code. Most errors occur at the syntax or semantic (type) layers.
Go's compiler is importable as a normal package, so we can do fast
syntax and type checking for the 10 platforms we build on.

This currently takes ~6 minutes of CPU time (parallelized).

This makes presubmit cross builds superfluous, since it should catch
most cross-build breaks (generally Unix and 64-bit assumptions).

Example output:

$ time go run test/typecheck/main.go
type-checking:  linux/amd64, windows/386, darwin/amd64, linux/arm, linux/386, windows/amd64, linux/arm64, linux/ppc64le, linux/s390x, darwin/386
ERROR(windows/amd64) pkg/proxy/ipvs/proxier.go:1708:27: ENXIO not declared by package unix
ERROR(windows/386) pkg/proxy/ipvs/proxier.go:1708:27: ENXIO not declared by package unix

real	0m45.083s
user	6m15.504s
sys	1m14.000s
2018-02-27 13:53:32 -08:00