From cc996a2b85b81a468e9ccd95d8eb9c90563d0d56 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 10 Mar 2025 21:45:15 +0100 Subject: [PATCH] fix: starlark lint --- .woodpecker.star | 285 ++++++++++---------- services/storage-users/pkg/config/config.go | 4 +- 2 files changed, 143 insertions(+), 146 deletions(-) diff --git a/.woodpecker.star b/.woodpecker.star index e7a79e17e9..222dca5a83 100644 --- a/.woodpecker.star +++ b/.woodpecker.star @@ -427,9 +427,9 @@ def main(ctx): buildOcisBinaryForTesting(ctx) + \ checkStarlark() + \ build_release_helpers + \ - testOcisAndUploadResults(ctx) \ - # testPipelines(ctx) + testOcisAndUploadResults(ctx) + # testPipelines(ctx) # build_release_pipelines = \ # dockerReleases(ctx) + \ # binaryReleases(ctx) @@ -499,8 +499,6 @@ def testOcisAndUploadResults(ctx): # FIXME: RE-ENABLE THIS ASAP!!! # ###################################################################### - - #security_scan = scanOcis(ctx) #return [security_scan, pipeline, scan_result_upload] return [pipeline] @@ -1411,10 +1409,10 @@ def multiServiceE2ePipeline(ctx): "commands": [ "cd %s/tests/e2e" % dirs["web"], "bash run-e2e.sh %s" % e2e_args, - ], - }] + logTracingResults() \ - # uploadTracingResult(ctx) + \ + ], + }] + logTracingResults() + # uploadTracingResult(ctx) + \ pipelines.append({ "name": "e2e-tests-multi-service", "steps": steps, @@ -1533,61 +1531,61 @@ def dockerRelease(ctx, arch, repo, build_type): }, "steps": makeNodeGenerate("") + makeGoGenerate("") + [ - { - "name": "build", - "image": OC_CI_GOLANG, - "environment": CI_HTTP_PROXY_ENV, - "commands": [ - "make -C opencloud release-linux-docker-%s ENABLE_VIPS=true" % (arch), - ], - }, - { - "name": "dryrun", - "image": PLUGINS_DOCKER, - "settings": { - "dry_run": True, - "context": "ocis", - "tags": "linux-%s" % (arch), - "dockerfile": "ocis/docker/Dockerfile.linux.%s" % (arch), - "repo": repo, - "build_args": build_args, - }, - "when": { - "ref": { - "include": [ - "refs/pull/**", - ], - }, - }, - }, - { - "name": "docker", - "image": PLUGINS_DOCKER, - "settings": { - "username": { - "from_secret": "docker_username", - }, - "password": { - "from_secret": "docker_password", - }, - "auto_tag": True, - "context": "ocis", - "auto_tag_suffix": "linux-%s" % (arch), - "dockerfile": "ocis/docker/Dockerfile.linux.%s" % (arch), - "repo": repo, - "build_args": build_args, - }, - "when": [ - { - "event": ["push", "manual"], - "branch": "main", - }, - { - "event": "tag", - }, - ], - }, - ], + { + "name": "build", + "image": OC_CI_GOLANG, + "environment": CI_HTTP_PROXY_ENV, + "commands": [ + "make -C opencloud release-linux-docker-%s ENABLE_VIPS=true" % (arch), + ], + }, + { + "name": "dryrun", + "image": PLUGINS_DOCKER, + "settings": { + "dry_run": True, + "context": "ocis", + "tags": "linux-%s" % (arch), + "dockerfile": "ocis/docker/Dockerfile.linux.%s" % (arch), + "repo": repo, + "build_args": build_args, + }, + "when": { + "ref": { + "include": [ + "refs/pull/**", + ], + }, + }, + }, + { + "name": "docker", + "image": PLUGINS_DOCKER, + "settings": { + "username": { + "from_secret": "docker_username", + }, + "password": { + "from_secret": "docker_password", + }, + "auto_tag": True, + "context": "ocis", + "auto_tag_suffix": "linux-%s" % (arch), + "dockerfile": "ocis/docker/Dockerfile.linux.%s" % (arch), + "repo": repo, + "build_args": build_args, + }, + "when": [ + { + "event": ["push", "manual"], + "branch": "main", + }, + { + "event": "tag", + }, + ], + }, + ], "depends_on": depends_on, "when": [ { @@ -1679,82 +1677,82 @@ def binaryRelease(ctx, arch, build_type, target, depends_on = []): return { "name": "binaries-%s-%s" % (arch, build_type), "steps": makeNodeGenerate("") + - makeGoGenerate("") + [ - { - "name": "build", - "image": OC_CI_GOLANG, - "environment": CI_HTTP_PROXY_ENV, - "commands": [ - "make -C opencloud release-%s" % (arch), - ], - }, - { - "name": "finish", - "image": OC_CI_GOLANG, - "environment": CI_HTTP_PROXY_ENV, - "commands": [ - "make -C opencloud release-finish", - "cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/", - ], - "when": [ - { - "event": ["push", "manual"], - "branch": "main", - }, - { - "event": "tag", - }, - ], - }, - { - "name": "upload", - "image": PLUGINS_S3, - "settings": settings, - "when": [ - { - "event": ["push", "manual"], - "branch": "main", - }, - { - "event": "tag", - }, - ], - }, - { - "name": "changelog", - "image": OC_CI_GOLANG, - "environment": CI_HTTP_PROXY_ENV, - "commands": [ - "make changelog CHANGELOG_VERSION=%s" % ctx.build.ref.replace("refs/tags/v", ""), - ], - "when": [ - { - "event": "tag", - }, - ], - }, - { - "name": "release", - "image": PLUGINS_GITHUB_RELEASE, - "settings": { - "api_key": { - "from_secret": "github_token", - }, - "files": [ - "ocis/dist/release/*", - ], - "title": ctx.build.ref.replace("refs/tags/v", ""), - "note": "ocis/dist/CHANGELOG.md", - "overwrite": True, - "prerelease": len(ctx.build.ref.split("-")) > 1, - }, - "when": [ - { - "event": "tag", - }, - ], - }, - ], + makeGoGenerate("") + [ + { + "name": "build", + "image": OC_CI_GOLANG, + "environment": CI_HTTP_PROXY_ENV, + "commands": [ + "make -C opencloud release-%s" % (arch), + ], + }, + { + "name": "finish", + "image": OC_CI_GOLANG, + "environment": CI_HTTP_PROXY_ENV, + "commands": [ + "make -C opencloud release-finish", + "cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/", + ], + "when": [ + { + "event": ["push", "manual"], + "branch": "main", + }, + { + "event": "tag", + }, + ], + }, + { + "name": "upload", + "image": PLUGINS_S3, + "settings": settings, + "when": [ + { + "event": ["push", "manual"], + "branch": "main", + }, + { + "event": "tag", + }, + ], + }, + { + "name": "changelog", + "image": OC_CI_GOLANG, + "environment": CI_HTTP_PROXY_ENV, + "commands": [ + "make changelog CHANGELOG_VERSION=%s" % ctx.build.ref.replace("refs/tags/v", ""), + ], + "when": [ + { + "event": "tag", + }, + ], + }, + { + "name": "release", + "image": PLUGINS_GITHUB_RELEASE, + "settings": { + "api_key": { + "from_secret": "github_token", + }, + "files": [ + "ocis/dist/release/*", + ], + "title": ctx.build.ref.replace("refs/tags/v", ""), + "note": "ocis/dist/CHANGELOG.md", + "overwrite": True, + "prerelease": len(ctx.build.ref.split("-")) > 1, + }, + "when": [ + { + "event": "tag", + }, + ], + }, + ], "depends_on": depends_on, "when": [ { @@ -2289,7 +2287,7 @@ def ocisServer(storage = "ocis", accounts_hash_difficulty = 4, volumes = [], dep "backend_options": { "docker": { "user": user, - } + }, }, "commands": [ "%s init --insecure true" % ocis_bin, @@ -2484,7 +2482,6 @@ def checkStarlark(): "commands": [ "buildifier --mode=check .woodpecker.star", ], - "failure": "ignore", }, { "name": "show-diff", @@ -3102,10 +3099,10 @@ def k6LoadTests(ctx): "curl -s -o run_k6_tests.sh %s" % script_link, "apk add --no-cache openssh-client sshpass", "sh %s/run_k6_tests.sh --ocis-log" % (dirs["base"]), - ], + ], "when": [ { - "status": ["success","failure"], + "status": ["success", "failure"], }, ], }, @@ -3117,13 +3114,13 @@ def k6LoadTests(ctx): ], "when": [ { - "status": ["success","failure"], + "status": ["success", "failure"], }, ], }, ], "depends_on": [], - "when":[ + "when": [ { "event": event_array, }, diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index cdfc022b70..d91bad31d9 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -203,9 +203,9 @@ type PosixDriver struct { UseSpaceGroups bool `yaml:"use_space_groups" env:"STORAGE_USERS_POSIX_USE_SPACE_GROUPS" desc:"Use space groups to manage permissions on spaces." introductionVersion:"1.0.0"` - EnableFSRevisions bool `yaml:"enable_fs_revisions" env:"STORAGE_USERS_POSIX_ENABLE_FS_REVISIONS" desc:"Allow for generating revisions from changes done to the local storage. Note: This doubles the number of bytes stored on disk because a copy of the current revision is stored to be turned into a revision later."` + EnableFSRevisions bool `yaml:"enable_fs_revisions" env:"STORAGE_USERS_POSIX_ENABLE_FS_REVISIONS" desc:"Allow for generating revisions from changes done to the local storage. Note: This doubles the number of bytes stored on disk because a copy of the current revision is stored to be turned into a revision later." introductionVersion:"1.0.0"` - WatchFS bool `yaml:"watch_fs" env:"STORAGE_USERS_POSIX_WATCH_FS" desc:"Enable the filesystem watcher to detect changes to the filesystem. This is used to detect changes to the filesystem and update the metadata accordingly."` + WatchFS bool `yaml:"watch_fs" env:"STORAGE_USERS_POSIX_WATCH_FS" desc:"Enable the filesystem watcher to detect changes to the filesystem. This is used to detect changes to the filesystem and update the metadata accordingly." introductionVersion:"2.0.0"` WatchType string `yaml:"watch_type" env:"STORAGE_USERS_POSIX_WATCH_TYPE" desc:"Type of the watcher to use for getting notified about changes to the filesystem. Currently available options are 'inotifywait' (default), 'gpfswatchfolder' and 'gpfsfileauditlogging'." introductionVersion:"1.0.0"` WatchPath string `yaml:"watch_path" env:"STORAGE_USERS_POSIX_WATCH_PATH" desc:"Path to the watch directory/file. Only applies to the 'gpfsfileauditlogging' and 'inotifywait' watcher, in which case it is the path of the file audit log file/base directory to watch." introductionVersion:"1.0.0"` WatchFolderKafkaBrokers string `yaml:"watch_folder_kafka_hosts" env:"STORAGE_USERS_POSIX_WATCH_FOLDER_KAFKA_BROKERS" desc:"Comma-separated list of kafka brokers to read the watchfolder events from." introductionVersion:"1.0.0"`