grafana/pkg/build
Jack Baldry 8379a5338c
CI: Lint starlark files with buildifier (#59157)
* Add verify-starlark build action that returns an error for starlark files with lint

Relies on `buildifier` tool.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add verify_starlark_step to PR pipeline

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Manually fetch buildifier in curl_image until a new build_image is created

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Format with buildifier

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Remove all unused variables retaining one unused function

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use snake_case for variable

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Replace deprecated dictionary concatenation with .update() method

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Start adding docstrings for all modules and functions

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Prefer os.WriteFile as ioutil.WriteFile has been deprecated since go 1.16

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Attempt to document the behavior of the init_enterprise_step

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document test_backend pipeline

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document enterprise_downstream_step

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document the pipeline utility function

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document publish_images_step

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document publish_images_steps

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document enterprise2_pipelines function

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add tags table for Starlark files.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document test_frontend

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document windows function

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add docstrings to verifystarlark functions

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Refactor error handling to be more clear and document complex behavior

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Split errors into execution errors and verification errors

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document all other library functions

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add local variables to TAGS

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add blank line between all Args and Returns sections

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix new linting errors

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Lint new Starlark files

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Correct buildifier binary mv

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document the need to set nofile ulimit to at least 2048

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Update build-container to include buildifier

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Ensure buildifier binary is executable

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix valid content test

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Simply return execution error

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Only check files rather than fixing them

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use updated build-container with executable buildifier

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Test that context cancellation stops execution

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Simplify error handling

Return execution errors that short circuit WalkDir rather than
separately tracking that error.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Remove fetching of buildifier binary now that it is in the build-container

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use build image in verify-starlark step

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use semver tag

The image is the same but uses a semver tag to make it clearer that
this is a forward upgrade from the old version.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use node 18 image with buildifier

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

---------

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-01-30 09:27:11 +00:00
..
cmd CI: Lint starlark files with buildifier (#59157) 2023-01-30 09:27:11 +00:00
compilers CI: add the grabpl build-backend command into the repo (#52673) 2022-07-28 10:11:22 -04:00
config Chore: Remove unused config fields (#60393) 2022-12-19 13:08:43 +02:00
cryptoutil Handle ioutil deprecations (#53526) 2022-08-10 15:37:51 +02:00
docker Build: Unified dockerfile for all builds (#59173) 2022-11-28 16:18:53 -05:00
droneutil CI: add the grabpl build-backend command into the repo (#52673) 2022-07-28 10:11:22 -04:00
e2eutil CI: move grabpl e2e tests from grabpl to grafana (#53075) 2022-09-02 11:02:10 -04:00
env CI: Make the downstream enterprise test a check instead of comments (#59071) 2022-11-24 08:17:12 -06:00
errutil CI: add the grabpl build-backend command into the repo (#52673) 2022-07-28 10:11:22 -04:00
executil CI: add the grabpl build-backend command into the repo (#52673) 2022-07-28 10:11:22 -04:00
frontend CI: move grabpl build-frontend-packages from grabpl to grafana (#53072) 2022-09-06 20:09:08 +03:00
fsutil CI: Add CreateTempDir func and use it in publish packages logic (#57171) 2022-10-19 12:58:22 +02:00
gcloud Replace filename with path without the local dir (#56296) 2022-10-04 17:18:07 +03:00
git CI: add log for branch deletion (#60647) 2022-12-21 19:27:49 +00:00
golangutils CI: add the grabpl build-backend command into the repo (#52673) 2022-07-28 10:11:22 -04:00
gpg CI: Move CreateTempFile - use it for rpm/deb packages (#56990) 2022-10-17 16:23:57 +01:00
grafana Server: Switch from separate server & cli to a unified grafana binary (#58286) 2022-11-22 11:53:43 -05:00
lerna CI: Add artifacts npm commands from grabpl (#61908) 2023-01-23 11:32:51 +01:00
metrics CI: Move grabpl publish-metrics (#55042) 2022-09-12 13:28:08 -05:00
npm CI: Add artifacts npm commands from grabpl (#61908) 2023-01-23 11:32:51 +01:00
packaging Chore: Missed deprecations due to overly broad lint exclusion (#59732) 2022-12-14 12:32:45 +01:00
plugins CI: Refactor versions.go (#55238) 2022-09-16 06:26:33 -04:00
stringutil CI: Make the downstream enterprise test a check instead of comments (#59071) 2022-11-24 08:17:12 -06:00
syncutil CI: add the grabpl build-backend command into the repo (#52673) 2022-07-28 10:11:22 -04:00
validation CI: move grabpl package command to pkg/build (#55651) 2022-09-23 11:49:07 -05:00
versions CI: Add artifacts npm commands from grabpl (#61908) 2023-01-23 11:32:51 +01:00
action.go CI: add the grabpl build-backend command into the repo (#52673) 2022-07-28 10:11:22 -04:00
cmd.go Server: Switch from separate server & cli to a unified grafana binary (#58286) 2022-11-22 11:53:43 -05:00
docs.go Chore: move build command to importable package (#38726) 2021-09-03 11:24:21 -05:00
exec.go Chore: move build command to importable package (#38726) 2021-09-03 11:24:21 -05:00
fs.go Add nolint to two lines in fs.go (#49357) 2022-05-21 12:14:58 +02:00
git.go Chore: move build command to importable package (#38726) 2021-09-03 11:24:21 -05:00
opts.go Chore: move build command to importable package (#38726) 2021-09-03 11:24:21 -05:00
version.go Chore: Use strings.ReplaceAll and preallocate containers (#58483) 2022-11-09 17:17:09 +01:00