Skip to content

Commit

Permalink
move top level go packages into pkg/
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTheElder committed Nov 8, 2018
1 parent 8a2dc0b commit 30b407a
Show file tree
Hide file tree
Showing 34 changed files with 36 additions and 31 deletions.
4 changes: 2 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ filegroup(
"//config:all-srcs",
"//def:all-srcs",
"//experiment:all-srcs",
"//flagutil:all-srcs",
"//gcsweb/cmd/gcsweb:all-srcs",
"//gcsweb/pkg/version:all-srcs",
"//ghclient:all-srcs",
"//ghproxy:all-srcs",
"//gopherage:all-srcs",
"//greenhouse:all-srcs",
Expand All @@ -96,6 +94,8 @@ filegroup(
"//maintenance/aws-janitor:all-srcs",
"//maintenance/migratestatus:all-srcs",
"//metrics:all-srcs",
"//pkg/flagutil:all-srcs",
"//pkg/ghclient:all-srcs",
"//prow:all-srcs",
"//robots/commenter:all-srcs",
"//robots/issue-creator:all-srcs",
Expand Down
2 changes: 1 addition & 1 deletion maintenance/migratestatus/migrator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ go_library(
srcs = ["migrator.go"],
importpath = "k8s.io/test-infra/maintenance/migratestatus/migrator",
deps = [
"//ghclient:go_default_library",
"//pkg/ghclient:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/google/go-github/github:go_default_library",
],
Expand Down
2 changes: 1 addition & 1 deletion maintenance/migratestatus/migrator/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package migrator
import (
"fmt"

"k8s.io/test-infra/ghclient"
"k8s.io/test-infra/pkg/ghclient"

"github.com/golang/glog"
"github.com/google/go-github/github"
Expand Down
3 changes: 3 additions & 0 deletions pkg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pkg

pkg/ contains common go packages used throughout test-infra
2 changes: 1 addition & 1 deletion flagutil/BUILD.bazel → pkg/flagutil/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["flagutil.go"],
importpath = "k8s.io/test-infra/flagutil",
importpath = "k8s.io/test-infra/pkg/flagutil",
visibility = ["//visibility:public"],
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ghclient/BUILD.bazel → pkg/ghclient/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ go_library(
"core.go",
"wrappers.go",
],
importpath = "k8s.io/test-infra/ghclient",
importpath = "k8s.io/test-infra/pkg/ghclient",
tags = ["automanaged"],
deps = [
"//vendor/github.com/golang/glog:go_default_library",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion prow/cmd/hook/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ go_library(
srcs = ["main.go"],
importpath = "k8s.io/test-infra/prow/cmd/hook",
deps = [
"//flagutil:go_default_library",
"//pkg/flagutil:go_default_library",
"//prow/config:go_default_library",
"//prow/flagutil:go_default_library",
"//prow/hook:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/hook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sirupsen/logrus"

"k8s.io/test-infra/flagutil"
"k8s.io/test-infra/pkg/flagutil"
"k8s.io/test-infra/prow/config"
prowflagutil "k8s.io/test-infra/prow/flagutil"
"k8s.io/test-infra/prow/hook"
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/jenkins-operator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ go_library(
],
importpath = "k8s.io/test-infra/prow/cmd/jenkins-operator",
deps = [
"//flagutil:go_default_library",
"//pkg/flagutil:go_default_library",
"//prow/config:go_default_library",
"//prow/flagutil:go_default_library",
"//prow/jenkins:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/jenkins-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/labels"

"k8s.io/test-infra/flagutil"
"k8s.io/test-infra/pkg/flagutil"
"k8s.io/test-infra/prow/config"
prowflagutil "k8s.io/test-infra/prow/flagutil"
"k8s.io/test-infra/prow/jenkins"
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/plank/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ go_library(
srcs = ["main.go"],
importpath = "k8s.io/test-infra/prow/cmd/plank",
deps = [
"//flagutil:go_default_library",
"//pkg/flagutil:go_default_library",
"//prow/config:go_default_library",
"//prow/flagutil:go_default_library",
"//prow/kube:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/plank/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/labels"

"k8s.io/test-infra/flagutil"
"k8s.io/test-infra/pkg/flagutil"
"k8s.io/test-infra/prow/config"
prowflagutil "k8s.io/test-infra/prow/flagutil"
"k8s.io/test-infra/prow/kube"
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/tide/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ go_library(
importpath = "k8s.io/test-infra/prow/cmd/tide",
visibility = ["//visibility:private"],
deps = [
"//flagutil:go_default_library",
"//pkg/flagutil:go_default_library",
"//prow/config:go_default_library",
"//prow/flagutil:go_default_library",
"//prow/logrusutil:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion prow/cmd/tide/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

"github.com/sirupsen/logrus"

flagutil "k8s.io/test-infra/flagutil"
"k8s.io/test-infra/pkg/flagutil"
"k8s.io/test-infra/prow/config"
prowflagutil "k8s.io/test-infra/prow/flagutil"
"k8s.io/test-infra/prow/logrusutil"
Expand Down
2 changes: 1 addition & 1 deletion prow/external-plugins/cherrypicker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ go_library(
importpath = "k8s.io/test-infra/prow/external-plugins/cherrypicker",
visibility = ["//visibility:private"],
deps = [
"//flagutil:go_default_library",
"//pkg/flagutil:go_default_library",
"//prow/config:go_default_library",
"//prow/flagutil:go_default_library",
"//prow/git:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion prow/external-plugins/cherrypicker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"github.com/sirupsen/logrus"

"k8s.io/test-infra/flagutil"
"k8s.io/test-infra/pkg/flagutil"
"k8s.io/test-infra/prow/config"
prowflagutil "k8s.io/test-infra/prow/flagutil"
"k8s.io/test-infra/prow/pluginhelp/externalplugins"
Expand Down
2 changes: 1 addition & 1 deletion prow/external-plugins/needs-rebase/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ go_library(
importpath = "k8s.io/test-infra/prow/external-plugins/needs-rebase",
visibility = ["//visibility:private"],
deps = [
"//flagutil:go_default_library",
"//pkg/flagutil:go_default_library",
"//prow/config:go_default_library",
"//prow/external-plugins/needs-rebase/plugin:go_default_library",
"//prow/flagutil:go_default_library",
Expand Down
3 changes: 2 additions & 1 deletion prow/external-plugins/needs-rebase/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ import (

"github.com/sirupsen/logrus"

"k8s.io/test-infra/flagutil"
"k8s.io/test-infra/pkg/flagutil"
"k8s.io/test-infra/prow/config"
"k8s.io/test-infra/prow/external-plugins/needs-rebase/plugin"
prowflagutil "k8s.io/test-infra/prow/flagutil"
"k8s.io/test-infra/prow/github"
"k8s.io/test-infra/prow/labels"

// TODO: Remove the need for this import; it's currently required to allow the plugin config loader to function correctly (it expects plugins to be initialised)
// See https://github.com/kubernetes/test-infra/pull/8933#issuecomment-411511180
_ "k8s.io/test-infra/prow/hook"
Expand Down
2 changes: 1 addition & 1 deletion prow/external-plugins/refresh/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ go_library(
importpath = "k8s.io/test-infra/prow/external-plugins/refresh",
visibility = ["//visibility:private"],
deps = [
"//flagutil:go_default_library",
"//pkg/flagutil:go_default_library",
"//prow/config:go_default_library",
"//prow/flagutil:go_default_library",
"//prow/github:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion prow/external-plugins/refresh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

"github.com/sirupsen/logrus"

"k8s.io/test-infra/flagutil"
"k8s.io/test-infra/pkg/flagutil"
"k8s.io/test-infra/prow/config"
prowflagutil "k8s.io/test-infra/prow/flagutil"
"k8s.io/test-infra/prow/pluginhelp/externalplugins"
Expand Down
2 changes: 1 addition & 1 deletion prow/flagutil/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ go_test(
name = "go_default_test",
srcs = ["kubernetes_test.go"],
embed = [":go_default_library"],
deps = ["//flagutil:go_default_library"],
deps = ["//pkg/flagutil:go_default_library"],
)
2 changes: 1 addition & 1 deletion prow/flagutil/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package flagutil
import (
"testing"

"k8s.io/test-infra/flagutil"
"k8s.io/test-infra/pkg/flagutil"
)

func TestKubernetesOptions_Validate(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion prow/githuboauth/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/test-infra/prow/githuboauth",
visibility = ["//visibility:public"],
deps = [
"//ghclient:go_default_library",
"//pkg/ghclient:go_default_library",
"//prow/config:go_default_library",
"//vendor/github.com/google/go-github/github:go_default_library",
"//vendor/github.com/sirupsen/logrus:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion prow/githuboauth/githuboauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"golang.org/x/net/xsrftoken"
"golang.org/x/oauth2"

"k8s.io/test-infra/ghclient"
"k8s.io/test-infra/pkg/ghclient"
"k8s.io/test-infra/prow/config"
)

Expand Down
4 changes: 2 additions & 2 deletions prow/prstatus/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/test-infra/prow/prstatus",
visibility = ["//visibility:public"],
deps = [
"//ghclient:go_default_library",
"//pkg/ghclient:go_default_library",
"//prow/config:go_default_library",
"//prow/github:go_default_library",
"//vendor/github.com/google/go-github/github:go_default_library",
Expand Down Expand Up @@ -35,7 +35,7 @@ go_test(
srcs = ["prstatus_test.go"],
embed = [":go_default_library"],
deps = [
"//ghclient:go_default_library",
"//pkg/ghclient:go_default_library",
"//prow/config:go_default_library",
"//prow/github:go_default_library",
"//vendor/github.com/ghodss/yaml:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion prow/prstatus/prstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/sirupsen/logrus"
"golang.org/x/oauth2"

"k8s.io/test-infra/ghclient"
"k8s.io/test-infra/pkg/ghclient"
"k8s.io/test-infra/prow/config"
"k8s.io/test-infra/prow/github"
)
Expand Down
5 changes: 3 additions & 2 deletions prow/prstatus/prstatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ package prstatus
import (
"context"
"encoding/gob"
"golang.org/x/oauth2"
"io/ioutil"
"net/http"
"net/http/httptest"
"reflect"
"testing"
"time"

"golang.org/x/oauth2"

"github.com/ghodss/yaml"
gogithub "github.com/google/go-github/github"
"github.com/gorilla/sessions"
"github.com/sirupsen/logrus"

"k8s.io/test-infra/ghclient"
"k8s.io/test-infra/pkg/ghclient"
"k8s.io/test-infra/prow/config"
"k8s.io/test-infra/prow/github"
)
Expand Down
2 changes: 1 addition & 1 deletion robots/issue-creator/creator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/test-infra/robots/issue-creator/creator",
visibility = ["//visibility:public"],
deps = [
"//ghclient:go_default_library",
"//pkg/ghclient:go_default_library",
"//robots/issue-creator/testowner:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/google/go-github/github:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion robots/issue-creator/creator/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"

"github.com/google/go-github/github"
"k8s.io/test-infra/ghclient"
"k8s.io/test-infra/pkg/ghclient"
"k8s.io/test-infra/robots/issue-creator/testowner"

"github.com/golang/glog"
Expand Down

0 comments on commit 30b407a

Please sign in to comment.