Skip to content

Commit

Permalink
Move prow/{config,plugins}.yaml to config/prow
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaroaleman committed Sep 18, 2019
1 parent f069632 commit 9b609a9
Show file tree
Hide file tree
Showing 48 changed files with 99 additions and 83 deletions.
5 changes: 3 additions & 2 deletions config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ sh_binary(
name = "mkpj",
srcs = ["mkpj_binary"],
args = [
"--config-path=$(location //prow:config.yaml)",
"--config-path=$(location //config/prow:config.yaml)",
"--job-config-path=config/jobs",
],
data = [
":prowjobs",
"//prow:config.yaml",
"//config/prow:config.yaml",
],
)

Expand Down Expand Up @@ -49,6 +49,7 @@ filegroup(
srcs = [
":package-srcs",
"//config/jobs/kubernetes-security:all-srcs",
"//config/prow:all-srcs",
"//config/tests/jobs:all-srcs",
"//config/tests/testgrids:all-srcs",
],
Expand Down
2 changes: 1 addition & 1 deletion config/jobs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ eg:

Prow supports [Presets](/prow/jobs.md#presets) to define and patch in common
env vars and volumes used for credentials or common job config. Some are
defined centrally in [`prow/config.yaml`], while others can be defined in
defined centrally in [`config/prow/config.yaml`], while others can be defined in
files here. eg:

- [`preset-service-account: "true"`] ensures the prowjob has a GCP service
Expand Down
8 changes: 4 additions & 4 deletions config/jobs/kubernetes-security/genjobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ genjobs automatically generates the security repo presubmits from the
kubernetes presubmits
NOTE: this makes a few assumptions
- $PWD/../../prow/config.yaml is where the config lives (unless you supply --config=)
- $PWD/../../config/prow/config.yaml is where the config lives (unless you supply --config=)
- $PWD/.. is where the job configs live (unless you supply --jobs=)
- the output is job configs ($PWD/..) + /kubernetes-security/generated-security-jobs.yaml (unless you supply --output)
*/
Expand Down Expand Up @@ -47,7 +47,7 @@ import (
"k8s.io/test-infra/prow/config"
)

var configPath = flag.String("config", "", "path to prow/config.yaml, defaults to $PWD/../../prow/config.yaml")
var configPath = flag.String("config", "", "path to config/prow/config.yaml, defaults to $PWD/../../config/prow/config.yaml")
var jobsPath = flag.String("jobs", "", "path to prowjobs, defaults to $PWD/../")
var outputPath = flag.String("output", "", "path to output the generated jobs to, defaults to $PWD/generated-security-jobs.yaml")

Expand Down Expand Up @@ -315,13 +315,13 @@ func copyFile(srcPath, destPath string) error {

func main() {
flag.Parse()
// default to $PWD/prow/config.yaml
// default to $PWD/config/prow/config.yaml
pwd, err := os.Getwd()
if err != nil {
log.Fatalf("Failed to get $PWD: %v", err)
}
if *configPath == "" {
*configPath = pwd + "/../../prow/config.yaml"
*configPath = pwd + "/../../config/prow/config.yaml"
}
if *jobsPath == "" {
*jobsPath = pwd + "/../"
Expand Down
2 changes: 1 addition & 1 deletion config/jobs/kubernetes/test-infra/janitors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ periodics:
- go
- run
- experiment/ci-janitor/main.go
- --config-path=prow/config.yaml
- --config-path=config/prow/config.yaml
- --job-config-path=config/jobs
- --janitor-path=boskos/janitor/gcp_janitor.py
image: gcr.io/k8s-testimages/kubekins-e2e:v20190917-d7c7545-master
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ presubmits:
- name: pull-test-infra-gubernator
branches:
- master
run_if_changed: 'gubernator|prow/config.yaml'
run_if_changed: 'gubernator|config/prow/config.yaml'
decorate: true
labels:
preset-service-account: "true"
Expand Down
2 changes: 1 addition & 1 deletion config/jobs/kubernetes/test-infra/test-infra-trusted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ periodics:
command:
- /app/prow/cmd/branchprotector/app.binary
args:
- --config-path=prow/config.yaml
- --config-path=config/prow/config.yaml
- --job-config-path=config/jobs
- --github-token-path=/etc/github/oauth
- --confirm
Expand Down
2 changes: 1 addition & 1 deletion config/pj-on-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -o nounset
set -o pipefail

root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
export CONFIG_PATH="${root}/prow/config.yaml"
export CONFIG_PATH="${root}/config/prow/config.yaml"
export JOB_CONFIG_PATH="${root}/config/jobs"

"${root}/prow/pj-on-kind.sh" "$@"
Expand Down
20 changes: 20 additions & 0 deletions config/prow/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package(default_visibility = ["//visibility:public"])

filegroup(
name = "configs",
srcs = glob(["*.yaml"]),
)

filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)

filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
File renamed without changes.
4 changes: 2 additions & 2 deletions prow/plugins.yaml → config/prow/plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ config_updater:
label_sync/labels.yaml:
name: label-config
namespace: test-pods
prow/config.yaml:
config/prow/config.yaml:
name: config
prow/plugins.yaml:
config/prow/plugins.yaml:
name: plugins
config/jobs/**/*.yaml:
name: job-config
Expand Down
2 changes: 1 addition & 1 deletion config/tests/jobs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go_test(
srcs = ["jobs_test.go"],
data = [
"//config:prowjobs",
"//config/prow:configs",
"//jobs",
"//prow:configs",
"//scenarios",
],
deps = [
Expand Down
2 changes: 1 addition & 1 deletion config/tests/jobs/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
cfg "k8s.io/test-infra/prow/config"
)

var configPath = flag.String("config", "../../../prow/config.yaml", "Path to prow config")
var configPath = flag.String("config", "../../../config/prow/config.yaml", "Path to prow config")
var jobConfigPath = flag.String("job-config", "../../jobs", "Path to prow job config")
var deckPath = flag.String("deck-path", "https://prow.k8s.io", "Path to deck")
var bucket = flag.String("bucket", "kubernetes-jenkins", "Gcs bucket for log upload")
Expand Down
8 changes: 4 additions & 4 deletions config/tests/testgrids/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ go_test(
srcs = ["config_test.go"],
args = [
"--config=$(location testconf.pb)",
"--prow-config=$(location //prow:config.yaml)",
"--prow-config=$(location //config/prow:config.yaml)",
"--job-config=config/jobs",
],
data = [
":testconf.pb",
"//config:prowjobs",
"//prow:config.yaml",
"//config/prow:config.yaml",
],
rundir = ".",
deps = [
Expand All @@ -27,12 +27,12 @@ genrule(
"//config:testgrids",
"//config:prowjobs",
"//config:testgrid_default",
"//prow:config.yaml",
"//config/prow:config.yaml",
],
outs = [":testconf.pb"],
cmd = "./$(location //testgrid/cmd/configurator) \
--yaml=config/testgrids \
--prow-config=$(location //prow:config.yaml) \
--prow-config=$(location //config/prow:config.yaml) \
--prow-job-config=config/jobs \
--default=$(location //config:testgrid_default) \
--output=$@ \
Expand Down
2 changes: 1 addition & 1 deletion config/tests/testgrids/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var (
}
)

var prowPath = flag.String("prow-config", "../../../prow/config.yaml", "Path to prow config")
var prowPath = flag.String("prow-config", "../../../config/prow/config.yaml", "Path to prow config")
var jobPath = flag.String("job-config", "../../jobs", "Path to prow job config")
var protoPath = flag.String("config", "", "Path to TestGrid config proto")

Expand Down
2 changes: 1 addition & 1 deletion experiment/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ py_binary(
"test_config.yaml",
"//config:prowjobs",
"//config:testgrids",
"//config/prow:configs",
"//jobs",
"//prow:configs",
],
python_version = "PY3",
deps = [requirement("ruamel.yaml")],
Expand Down
2 changes: 1 addition & 1 deletion experiment/bump_e2e_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -o pipefail

TREE="$(git rev-parse --show-toplevel)"

bazel run //experiment/image-bumper -- --image-regex gcr.io/k8s-testimages/kubekins-e2e "${TREE}/experiment/generate_tests.py" "${TREE}/experiment/test_config.yaml" "${TREE}/prow/config.yaml"
bazel run //experiment/image-bumper -- --image-regex gcr.io/k8s-testimages/kubekins-e2e "${TREE}/experiment/generate_tests.py" "${TREE}/experiment/test_config.yaml" "${TREE}/config/prow/config.yaml"
find "${TREE}/config/jobs/" . -name "*.yaml" | xargs bazel run //experiment/image-bumper -- --image-regex gcr.io/k8s-testimages/kubekins-e2e

bazel run //experiment:generate_tests -- \
Expand Down
4 changes: 2 additions & 2 deletions experiment/maintenance/recreate_configmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ def main():
parser.add_argument("--prow-configmap", default="config",
help="name of prow primary configmap")
parser.add_argument(
"--prow-config-path", default="prow/config.yaml",
"--prow-config-path", default="config/prow/config.yaml",
help="path to the primary prow config")
# plugins config
parser.add_argument("--plugins-configmap", default="plugins",
help="name of prow plugins configmap")
parser.add_argument(
"--plugins-config-path", default="prow/plugins.yaml",
"--plugins-config-path", default="config/prow/plugins.yaml",
help="path to the prow plugins config")
# wet or dry?
parser.add_argument("--wet", action="store_true")
Expand Down
2 changes: 1 addition & 1 deletion experiment/prepare_release_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

TEST_CONFIG_YAML = "experiment/test_config.yaml"
JOB_CONFIG = "config/jobs"
PROW_CONFIG = "prow/config.yaml"
PROW_CONFIG = "config/prow/config.yaml"
BRANCH_JOB_DIR = "config/jobs/kubernetes/sig-release/release-branch-jobs"
SECURITY_JOBS = "config/jobs/kubernetes-security/generated-security-jobs.yaml"

Expand Down
2 changes: 1 addition & 1 deletion gubernator/update_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# file to keep it in sync with Prow.

cd "$( dirname "${BASH_SOURCE[0]}" )"
./update_config.py ./../prow/config.yaml ./config.yaml
./update_config.py ./../config/prow/config.yaml ./config.yaml
2 changes: 1 addition & 1 deletion gubernator/verify_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ config="$( mktemp )"
trap "rm ${config}" EXIT

cp ./config.yaml "${config}"
./update_config.py ./../prow/config.yaml ./../config/jobs "${config}"
./update_config.py ./../config/prow/config.yaml ./../config/jobs "${config}"

if ! output="$( diff ./config.yaml "${config}" )"; then
echo "Gubernator configuration file is out of sync!"
Expand Down
12 changes: 6 additions & 6 deletions hack/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ genrule(
name = "generate-security-jobs",
srcs = [
"//config:all-srcs",
"//prow:config.yaml",
"//config/prow:config.yaml",
],
outs = ["zz.security-jobs.yaml"],
# $@ == expected location for zz.security-jobs.yaml
cmd = "./$(location //config/jobs/kubernetes-security:genjobs) --config=prow/config.yaml --jobs=config/jobs --output=\"$@\"",
cmd = "./$(location //config/jobs/kubernetes-security:genjobs) --config=config/prow/config.yaml --jobs=config/jobs --output=\"$@\"",
tools = ["//config/jobs/kubernetes-security:genjobs"],
)

Expand All @@ -361,16 +361,16 @@ sh_test(
srcs = ["verify-config.sh"],
args = [
"$(location //prow/cmd/checkconfig)",
"--config-path=prow/config.yaml",
"--config-path=config/prow/config.yaml",
"--job-config-path=config/jobs",
"--plugin-config=prow/plugins.yaml",
"--plugin-config=config/prow/plugins.yaml",
],
data = [
":zz.security-jobs.yaml",
"//config:all-srcs",
"//config/jobs/kubernetes-security:all-srcs",
"//prow:config.yaml",
"//prow:plugins.yaml",
"//config/prow:config.yaml",
"//config/prow:plugins.yaml",
"//prow/cmd/checkconfig",
],
tags = ["lint"],
Expand Down
2 changes: 1 addition & 1 deletion jenkins/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ py_test(
],
data = [
"//jobs",
"//prow:config.yaml",
"//config/prow:config.yaml",
] + glob(["fake/**"]),
python_version = "PY2",
tags = ["local"], # TODO(fejta): https://github.com/kubernetes/test-infra/issues/12195
Expand Down
5 changes: 0 additions & 5 deletions prow/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ prow_push(
),
)

filegroup(
name = "configs",
srcs = glob(["*.yaml"]),
)

filegroup(
name = "package-srcs",
srcs = glob(["**"]),
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/branchprotector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ job resource.

[`bazel`]: https://bazel.build
[`branch_protection.go`]: /prow/config/branch_protection.go
[`config.yaml`]: /prow/config.yaml
[`config.yaml`]: /config/prow/config.yaml
[github branch protection]: https://help.github.com/articles/about-protected-branches/
[`oneshot-job.yaml`]: oneshot-job.yaml
[`planter.sh`]: /planter
Expand Down
4 changes: 2 additions & 2 deletions prow/cmd/deck/github_oauth_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ When testing locally, pass the path to your secrets to `deck` using the `--githu

Run the command:

`go build . && ./deck --config-path=../../config.yaml --github-oauth-config-file=<PATH_TO_YOUR_GITHUB_OAUTH_SECRET> --cookie-secret=<PATH_TO_YOUR_COOKIE_SECRET> --oauth-url=/pr`
`go build . && ./deck --config-path=../../../config/prow/config.yaml --github-oauth-config-file=<PATH_TO_YOUR_GITHUB_OAUTH_SECRET> --cookie-secret=<PATH_TO_YOUR_COOKIE_SECRET> --oauth-url=/pr`

Or, if you'd like to use bazel, run the command:

`bazel run //prow/cmd/deck -- --config-path=/absoluate/path/to/config.yaml --github-oauth-config-file=<PATH_TO_YOUR_GITHUB_OAUTH_SECRET> --cookie-secret=<PATH_TO_YOUR_COOKIE_SECRET> --oauth-url=/pr`
`bazel run //prow/cmd/deck -- --config-path=/absolute/path/to/config.yaml --github-oauth-config-file=<PATH_TO_YOUR_GITHUB_OAUTH_SECRET> --cookie-secret=<PATH_TO_YOUR_COOKIE_SECRET> --oauth-url=/pr`

## Using a test cluster
If hosting your test instance on http instead of https, you will need to use the `--allow-insecure` flag in `deck`.
2 changes: 1 addition & 1 deletion prow/cmd/deck/runlocal
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ curl "${HOST}/tide.js?var=tideData" > tide.js
curl "${HOST}/tide-history.js?var=tideHistory" > tide-history.js
curl "${HOST}/plugin-help.js?var=allHelp" > plugin-help.js
curl "${HOST}/pr-data.js" > pr-data.js
bazel run //prow/cmd/deck:deck -- --pregenerated-data=${DIR}/localdata --static-files-location=./prow/cmd/deck/static --template-files-location=./prow/cmd/deck/template --spyglass-files-location=./prow/spyglass/lenses --config-path ${DIR}/../../config.yaml --spyglass
bazel run //prow/cmd/deck:deck -- --pregenerated-data=${DIR}/localdata --static-files-location=./prow/cmd/deck/static --template-files-location=./prow/cmd/deck/template --spyglass-files-location=./prow/spyglass/lenses --config-path ${DIR}/../../../config/prow/config.yaml --spyglass
4 changes: 2 additions & 2 deletions prow/cmd/hook/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ prow_image(
go_binary(
name = "hook",
data = [
"//prow:configs",
"//config/prow:configs",
],
embed = [":go_default_library"],
pure = "on",
Expand All @@ -22,7 +22,7 @@ go_test(
name = "go_default_test",
srcs = ["main_test.go"],
data = [
"//prow:configs",
"//config/prow:configs",
],
embed = [":go_default_library"],
deps = [
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/hook/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
// Make sure that our plugins are valid.
func TestPlugins(t *testing.T) {
pa := &plugins.ConfigAgent{}
if err := pa.Load("../../plugins.yaml"); err != nil {
if err := pa.Load("../../../config/prow/plugins.yaml"); err != nil {
t.Fatalf("Could not load plugins: %v.", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/peribolos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ See `bazel run //prow/cmd/peribolos -- --help` for the full and current list of



[`config.yaml`]: /prow/config.yaml
[`config.yaml`]: /config/prow/config.yaml
[edit team]: https://developer.github.com/v3/teams/#edit-team
[edit org]: https://developer.github.com/v3/orgs/#edit-an-organization
[peribolos]: https://en.wikipedia.org/wiki/Peribolos
Expand Down
4 changes: 2 additions & 2 deletions prow/cmd/phony/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ this:
```
go run prow/cmd/hook/main.go
--deck-url=<production deck URL>
--config-path=prow/config.yaml
--plugin-config=prow/plugins.yaml
--config-path=config/prow/config.yaml
--plugin-config=config/prow/plugins.yaml
--hmac-secret-file=path/to/hmac
-github-token-path=path/to/github-token
```
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/tide/config.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuring Tide

Configuration of Tide is located under the [prow/config.yaml](/prow/config.yaml) file. All configuration for merge behavior and criteria belongs in the `tide` yaml struct, but it may be necessary to also configure presubmits for Tide to run against PRs (see ['Configuring Presubmit Jobs'](#configuring-presubmit-jobs) below).
Configuration of Tide is located under the [config/prow/config.yaml](/config/prow/config.yaml) file. All configuration for merge behavior and criteria belongs in the `tide` yaml struct, but it may be necessary to also configure presubmits for Tide to run against PRs (see ['Configuring Presubmit Jobs'](#configuring-presubmit-jobs) below).

This document will describe the fields of the `tide` configuration and how to populate them, but you can also check out the [GoDocs](https://godoc.org/github.com/kubernetes/test-infra/prow/config#Tide) for the most up to date configuration specification.

Expand Down
Loading

0 comments on commit 9b609a9

Please sign in to comment.