From aff544b22763894933dbd92b0d06c8f89e5d48b5 Mon Sep 17 00:00:00 2001 From: Zach Shepherd Date: Wed, 19 Sep 2018 15:09:10 -0700 Subject: [PATCH 1/8] Follow bash best practices in go-deps.sh Address warnings from shellcheck (e.g., properly quoting expressions and combining conditionals) to better follow bash best practices. Additionally, introduce our standard set line to catch errors earlier and conditionally provide debugging output. --- infra/scripts/go-deps.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/infra/scripts/go-deps.sh b/infra/scripts/go-deps.sh index 6b75700716..aa333b92a9 100755 --- a/infra/scripts/go-deps.sh +++ b/infra/scripts/go-deps.sh @@ -23,12 +23,13 @@ # If VIC_CACHE_DEPS environment variable is defined, this script will attempt to read # cached dependencies from disk if those exist. If they are not cached, dependencies will be # regenerated and cached. +set -e -o pipefail +h && [ -n "$DEBUG" ] && set -x cache_dir=.godeps_cache -pkg=$1 -flags=$2 -cachedname=`echo .$1.godeps_cache | sed 's/\//_/g'` +pkg="$1" +flags="$2" +cachedname=$(echo ".$1.godeps_cache" | sed 's/\//_/g') if [ -d "$pkg" ]; then @@ -37,9 +38,9 @@ if [ -d "$pkg" ]; then echo "Generating deps for $pkg" >&2 fi - mkdir -p $cache_dir + mkdir -p "$cache_dir" # generate the cache if not present or if not using the cached result - if [ -z "$VIC_CACHE_DEPS" -o ! -f $cache_dir/$cachedname ]; then + if [ -z "$VIC_CACHE_DEPS" ] || [ ! -f "$cache_dir/$cachedname" ]; then go list -f '{{join .Deps "\n"}}' github.com/vmware/vic/"$pkg" 2>/dev/null | \ xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' 2>/dev/null | \ sed -e 's:github.com/vmware/vic/\(.*\)$:\1/*:' > "$cache_dir/$cachedname" From 6bb2ff7aab227465ef0611c7bd030848483313ef Mon Sep 17 00:00:00 2001 From: Zach Shepherd Date: Wed, 19 Sep 2018 16:28:36 -0700 Subject: [PATCH 2/8] Introduce script to enforce dependency rules Introduce a script to enforce rules about dependency relationships between packages in the project. This script leverages the existing go-deps.sh script, including its caching logic (enabled by setting VIC_CACHE_DEPS). --- infra/scripts/go-deps-enforcement.sh | 109 +++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100755 infra/scripts/go-deps-enforcement.sh diff --git a/infra/scripts/go-deps-enforcement.sh b/infra/scripts/go-deps-enforcement.sh new file mode 100755 index 0000000000..396e08488f --- /dev/null +++ b/infra/scripts/go-deps-enforcement.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# Copyright 2018 VMware, Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e -o pipefail +h && [ -n "$DEBUG" ] && set -x + +IFS=$'\n' + +ENFORCE=('cmd/' 'lib/' 'pkg/') +RULES_FILE=.godeps_rules + +# Returns a list of all packages under the supplied list of directories +# Arguments +# *: directories to search under +# +# Returns: +# go packages under those directories +find-packages () { + find "${@}" -type f -name '*.go' -exec dirname {} \; | sort --unique +} + +# Returns the path to the "nearest" rule file for a given package +# Arguments +# 1: package path +# +# Returns: +# path to rule file (defaulting to /dev/null) +find-rule () { + path="${1?Package path must be provided}" + shift + + while [[ "$path" != "." ]]; do + if [ -e "$path/$RULES_FILE" ]; then + echo "$path/$RULES_FILE" + return + fi + + path="$(dirname "$path")" + done + + echo /dev/null +} + +# Returns the rules from the specified rules file, omitting comments +# Arguments +# 1: path to rules file +# +# Returns: +# contents of the file, excluding blank lines and lines beginning with "#" +get-rules () { + rules="${1?Rules file must be provided}" + shift + + grep -v -e '^$' -e '^#' "$rules" +} + +# Returns all dependencies for a given package +# Arguments +# 1: package path +# +# Returns: +# a list of direct and transitive dependencies +get-deps () { + package="${1?Package must be provided}" + shift + + infra/scripts/go-deps.sh "$package" +} + +# Returns any invalid dependencies for a given package by filtering the full set +# of dependencies based on the supplied rules +# Arguments +# 1: package path +# 2: path to rules file +# +# Returns: +# a list of invalid dependencies +filter-deps () { + package="${1?Package must be provided}" + rules="${2?Rules file must be provided}" + shift 2 + + get-deps "$package" | grep -v -e "^$package/*" -f <(get-rules "$rules") || true +} + +rc=0 +for package in $(find-packages "${ENFORCE[@]}"); do + rules="$(find-rule "$package")" + invalid=$(filter-deps "$package" "$rules") + if [ ! -z "$invalid" ]; then + echo "Unexpected dependencies in $package:" + echo "${invalid//^/ /}" + echo "See $rules for details." + echo "" + rc=1 + fi +done + +exit $rc From 96f14be31d904b95fabbad5d022f21c21bc6c8f6 Mon Sep 17 00:00:00 2001 From: Zach Shepherd Date: Wed, 19 Sep 2018 16:46:14 -0700 Subject: [PATCH 3/8] Define initial dependency enforcement rules Define an initial set of dependency enforcement rules based on the current state of the codebase. Some problematic relationships were identified and annotated. --- cmd/.godeps_rules | 4 ++ cmd/vic-machine-server/.godeps_rules | 9 +++++ cmd/vic-machine/.godeps_rules | 7 ++++ cmd/vic-machine/inspect/.godeps_rules | 12 ++++++ cmd/vicadmin/.godeps_rules | 7 ++++ lib/.godeps_rules | 3 ++ lib/apiservers/engine/.godeps_rules | 32 +++++++++++++++ .../engine/backends/middleware/.godeps_rules | 40 +++++++++++++++++++ lib/apiservers/portlayer/client/.godeps_rules | 7 ++++ .../portlayer/restapi/.godeps_rules | 26 ++++++++++++ .../restapi/operations/.godeps_rules | 7 ++++ lib/apiservers/service/restapi/.godeps_rules | 30 ++++++++++++++ .../service/restapi/operations/.godeps_rules | 7 ++++ lib/config/.godeps_rules | 9 +++++ lib/constants/.godeps_rules | 7 ++++ lib/dhcp/client/.godeps_rules | 11 +++++ lib/dns/.godeps_rules | 15 +++++++ lib/guest/.godeps_rules | 13 ++++++ lib/imagec/.godeps_rules | 13 ++++++ lib/install/.godeps_rules | 9 +++++ lib/install/data/.godeps_rules | 12 ++++++ lib/install/management/.godeps_rules | 30 ++++++++++++++ lib/install/validate/.godeps_rules | 19 +++++++++ lib/migration/.godeps_rules | 7 ++++ lib/migration/manager/.godeps_rules | 11 +++++ lib/migration/plugins/.godeps_rules | 12 ++++++ lib/migration/samples/.godeps_rules | 13 ++++++ lib/portlayer/.godeps_rules | 28 +++++++++++++ lib/portlayer/storage/.godeps_rules | 31 ++++++++++++++ lib/pprof/.godeps_rules | 9 +++++ lib/spec/.godeps_rules | 10 +++++ lib/system/.godeps_rules | 7 ++++ lib/tether/.godeps_rules | 16 ++++++++ lib/vicadmin/.godeps_rules | 20 ++++++++++ lib/vspc/.godeps_rules | 9 +++++ pkg/.godeps_rules | 3 ++ pkg/fetcher/.godeps_rules | 7 ++++ pkg/kvstore/.godeps_rules | 9 +++++ pkg/logmgr/.godeps_rules | 16 ++++++++ pkg/registry/.godeps_rules | 7 ++++ pkg/version/.godeps_rules | 7 ++++ pkg/vsphere/.godeps_rules | 9 +++++ pkg/vsphere/test/.godeps_rules | 13 ++++++ 43 files changed, 573 insertions(+) create mode 100644 cmd/.godeps_rules create mode 100644 cmd/vic-machine-server/.godeps_rules create mode 100644 cmd/vic-machine/.godeps_rules create mode 100644 cmd/vic-machine/inspect/.godeps_rules create mode 100644 cmd/vicadmin/.godeps_rules create mode 100644 lib/.godeps_rules create mode 100644 lib/apiservers/engine/.godeps_rules create mode 100644 lib/apiservers/engine/backends/middleware/.godeps_rules create mode 100644 lib/apiservers/portlayer/client/.godeps_rules create mode 100644 lib/apiservers/portlayer/restapi/.godeps_rules create mode 100644 lib/apiservers/portlayer/restapi/operations/.godeps_rules create mode 100644 lib/apiservers/service/restapi/.godeps_rules create mode 100644 lib/apiservers/service/restapi/operations/.godeps_rules create mode 100644 lib/config/.godeps_rules create mode 100644 lib/constants/.godeps_rules create mode 100644 lib/dhcp/client/.godeps_rules create mode 100644 lib/dns/.godeps_rules create mode 100644 lib/guest/.godeps_rules create mode 100644 lib/imagec/.godeps_rules create mode 100644 lib/install/.godeps_rules create mode 100644 lib/install/data/.godeps_rules create mode 100644 lib/install/management/.godeps_rules create mode 100644 lib/install/validate/.godeps_rules create mode 100644 lib/migration/.godeps_rules create mode 100644 lib/migration/manager/.godeps_rules create mode 100644 lib/migration/plugins/.godeps_rules create mode 100644 lib/migration/samples/.godeps_rules create mode 100644 lib/portlayer/.godeps_rules create mode 100644 lib/portlayer/storage/.godeps_rules create mode 100644 lib/pprof/.godeps_rules create mode 100644 lib/spec/.godeps_rules create mode 100644 lib/system/.godeps_rules create mode 100644 lib/tether/.godeps_rules create mode 100644 lib/vicadmin/.godeps_rules create mode 100644 lib/vspc/.godeps_rules create mode 100644 pkg/.godeps_rules create mode 100644 pkg/fetcher/.godeps_rules create mode 100644 pkg/kvstore/.godeps_rules create mode 100644 pkg/logmgr/.godeps_rules create mode 100644 pkg/registry/.godeps_rules create mode 100644 pkg/version/.godeps_rules create mode 100644 pkg/vsphere/.godeps_rules create mode 100644 pkg/vsphere/test/.godeps_rules diff --git a/cmd/.godeps_rules b/cmd/.godeps_rules new file mode 100644 index 0000000000..e3d7f4f662 --- /dev/null +++ b/cmd/.godeps_rules @@ -0,0 +1,4 @@ +# By default, packages in cmd should depend only on packages under lib, pkg or vendor +^lib/* +^pkg/* +^vendor/* diff --git a/cmd/vic-machine-server/.godeps_rules b/cmd/vic-machine-server/.godeps_rules new file mode 100644 index 0000000000..b79281465f --- /dev/null +++ b/cmd/vic-machine-server/.godeps_rules @@ -0,0 +1,9 @@ +# By default, packages in cmd should depend only on packages under lib, pkg or vendor +^lib/* +^pkg/* +^vendor/* + +# BAD: vic-machine-server currently depends on vic-machine code, but should not +^cmd/vic-machine/common/* +^cmd/vic-machine/create/* + diff --git a/cmd/vic-machine/.godeps_rules b/cmd/vic-machine/.godeps_rules new file mode 100644 index 0000000000..900e9ba7de --- /dev/null +++ b/cmd/vic-machine/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in cmd should depend only on packages under lib, pkg or vendor +^lib/* +^pkg/* +^vendor/* + +# vic-machine packages can also depend on common vic-machine code +^cmd/vic-machine/common/* diff --git a/cmd/vic-machine/inspect/.godeps_rules b/cmd/vic-machine/inspect/.godeps_rules new file mode 100644 index 0000000000..522eedba79 --- /dev/null +++ b/cmd/vic-machine/inspect/.godeps_rules @@ -0,0 +1,12 @@ +# By default, packages in cmd should depend only on packages under lib, pkg or vendor +^lib/* +^pkg/* +^vendor/* + +# vic-machine packages can also depend on common vic-machine code +^cmd/vic-machine/common/* + +# BAD: vic-machine inspect currently depends on sibling commands, but should not +^cmd/vic-machine/converter/* +^cmd/vic-machine/create/* + diff --git a/cmd/vicadmin/.godeps_rules b/cmd/vicadmin/.godeps_rules new file mode 100644 index 0000000000..10f727b310 --- /dev/null +++ b/cmd/vicadmin/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in cmd should depend only on packages under lib, pkg or vendor +^lib/* +^pkg/* +^vendor/* + +# BAD: vicadmin currently depends on vic-machine code, but should not +^cmd/vic-machine/common/* diff --git a/lib/.godeps_rules b/lib/.godeps_rules new file mode 100644 index 0000000000..0de11e32fa --- /dev/null +++ b/lib/.godeps_rules @@ -0,0 +1,3 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* diff --git a/lib/apiservers/engine/.godeps_rules b/lib/apiservers/engine/.godeps_rules new file mode 100644 index 0000000000..fb3bd829ca --- /dev/null +++ b/lib/apiservers/engine/.godeps_rules @@ -0,0 +1,32 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/apiservers/engine subpackages can depend on other subpackages +^lib/apiservers/engine/* + +# lib/apiservers/engine acts as a client of the portlayer API +^lib/apiservers/portlayer/client/* +^lib/apiservers/portlayer/models/* + +# lib/apiservers/engine also depends on portlayer utilities and events +^lib/portlayer/util/* +^lib/portlayer/event/events/* + +# lib/apiservers/engine also depends on other lib packages +^lib/archive/* +^lib/config/* +^lib/constants/* +^lib/imagec/* +^lib/iolog/* +^lib/metadata/* +^lib/migration/* +^lib/spec/* +^lib/tether/shared/* + +# lib/tether/shared also depends on lib/system +^lib/system/* + +# lib/system also depends on lib/etcconf +^lib/etcconf/* + diff --git a/lib/apiservers/engine/backends/middleware/.godeps_rules b/lib/apiservers/engine/backends/middleware/.godeps_rules new file mode 100644 index 0000000000..6ee90d46b0 --- /dev/null +++ b/lib/apiservers/engine/backends/middleware/.godeps_rules @@ -0,0 +1,40 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/apiservers/engine subpackages can depend on other subpackages +^lib/apiservers/engine/* + +# lib/apiservers/engine acts as a client of the portlayer API +^lib/apiservers/portlayer/client/* +^lib/apiservers/portlayer/models/* + +# lib/apiservers/engine also depends on portlayer utilities and events +^lib/portlayer/util/* +^lib/portlayer/event/events/* + +# lib/apiservers/engine also depends on other lib packages +^lib/archive/* +^lib/config/* +^lib/constants/* +^lib/imagec/* +^lib/iolog/* +^lib/metadata/* +^lib/migration/* +^lib/spec/* +^lib/tether/shared/* + +# lib/tether/shared also depends on lib/system +^lib/system/* + +# lib/system also depends on lib/etcconf +^lib/etcconf/* + +# BAD: lib/apiservers/engine/backends/middleware depends on lib/dns, which in turn +# depends on a variety of code from the portlayer +^lib/dns/* +^lib/portlayer/event/* +^lib/portlayer/exec/* +^lib/portlayer/network/* +^lib/portlayer/store/* +^lib/guest/* diff --git a/lib/apiservers/portlayer/client/.godeps_rules b/lib/apiservers/portlayer/client/.godeps_rules new file mode 100644 index 0000000000..91b38bacbe --- /dev/null +++ b/lib/apiservers/portlayer/client/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# portlayer API client may reference portlayer API model objects +^lib/apiservers/portlayer/models/* + diff --git a/lib/apiservers/portlayer/restapi/.godeps_rules b/lib/apiservers/portlayer/restapi/.godeps_rules new file mode 100644 index 0000000000..70cf94b0b7 --- /dev/null +++ b/lib/apiservers/portlayer/restapi/.godeps_rules @@ -0,0 +1,26 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/apiservers/portlayer/restapi depends on several other lib packages +^lib/apiservers/portlayer/models/* +^lib/apiservers/portlayer/restapi/operations/* +^lib/archive/* +^lib/config/* +^lib/constants/* +^lib/iolog/* +^lib/migration/* +^lib/portlayer/* +^lib/tether/shared/* + +# lib/portlayer also depends on several other lib packages +^lib/guest/* +^lib/spec/* +^lib/tether/msgs/* + +# lib/tether/shared also depends on lib/system +^lib/system/* + +# lib/system also depends on lib/etcconf +^lib/etcconf/* + diff --git a/lib/apiservers/portlayer/restapi/operations/.godeps_rules b/lib/apiservers/portlayer/restapi/operations/.godeps_rules new file mode 100644 index 0000000000..c2458b2279 --- /dev/null +++ b/lib/apiservers/portlayer/restapi/operations/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# portlayer API operations may reference portlayer API model objects +^lib/apiservers/portlayer/models/* + diff --git a/lib/apiservers/service/restapi/.godeps_rules b/lib/apiservers/service/restapi/.godeps_rules new file mode 100644 index 0000000000..88da32250f --- /dev/null +++ b/lib/apiservers/service/restapi/.godeps_rules @@ -0,0 +1,30 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/apiservers/service and handler code can depend on models, operations, and +# utility subpackages +^lib/apiservers/service/models/* +^lib/apiservers/service/restapi/operations/* +^lib/apiservers/service/restapi/handlers/client/* +^lib/apiservers/service/restapi/handlers/errors/* + +# lib/apiservers/service depends on lib/install and its subpackages +^lib/install/* + +# lib/apiservers/service also depends on lib packages +^lib/config/* +^lib/constants/* + +# lib/install/* also depends on lib packages +^lib/etcconf/* +^lib/migration/* +^lib/portlayer/util/* +^lib/spec/* +^lib/system/* +^lib/tether/shared/* + +# BAD: lib/apiservers/service handlers depend on code from vic-machine +^cmd/vic-machine/common/* +^cmd/vic-machine/create/* + diff --git a/lib/apiservers/service/restapi/operations/.godeps_rules b/lib/apiservers/service/restapi/operations/.godeps_rules new file mode 100644 index 0000000000..be4fd7916c --- /dev/null +++ b/lib/apiservers/service/restapi/operations/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# service API operations may reference service API model objects +^lib/apiservers/service/models/* + diff --git a/lib/config/.godeps_rules b/lib/config/.godeps_rules new file mode 100644 index 0000000000..04e81f1de8 --- /dev/null +++ b/lib/config/.godeps_rules @@ -0,0 +1,9 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/config subpackages can depend on each other +^lib/config/* + +# BAD: lib/config depends on pkg/version, which depends on lib/migration/feature +^lib/migration/feature/* diff --git a/lib/constants/.godeps_rules b/lib/constants/.godeps_rules new file mode 100644 index 0000000000..878a8d3eec --- /dev/null +++ b/lib/constants/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# BAD: lib/constants depends on pkg/version, which depends on lib/migration/feature +^lib/migration/feature/* + diff --git a/lib/dhcp/client/.godeps_rules b/lib/dhcp/client/.godeps_rules new file mode 100644 index 0000000000..3a31331c96 --- /dev/null +++ b/lib/dhcp/client/.godeps_rules @@ -0,0 +1,11 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/dhcp/client can depend on +^lib/dhcp/* +^lib/system/* + +# lib/system depends on lib/etcconf +^lib/etcconf/* + diff --git a/lib/dns/.godeps_rules b/lib/dns/.godeps_rules new file mode 100644 index 0000000000..31b69604fc --- /dev/null +++ b/lib/dns/.godeps_rules @@ -0,0 +1,15 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/dns depends on several other lib packages +^lib/config/* +^lib/constants/* +^lib/etcconf/* +^lib/guest/* +^lib/iolog/* +^lib/migration/* +^lib/portlayer/* +^lib/spec/* +^lib/system/* +^lib/tether/shared/* diff --git a/lib/guest/.godeps_rules b/lib/guest/.godeps_rules new file mode 100644 index 0000000000..9ef681d113 --- /dev/null +++ b/lib/guest/.godeps_rules @@ -0,0 +1,13 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/guest depends on several other lib packages +^lib/constants/* +^lib/spec/* + +# lib/spec in turn depends on +^lib/config/* + +# BAD: pkg/version depends on lib/migration/feature +^lib/migration/feature/* diff --git a/lib/imagec/.godeps_rules b/lib/imagec/.godeps_rules new file mode 100644 index 0000000000..b738310fe1 --- /dev/null +++ b/lib/imagec/.godeps_rules @@ -0,0 +1,13 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/imagec depends on several other lib packages +^lib/apiservers/engine/backends/* +^lib/apiservers/portlayer/client/* +^lib/apiservers/portlayer/models/* +^lib/constants/* +^lib/metadata/* + +# BAD: pkg/version depends on lib/migration/feature +^lib/migration/feature/* diff --git a/lib/install/.godeps_rules b/lib/install/.godeps_rules new file mode 100644 index 0000000000..34610c6414 --- /dev/null +++ b/lib/install/.godeps_rules @@ -0,0 +1,9 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# All lib/install sub-packages can depend on lib/config (which in turn depends on lib/migration/feature) +^lib/config/* +^lib/config/executor/* +^lib/migration/feature/* + diff --git a/lib/install/data/.godeps_rules b/lib/install/data/.godeps_rules new file mode 100644 index 0000000000..9584e8ea65 --- /dev/null +++ b/lib/install/data/.godeps_rules @@ -0,0 +1,12 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# All lib/install sub-packages can depend on lib/config (which in turn depends on lib/migration/feature) +^lib/config/* +^lib/config/executor/* +^lib/migration/feature/* + +# BAD: lib/install/data also depends on code from cmd/vic-machine/common, but it should not +^cmd/vic-machine/common/* + diff --git a/lib/install/management/.godeps_rules b/lib/install/management/.godeps_rules new file mode 100644 index 0000000000..9d33d3ab23 --- /dev/null +++ b/lib/install/management/.godeps_rules @@ -0,0 +1,30 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# All lib/install sub-packages can depend on lib/config (which in turn depends on lib/migration/feature) +^lib/config/* +^lib/config/executor/* +^lib/migration/feature/* + +# lib/install/management also depends on other libraries +^lib/constants/* +^lib/etcconf/* +^lib/migration/* +^lib/spec/* +^lib/system/* + +# lib/install/management also depends on other lib/install sub-packages +^lib/install/data/* +^lib/install/opsuser/* +^lib/install/validate/* +^lib/install/vchlog/* + +# QUESTIONABLE: lib/install/management also depends on portlayer utilities +lib/portlayer/util/* + +# QUESTIONABLE: lib/install/management also depends on the shared tether sub-package +lib/tether/shared/* + +# BAD: lib/install/management also depends on code from cmd/vic-machine/common, but it should not +^cmd/vic-machine/common/* diff --git a/lib/install/validate/.godeps_rules b/lib/install/validate/.godeps_rules new file mode 100644 index 0000000000..e1937ced36 --- /dev/null +++ b/lib/install/validate/.godeps_rules @@ -0,0 +1,19 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# All lib/install sub-packages can depend on lib/config (which in turn depends on lib/migration/feature) +^lib/config/* +^lib/config/executor/* +^lib/migration/feature/* + +# lib/install/validate also depends on lib/constants +^lib/constants/* + +# lib/install/validate also depends on other lib/install subpackages +^lib/install/data/* +^lib/install/opsuser/* + +# BAD: lib/install/validate also depends on code from cmd/vic-machine/common, but it should not +^cmd/vic-machine/common/* + diff --git a/lib/migration/.godeps_rules b/lib/migration/.godeps_rules new file mode 100644 index 0000000000..8ee3f7e6db --- /dev/null +++ b/lib/migration/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/migration also depends on lib/config +^lib/config/* + diff --git a/lib/migration/manager/.godeps_rules b/lib/migration/manager/.godeps_rules new file mode 100644 index 0000000000..7a4e65b5c4 --- /dev/null +++ b/lib/migration/manager/.godeps_rules @@ -0,0 +1,11 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/migration also depends on lib/config +^lib/config/* + +# lib/migration/manager also depends other lib/migration sub-packages +^lib/migration/errors/* +^lib/migration/feature/* + diff --git a/lib/migration/plugins/.godeps_rules b/lib/migration/plugins/.godeps_rules new file mode 100644 index 0000000000..78958f0e37 --- /dev/null +++ b/lib/migration/plugins/.godeps_rules @@ -0,0 +1,12 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/migration also depends on lib/config +^lib/config/* + +# lib/migration/plugins also depend other lib/migration sub-packages +^lib/migration/errors/* +^lib/migration/feature/* +^lib/migration/manager/* + diff --git a/lib/migration/samples/.godeps_rules b/lib/migration/samples/.godeps_rules new file mode 100644 index 0000000000..4a89d68feb --- /dev/null +++ b/lib/migration/samples/.godeps_rules @@ -0,0 +1,13 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/migration also depends on lib/config +^lib/config/* + +# lib/migration/samples also depend other lib/migration sub-packages +^lib/migration/errors/* +^lib/migration/feature/* +^lib/migration/manager/* +^lib/migration/samples/* + diff --git a/lib/portlayer/.godeps_rules b/lib/portlayer/.godeps_rules new file mode 100644 index 0000000000..f2ad652206 --- /dev/null +++ b/lib/portlayer/.godeps_rules @@ -0,0 +1,28 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/portlayer depends on several other lib packages +^lib/archive/* +^lib/config/* +^lib/constants/* +^lib/guest/* +^lib/iolog/* +^lib/migration/* +^lib/spec/* +^lib/tether/msgs/* +^lib/tether/shared/* + +# lib/tether/shared also depends on lib/system +^lib/system/* + +# lib/system also depends on lib/etcconf +^lib/etcconf/* + +# lib/portlayer subpackages should generally not depend on one another, but +# event, exec, store, and util are valid dependencies for other sub-packages +^lib/portlayer/event/* +^lib/portlayer/exec/* +^lib/portlayer/store/* +^lib/portlayer/util/* + diff --git a/lib/portlayer/storage/.godeps_rules b/lib/portlayer/storage/.godeps_rules new file mode 100644 index 0000000000..1f0e1f1f4d --- /dev/null +++ b/lib/portlayer/storage/.godeps_rules @@ -0,0 +1,31 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/portlayer depends on several other lib packages +^lib/archive/* +^lib/config/* +^lib/constants/* +^lib/guest/* +^lib/iolog/* +^lib/migration/* +^lib/spec/* +^lib/tether/msgs/* +^lib/tether/shared/* + +# lib/tether/shared also depends on lib/system +^lib/system/* + +# lib/system also depends on lib/etcconf +^lib/etcconf/* + +# lib/portlayer subpackages should generally not depend on one another, but +# event, exec, store, and util are valid dependencies for other sub-packages +^lib/portlayer/event/* +^lib/portlayer/exec/* +^lib/portlayer/store/* +^lib/portlayer/util/* + +# lib/portlayer/storage subpackages can depend on lib/portlayer/storage +^lib/portlayer/storage/* + diff --git a/lib/pprof/.godeps_rules b/lib/pprof/.godeps_rules new file mode 100644 index 0000000000..7d073e7c0f --- /dev/null +++ b/lib/pprof/.godeps_rules @@ -0,0 +1,9 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/pprof also depends on lib/config +^lib/config/* + +# BAD: pkg/version depends on lib/migration/feature +^lib/migration/feature/* diff --git a/lib/spec/.godeps_rules b/lib/spec/.godeps_rules new file mode 100644 index 0000000000..159f9722da --- /dev/null +++ b/lib/spec/.godeps_rules @@ -0,0 +1,10 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/spec also depends on lib/config and lib/constants +^lib/config/* +^lib/constants/* + +# BAD: pkg/version depends on lib/migration/feature +^lib/migration/feature/* diff --git a/lib/system/.godeps_rules b/lib/system/.godeps_rules new file mode 100644 index 0000000000..b8fe48e73e --- /dev/null +++ b/lib/system/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# lib/system can depend on lib/etcconf +^lib/etcconf/* + diff --git a/lib/tether/.godeps_rules b/lib/tether/.godeps_rules new file mode 100644 index 0000000000..619195ec9b --- /dev/null +++ b/lib/tether/.godeps_rules @@ -0,0 +1,16 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# Tether subpackages can depend on each other +^lib/tether/* + +# Tether can also depend on the following libraries +^lib/archive/* +^lib/config/executor/* +^lib/dhcp/* +^lib/etcconf/* +^lib/system/* + +# BAD: Test code depends on lib/migration/feature for the same reason as pkg/version +^lib/migration/feature/* diff --git a/lib/vicadmin/.godeps_rules b/lib/vicadmin/.godeps_rules new file mode 100644 index 0000000000..dfdf3ba4cc --- /dev/null +++ b/lib/vicadmin/.godeps_rules @@ -0,0 +1,20 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# vicadmin also depends on lib/config, lib/guest, lib/install/validate, lib/tether/shared and their transitive dependencies +^lib/config/* +^lib/constants/* +^lib/etcconf/* +^lib/guest/* +^lib/install/* +^lib/spec/* +^lib/system/* +^lib/tether/shared/* + +# BAD: pkg/version depends on lib/migration/feature +^lib/migration/feature/* + +# BAD: vicadmin currently depends on code from cmd/vic-machine/common, but it should not +^cmd/vic-machine/common/* + diff --git a/lib/vspc/.godeps_rules b/lib/vspc/.godeps_rules new file mode 100644 index 0000000000..65defcc46f --- /dev/null +++ b/lib/vspc/.godeps_rules @@ -0,0 +1,9 @@ +# By default, packages in lib should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# vspc also depends on lib/constants +^lib/constants/* + +# BAD: pkg/version depends on lib/migration/feature +^lib/migration/feature/* diff --git a/pkg/.godeps_rules b/pkg/.godeps_rules new file mode 100644 index 0000000000..2fb38ca6b3 --- /dev/null +++ b/pkg/.godeps_rules @@ -0,0 +1,3 @@ +# By default, packages in pkg should depend only on packages under pkg or vendor +^pkg/* +^vendor/* diff --git a/pkg/fetcher/.godeps_rules b/pkg/fetcher/.godeps_rules new file mode 100644 index 0000000000..b9c250524e --- /dev/null +++ b/pkg/fetcher/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in pkg should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not +^lib/migration/feature/* + diff --git a/pkg/kvstore/.godeps_rules b/pkg/kvstore/.godeps_rules new file mode 100644 index 0000000000..06af92d260 --- /dev/null +++ b/pkg/kvstore/.godeps_rules @@ -0,0 +1,9 @@ +# By default, packages in pkg should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# BAD: pkg/vsphere/session/session.go currently depends on lib/config, but should not +^lib/config/* +^lib/config/executor/* +^lib/migration/feature/* + diff --git a/pkg/logmgr/.godeps_rules b/pkg/logmgr/.godeps_rules new file mode 100644 index 0000000000..7cc96cc34f --- /dev/null +++ b/pkg/logmgr/.godeps_rules @@ -0,0 +1,16 @@ +# By default, packages in pkg should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# BAD: logmgr depends on tether, but it should not +^lib/archive/* +^lib/config/executor/* +^lib/dhcp/* +^lib/dhcp/client/* +^lib/etcconf/* +^lib/migration/feature/* +^lib/system/* +^lib/tether/* +^lib/tether/msgs/* +^lib/tether/shared/* + diff --git a/pkg/registry/.godeps_rules b/pkg/registry/.godeps_rules new file mode 100644 index 0000000000..b9c250524e --- /dev/null +++ b/pkg/registry/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in pkg should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not +^lib/migration/feature/* + diff --git a/pkg/version/.godeps_rules b/pkg/version/.godeps_rules new file mode 100644 index 0000000000..b9c250524e --- /dev/null +++ b/pkg/version/.godeps_rules @@ -0,0 +1,7 @@ +# By default, packages in pkg should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not +^lib/migration/feature/* + diff --git a/pkg/vsphere/.godeps_rules b/pkg/vsphere/.godeps_rules new file mode 100644 index 0000000000..06af92d260 --- /dev/null +++ b/pkg/vsphere/.godeps_rules @@ -0,0 +1,9 @@ +# By default, packages in pkg should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# BAD: pkg/vsphere/session/session.go currently depends on lib/config, but should not +^lib/config/* +^lib/config/executor/* +^lib/migration/feature/* + diff --git a/pkg/vsphere/test/.godeps_rules b/pkg/vsphere/test/.godeps_rules new file mode 100644 index 0000000000..44d39c3daa --- /dev/null +++ b/pkg/vsphere/test/.godeps_rules @@ -0,0 +1,13 @@ +# By default, packages in pkg should depend only on packages under pkg or vendor +^pkg/* +^vendor/* + +# BAD: pkg/vsphere/session/session.go currently depends on lib/config, but should not +^lib/config/* +^lib/config/executor/* +^lib/migration/feature/* + +# BAD: pkg/vsphere/test/test.go currently depends on lib/spec, but should not +^lib/constants/* +^lib/spec/* + From c024d319195aa54a8b5646131872de7b30375618 Mon Sep 17 00:00:00 2001 From: Zach Shepherd Date: Fri, 21 Sep 2018 20:23:26 -0700 Subject: [PATCH 4/8] Avoid removing rules files during cleanup --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 72c5bafe9a..9b224cd92c 100644 --- a/Makefile +++ b/Makefile @@ -478,10 +478,10 @@ clean: cleandeps @rm -f ./lib/apiservers/portlayer/restapi/doc.go @rm -f ./lib/apiservers/portlayer/restapi/embedded_spec.go @rm -f ./lib/apiservers/portlayer/restapi/server.go - @rm -rf ./lib/apiservers/portlayer/client/ - @rm -rf ./lib/apiservers/portlayer/cmd/ - @rm -rf ./lib/apiservers/portlayer/models/ - @rm -rf ./lib/apiservers/portlayer/restapi/operations/ + @rm -rf ./lib/apiservers/portlayer/client/* + @rm -rf ./lib/apiservers/portlayer/cmd/* + @rm -rf ./lib/apiservers/portlayer/models/* + @rm -rf ./lib/apiservers/portlayer/restapi/operations/* @rm -rf ./lib/config/dynamic/admiral/client @rm -rf ./lib/config/dynamic/admiral/models @rm -rf ./lib/config/dynamic/admiral/operations @@ -489,9 +489,9 @@ clean: cleandeps @rm -f ./lib/apiservers/service/restapi/doc.go @rm -f ./lib/apiservers/service/restapi/embedded_spec.go @rm -f ./lib/apiservers/service/restapi/server.go - @rm -rf ./lib/apiservers/service/restapi/cmd/ - @rm -rf ./lib/apiservers/service/restapi/models/ - @rm -rf ./lib/apiservers/service/restapi/operations/ + @rm -rf ./lib/apiservers/service/restapi/cmd/* + @rm -rf ./lib/apiservers/service/restapi/models/* + @rm -rf ./lib/apiservers/service/restapi/operations/* @rm -f *.log @rm -f *.pem From e182fb236f1037f48577f89e4d7f04a603a794a1 Mon Sep 17 00:00:00 2001 From: Zach Shepherd Date: Thu, 20 Sep 2018 09:29:20 -0700 Subject: [PATCH 5/8] Enforce dependency relationships during build Add dependency relationship enforcement to the checks stage of the build process so that it runs as a part of CI. --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9b224cd92c..25e246a08a 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,8 @@ GAS ?= $(GOPATH)/bin/gas$(BIN_ARCH) MISSPELL ?= $(GOPATH)/bin/misspell$(BIN_ARCH) .PHONY: all tools clean test check distro \ - goversion goimports gopath govet gofmt misspell gas golint \ - isos tethers apiservers copyright + goversion goimports gopath govet gofmt misspell gas golint copyright enforce-deps \ + isos tethers apiservers .DEFAULT_GOAL := all @@ -154,7 +154,7 @@ misspell: $(MISSPELL) # convenience targets all: components tethers isos vic-machine imagec tools: $(GOIMPORTS) $(GVT) $(GOLINT) $(SWAGGER) $(GAS) $(MISSPELL) goversion -check: goversion goimports gofmt misspell govet golint copyright whitespace gas +check: goversion goimports gofmt misspell govet golint copyright whitespace gas enforce-deps apiservers: $(portlayerapi) $(docker-engine-api) $(serviceapi) components: check apiservers $(vicadmin) $(rpctool) isos: $(appliance) $(bootstrap) @@ -240,6 +240,10 @@ govet: gas: $(GAS) @echo checking security problems +enforce-deps: + @echo checking dependencies... + @infra/scripts/go-deps-enforcement.sh + vendor: $(GVT) @echo restoring vendor $(GVT) restore From aaa8fc399837eecccbc98e4d29b5231536ebb77c Mon Sep 17 00:00:00 2001 From: Zach Shepherd Date: Thu, 20 Sep 2018 17:39:51 -0700 Subject: [PATCH 6/8] Warn about unused rules --- Makefile | 3 +- infra/scripts/go-deps-enforcement.sh | 78 +++++++++++++++++-- lib/apiservers/engine/.godeps_rules | 8 +- .../engine/backends/middleware/.godeps_rules | 12 +-- lib/apiservers/portlayer/client/.godeps_rules | 2 +- .../restapi/operations/.godeps_rules | 2 +- .../service/restapi/operations/.godeps_rules | 2 +- lib/constants/.godeps_rules | 2 +- lib/install/management/.godeps_rules | 4 +- lib/portlayer/storage/.godeps_rules | 4 +- pkg/version/.godeps_rules | 4 +- 11 files changed, 93 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 25e246a08a..a004b2179a 100644 --- a/Makefile +++ b/Makefile @@ -240,7 +240,8 @@ govet: gas: $(GAS) @echo checking security problems -enforce-deps: +# requires swagger generation to avoid warnings about unused rules +enforce-deps: $(portlayerapi-client) $(portlayerapi-server) $(serviceapi-server) @echo checking dependencies... @infra/scripts/go-deps-enforcement.sh diff --git a/infra/scripts/go-deps-enforcement.sh b/infra/scripts/go-deps-enforcement.sh index 396e08488f..bf4d65098c 100755 --- a/infra/scripts/go-deps-enforcement.sh +++ b/infra/scripts/go-deps-enforcement.sh @@ -29,6 +29,17 @@ find-packages () { find "${@}" -type f -name '*.go' -exec dirname {} \; | sort --unique } +# Returns a list of all rules files +# Arguments +# *: directories to search under +# +# Returns: +# rule files within searched directories +find-rules () { + find "${@}" -type f -name "$RULES_FILE" | sort --unique +} + + # Returns the path to the "nearest" rule file for a given package # Arguments # 1: package path @@ -36,7 +47,7 @@ find-packages () { # Returns: # path to rule file (defaulting to /dev/null) find-rule () { - path="${1?Package path must be provided}" + local path="${1?Package path must be provided}" shift while [[ "$path" != "." ]]; do @@ -58,7 +69,7 @@ find-rule () { # Returns: # contents of the file, excluding blank lines and lines beginning with "#" get-rules () { - rules="${1?Rules file must be provided}" + local rules="${1?Rules file must be provided}" shift grep -v -e '^$' -e '^#' "$rules" @@ -71,7 +82,7 @@ get-rules () { # Returns: # a list of direct and transitive dependencies get-deps () { - package="${1?Package must be provided}" + local package="${1?Package must be provided}" shift infra/scripts/go-deps.sh "$package" @@ -86,23 +97,76 @@ get-deps () { # Returns: # a list of invalid dependencies filter-deps () { - package="${1?Package must be provided}" - rules="${2?Rules file must be provided}" + local package="${1?Package must be provided}" + local rules="${2?Rules file must be provided}" shift 2 get-deps "$package" | grep -v -e "^$package/*" -f <(get-rules "$rules") || true } +# Returns any unused rules for a given set of packages (does not identify duplicate rules!) +# Arguments +# 1: the dependencies +# 2: path to rules file +# +# Returns: +# a list of rules which match none of the dependencies +filter-rules () { + local deps="${1?Dependencies must be provided}" + local rules="${2?Rules file must be provided}" + shift 2 + + local unmatched=() + for rule in $(get-rules "$rules"); do + matches=$(echo "$deps" | grep -c -e "$rule" || true) + + if [ "$matches" = "0" ]; then + unmatched+=("$rule") + fi + done + + echo "${unmatched[*]}" +} + + rc=0 + for package in $(find-packages "${ENFORCE[@]}"); do rules="$(find-rule "$package")" + invalid=$(filter-deps "$package" "$rules") + if [ ! -z "$invalid" ]; then echo "Unexpected dependencies in $package:" - echo "${invalid//^/ /}" + echo "$invalid" | sed -e 's/^/ /' echo "See $rules for details." echo "" - rc=1 + + rc=$(( rc | 1 )) + fi +done + +export VIC_CACHE_DEPS=true # We've just calculated all of these; no need to do so again + +for rules in $(find-rules "${ENFORCE[@]}"); do + directory=$(dirname "$rules") + + deps="" + for package in $(find-packages "$directory"); do + if [ "$rules" != "$(find-rule "$package")" ]; then + continue # This package is using a more specific rules file + fi + deps+="$(get-deps "$package")" + done + + unused="$(filter-rules "$deps" "$rules")" + + if [ ! -z "$unused" ]; then + echo "Unused rules in $rules:" + echo "$unused" | sed -e 's/^/ /' + echo "" + + rc=$(( rc | 2 )) fi done diff --git a/lib/apiservers/engine/.godeps_rules b/lib/apiservers/engine/.godeps_rules index fb3bd829ca..d272a53759 100644 --- a/lib/apiservers/engine/.godeps_rules +++ b/lib/apiservers/engine/.godeps_rules @@ -18,15 +18,15 @@ ^lib/config/* ^lib/constants/* ^lib/imagec/* -^lib/iolog/* +#^lib/iolog/* ^lib/metadata/* ^lib/migration/* ^lib/spec/* -^lib/tether/shared/* +#^lib/tether/shared/* # lib/tether/shared also depends on lib/system -^lib/system/* +#^lib/system/* # lib/system also depends on lib/etcconf -^lib/etcconf/* +#^lib/etcconf/* diff --git a/lib/apiservers/engine/backends/middleware/.godeps_rules b/lib/apiservers/engine/backends/middleware/.godeps_rules index 6ee90d46b0..59d73c7c88 100644 --- a/lib/apiservers/engine/backends/middleware/.godeps_rules +++ b/lib/apiservers/engine/backends/middleware/.godeps_rules @@ -3,23 +3,23 @@ ^vendor/* # lib/apiservers/engine subpackages can depend on other subpackages -^lib/apiservers/engine/* +#^lib/apiservers/engine/* # lib/apiservers/engine acts as a client of the portlayer API -^lib/apiservers/portlayer/client/* -^lib/apiservers/portlayer/models/* +#^lib/apiservers/portlayer/client/* +#^lib/apiservers/portlayer/models/* # lib/apiservers/engine also depends on portlayer utilities and events ^lib/portlayer/util/* ^lib/portlayer/event/events/* # lib/apiservers/engine also depends on other lib packages -^lib/archive/* +#^lib/archive/* ^lib/config/* ^lib/constants/* -^lib/imagec/* +#^lib/imagec/* ^lib/iolog/* -^lib/metadata/* +#^lib/metadata/* ^lib/migration/* ^lib/spec/* ^lib/tether/shared/* diff --git a/lib/apiservers/portlayer/client/.godeps_rules b/lib/apiservers/portlayer/client/.godeps_rules index 91b38bacbe..58bcfb70c0 100644 --- a/lib/apiservers/portlayer/client/.godeps_rules +++ b/lib/apiservers/portlayer/client/.godeps_rules @@ -1,5 +1,5 @@ # By default, packages in lib should depend only on packages under pkg or vendor -^pkg/* +#^pkg/* ^vendor/* # portlayer API client may reference portlayer API model objects diff --git a/lib/apiservers/portlayer/restapi/operations/.godeps_rules b/lib/apiservers/portlayer/restapi/operations/.godeps_rules index c2458b2279..4ba4fd8fb6 100644 --- a/lib/apiservers/portlayer/restapi/operations/.godeps_rules +++ b/lib/apiservers/portlayer/restapi/operations/.godeps_rules @@ -1,5 +1,5 @@ # By default, packages in lib should depend only on packages under pkg or vendor -^pkg/* +#^pkg/* ^vendor/* # portlayer API operations may reference portlayer API model objects diff --git a/lib/apiservers/service/restapi/operations/.godeps_rules b/lib/apiservers/service/restapi/operations/.godeps_rules index be4fd7916c..dae8b11df1 100644 --- a/lib/apiservers/service/restapi/operations/.godeps_rules +++ b/lib/apiservers/service/restapi/operations/.godeps_rules @@ -1,5 +1,5 @@ # By default, packages in lib should depend only on packages under pkg or vendor -^pkg/* +#^pkg/* ^vendor/* # service API operations may reference service API model objects diff --git a/lib/constants/.godeps_rules b/lib/constants/.godeps_rules index 878a8d3eec..0f6f6a97a8 100644 --- a/lib/constants/.godeps_rules +++ b/lib/constants/.godeps_rules @@ -1,6 +1,6 @@ # By default, packages in lib should depend only on packages under pkg or vendor ^pkg/* -^vendor/* +#^vendor/* # BAD: lib/constants depends on pkg/version, which depends on lib/migration/feature ^lib/migration/feature/* diff --git a/lib/install/management/.godeps_rules b/lib/install/management/.godeps_rules index 9d33d3ab23..af0928b8c8 100644 --- a/lib/install/management/.godeps_rules +++ b/lib/install/management/.godeps_rules @@ -21,10 +21,10 @@ ^lib/install/vchlog/* # QUESTIONABLE: lib/install/management also depends on portlayer utilities -lib/portlayer/util/* +^lib/portlayer/util/* # QUESTIONABLE: lib/install/management also depends on the shared tether sub-package -lib/tether/shared/* +^lib/tether/shared/* # BAD: lib/install/management also depends on code from cmd/vic-machine/common, but it should not ^cmd/vic-machine/common/* diff --git a/lib/portlayer/storage/.godeps_rules b/lib/portlayer/storage/.godeps_rules index 1f0e1f1f4d..fdcbc3a0b7 100644 --- a/lib/portlayer/storage/.godeps_rules +++ b/lib/portlayer/storage/.godeps_rules @@ -10,7 +10,7 @@ ^lib/iolog/* ^lib/migration/* ^lib/spec/* -^lib/tether/msgs/* +#^lib/tether/msgs/* ^lib/tether/shared/* # lib/tether/shared also depends on lib/system @@ -23,7 +23,7 @@ # event, exec, store, and util are valid dependencies for other sub-packages ^lib/portlayer/event/* ^lib/portlayer/exec/* -^lib/portlayer/store/* +#^lib/portlayer/store/* ^lib/portlayer/util/* # lib/portlayer/storage subpackages can depend on lib/portlayer/storage diff --git a/pkg/version/.godeps_rules b/pkg/version/.godeps_rules index b9c250524e..a83cd72e31 100644 --- a/pkg/version/.godeps_rules +++ b/pkg/version/.godeps_rules @@ -1,6 +1,6 @@ # By default, packages in pkg should depend only on packages under pkg or vendor -^pkg/* -^vendor/* +#^pkg/* +#^vendor/* # BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not ^lib/migration/feature/* From 827eff3acbfd0ae65914b14a8e6849e9499c3728 Mon Sep 17 00:00:00 2001 From: Zach Shepherd Date: Mon, 24 Sep 2018 14:55:27 -0700 Subject: [PATCH 7/8] fixup! Define initial dependency enforcement rules --- cmd/vic-machine-server/.godeps_rules | 1 - cmd/vic-machine/inspect/.godeps_rules | 1 - lib/apiservers/engine/.godeps_rules | 1 - lib/apiservers/portlayer/client/.godeps_rules | 1 - lib/apiservers/portlayer/restapi/.godeps_rules | 1 - lib/apiservers/portlayer/restapi/operations/.godeps_rules | 1 - lib/apiservers/service/restapi/.godeps_rules | 1 - lib/apiservers/service/restapi/operations/.godeps_rules | 1 - lib/constants/.godeps_rules | 1 - lib/dhcp/client/.godeps_rules | 1 - lib/install/.godeps_rules | 1 - lib/install/data/.godeps_rules | 1 - lib/install/validate/.godeps_rules | 1 - lib/migration/.godeps_rules | 1 - lib/migration/manager/.godeps_rules | 1 - lib/migration/plugins/.godeps_rules | 1 - lib/migration/samples/.godeps_rules | 1 - lib/portlayer/.godeps_rules | 1 - lib/portlayer/storage/.godeps_rules | 1 - lib/system/.godeps_rules | 1 - lib/vicadmin/.godeps_rules | 1 - pkg/fetcher/.godeps_rules | 1 - pkg/kvstore/.godeps_rules | 1 - pkg/logmgr/.godeps_rules | 1 - pkg/registry/.godeps_rules | 1 - pkg/version/.godeps_rules | 1 - pkg/vsphere/.godeps_rules | 1 - pkg/vsphere/test/.godeps_rules | 1 - 28 files changed, 28 deletions(-) diff --git a/cmd/vic-machine-server/.godeps_rules b/cmd/vic-machine-server/.godeps_rules index b79281465f..6af7cf6e8f 100644 --- a/cmd/vic-machine-server/.godeps_rules +++ b/cmd/vic-machine-server/.godeps_rules @@ -6,4 +6,3 @@ # BAD: vic-machine-server currently depends on vic-machine code, but should not ^cmd/vic-machine/common/* ^cmd/vic-machine/create/* - diff --git a/cmd/vic-machine/inspect/.godeps_rules b/cmd/vic-machine/inspect/.godeps_rules index 522eedba79..e18b47ea43 100644 --- a/cmd/vic-machine/inspect/.godeps_rules +++ b/cmd/vic-machine/inspect/.godeps_rules @@ -9,4 +9,3 @@ # BAD: vic-machine inspect currently depends on sibling commands, but should not ^cmd/vic-machine/converter/* ^cmd/vic-machine/create/* - diff --git a/lib/apiservers/engine/.godeps_rules b/lib/apiservers/engine/.godeps_rules index d272a53759..39d2a8bb81 100644 --- a/lib/apiservers/engine/.godeps_rules +++ b/lib/apiservers/engine/.godeps_rules @@ -29,4 +29,3 @@ # lib/system also depends on lib/etcconf #^lib/etcconf/* - diff --git a/lib/apiservers/portlayer/client/.godeps_rules b/lib/apiservers/portlayer/client/.godeps_rules index 58bcfb70c0..04fe91fc88 100644 --- a/lib/apiservers/portlayer/client/.godeps_rules +++ b/lib/apiservers/portlayer/client/.godeps_rules @@ -4,4 +4,3 @@ # portlayer API client may reference portlayer API model objects ^lib/apiservers/portlayer/models/* - diff --git a/lib/apiservers/portlayer/restapi/.godeps_rules b/lib/apiservers/portlayer/restapi/.godeps_rules index 70cf94b0b7..8f09a6a611 100644 --- a/lib/apiservers/portlayer/restapi/.godeps_rules +++ b/lib/apiservers/portlayer/restapi/.godeps_rules @@ -23,4 +23,3 @@ # lib/system also depends on lib/etcconf ^lib/etcconf/* - diff --git a/lib/apiservers/portlayer/restapi/operations/.godeps_rules b/lib/apiservers/portlayer/restapi/operations/.godeps_rules index 4ba4fd8fb6..e3583bf77d 100644 --- a/lib/apiservers/portlayer/restapi/operations/.godeps_rules +++ b/lib/apiservers/portlayer/restapi/operations/.godeps_rules @@ -4,4 +4,3 @@ # portlayer API operations may reference portlayer API model objects ^lib/apiservers/portlayer/models/* - diff --git a/lib/apiservers/service/restapi/.godeps_rules b/lib/apiservers/service/restapi/.godeps_rules index 88da32250f..29f1ee66ea 100644 --- a/lib/apiservers/service/restapi/.godeps_rules +++ b/lib/apiservers/service/restapi/.godeps_rules @@ -27,4 +27,3 @@ # BAD: lib/apiservers/service handlers depend on code from vic-machine ^cmd/vic-machine/common/* ^cmd/vic-machine/create/* - diff --git a/lib/apiservers/service/restapi/operations/.godeps_rules b/lib/apiservers/service/restapi/operations/.godeps_rules index dae8b11df1..ea5cf7d505 100644 --- a/lib/apiservers/service/restapi/operations/.godeps_rules +++ b/lib/apiservers/service/restapi/operations/.godeps_rules @@ -4,4 +4,3 @@ # service API operations may reference service API model objects ^lib/apiservers/service/models/* - diff --git a/lib/constants/.godeps_rules b/lib/constants/.godeps_rules index 0f6f6a97a8..822a3ef487 100644 --- a/lib/constants/.godeps_rules +++ b/lib/constants/.godeps_rules @@ -4,4 +4,3 @@ # BAD: lib/constants depends on pkg/version, which depends on lib/migration/feature ^lib/migration/feature/* - diff --git a/lib/dhcp/client/.godeps_rules b/lib/dhcp/client/.godeps_rules index 3a31331c96..f4d6a4ac3f 100644 --- a/lib/dhcp/client/.godeps_rules +++ b/lib/dhcp/client/.godeps_rules @@ -8,4 +8,3 @@ # lib/system depends on lib/etcconf ^lib/etcconf/* - diff --git a/lib/install/.godeps_rules b/lib/install/.godeps_rules index 34610c6414..d342859519 100644 --- a/lib/install/.godeps_rules +++ b/lib/install/.godeps_rules @@ -6,4 +6,3 @@ ^lib/config/* ^lib/config/executor/* ^lib/migration/feature/* - diff --git a/lib/install/data/.godeps_rules b/lib/install/data/.godeps_rules index 9584e8ea65..05aeb8fe13 100644 --- a/lib/install/data/.godeps_rules +++ b/lib/install/data/.godeps_rules @@ -9,4 +9,3 @@ # BAD: lib/install/data also depends on code from cmd/vic-machine/common, but it should not ^cmd/vic-machine/common/* - diff --git a/lib/install/validate/.godeps_rules b/lib/install/validate/.godeps_rules index e1937ced36..56d6750e30 100644 --- a/lib/install/validate/.godeps_rules +++ b/lib/install/validate/.godeps_rules @@ -16,4 +16,3 @@ # BAD: lib/install/validate also depends on code from cmd/vic-machine/common, but it should not ^cmd/vic-machine/common/* - diff --git a/lib/migration/.godeps_rules b/lib/migration/.godeps_rules index 8ee3f7e6db..11506e0b20 100644 --- a/lib/migration/.godeps_rules +++ b/lib/migration/.godeps_rules @@ -4,4 +4,3 @@ # lib/migration also depends on lib/config ^lib/config/* - diff --git a/lib/migration/manager/.godeps_rules b/lib/migration/manager/.godeps_rules index 7a4e65b5c4..a7003c860c 100644 --- a/lib/migration/manager/.godeps_rules +++ b/lib/migration/manager/.godeps_rules @@ -8,4 +8,3 @@ # lib/migration/manager also depends other lib/migration sub-packages ^lib/migration/errors/* ^lib/migration/feature/* - diff --git a/lib/migration/plugins/.godeps_rules b/lib/migration/plugins/.godeps_rules index 78958f0e37..7c6055163d 100644 --- a/lib/migration/plugins/.godeps_rules +++ b/lib/migration/plugins/.godeps_rules @@ -9,4 +9,3 @@ ^lib/migration/errors/* ^lib/migration/feature/* ^lib/migration/manager/* - diff --git a/lib/migration/samples/.godeps_rules b/lib/migration/samples/.godeps_rules index 4a89d68feb..4337eb9386 100644 --- a/lib/migration/samples/.godeps_rules +++ b/lib/migration/samples/.godeps_rules @@ -10,4 +10,3 @@ ^lib/migration/feature/* ^lib/migration/manager/* ^lib/migration/samples/* - diff --git a/lib/portlayer/.godeps_rules b/lib/portlayer/.godeps_rules index f2ad652206..abf6792e75 100644 --- a/lib/portlayer/.godeps_rules +++ b/lib/portlayer/.godeps_rules @@ -25,4 +25,3 @@ ^lib/portlayer/exec/* ^lib/portlayer/store/* ^lib/portlayer/util/* - diff --git a/lib/portlayer/storage/.godeps_rules b/lib/portlayer/storage/.godeps_rules index fdcbc3a0b7..ceb2ba5852 100644 --- a/lib/portlayer/storage/.godeps_rules +++ b/lib/portlayer/storage/.godeps_rules @@ -28,4 +28,3 @@ # lib/portlayer/storage subpackages can depend on lib/portlayer/storage ^lib/portlayer/storage/* - diff --git a/lib/system/.godeps_rules b/lib/system/.godeps_rules index b8fe48e73e..7654b30c54 100644 --- a/lib/system/.godeps_rules +++ b/lib/system/.godeps_rules @@ -4,4 +4,3 @@ # lib/system can depend on lib/etcconf ^lib/etcconf/* - diff --git a/lib/vicadmin/.godeps_rules b/lib/vicadmin/.godeps_rules index dfdf3ba4cc..c81c087e43 100644 --- a/lib/vicadmin/.godeps_rules +++ b/lib/vicadmin/.godeps_rules @@ -17,4 +17,3 @@ # BAD: vicadmin currently depends on code from cmd/vic-machine/common, but it should not ^cmd/vic-machine/common/* - diff --git a/pkg/fetcher/.godeps_rules b/pkg/fetcher/.godeps_rules index b9c250524e..4ea02545f2 100644 --- a/pkg/fetcher/.godeps_rules +++ b/pkg/fetcher/.godeps_rules @@ -4,4 +4,3 @@ # BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not ^lib/migration/feature/* - diff --git a/pkg/kvstore/.godeps_rules b/pkg/kvstore/.godeps_rules index 06af92d260..19996c1fde 100644 --- a/pkg/kvstore/.godeps_rules +++ b/pkg/kvstore/.godeps_rules @@ -6,4 +6,3 @@ ^lib/config/* ^lib/config/executor/* ^lib/migration/feature/* - diff --git a/pkg/logmgr/.godeps_rules b/pkg/logmgr/.godeps_rules index 7cc96cc34f..9dc02414ee 100644 --- a/pkg/logmgr/.godeps_rules +++ b/pkg/logmgr/.godeps_rules @@ -13,4 +13,3 @@ ^lib/tether/* ^lib/tether/msgs/* ^lib/tether/shared/* - diff --git a/pkg/registry/.godeps_rules b/pkg/registry/.godeps_rules index b9c250524e..4ea02545f2 100644 --- a/pkg/registry/.godeps_rules +++ b/pkg/registry/.godeps_rules @@ -4,4 +4,3 @@ # BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not ^lib/migration/feature/* - diff --git a/pkg/version/.godeps_rules b/pkg/version/.godeps_rules index a83cd72e31..3258dcc83d 100644 --- a/pkg/version/.godeps_rules +++ b/pkg/version/.godeps_rules @@ -4,4 +4,3 @@ # BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not ^lib/migration/feature/* - diff --git a/pkg/vsphere/.godeps_rules b/pkg/vsphere/.godeps_rules index 06af92d260..19996c1fde 100644 --- a/pkg/vsphere/.godeps_rules +++ b/pkg/vsphere/.godeps_rules @@ -6,4 +6,3 @@ ^lib/config/* ^lib/config/executor/* ^lib/migration/feature/* - diff --git a/pkg/vsphere/test/.godeps_rules b/pkg/vsphere/test/.godeps_rules index 44d39c3daa..ce9329e0b4 100644 --- a/pkg/vsphere/test/.godeps_rules +++ b/pkg/vsphere/test/.godeps_rules @@ -10,4 +10,3 @@ # BAD: pkg/vsphere/test/test.go currently depends on lib/spec, but should not ^lib/constants/* ^lib/spec/* - From a317d1e83fe6f16e13d800ec3465bb35656ac0c3 Mon Sep 17 00:00:00 2001 From: Zach Shepherd Date: Mon, 24 Sep 2018 16:28:43 -0700 Subject: [PATCH 8/8] fixup! Define initial dependency enforcement rules Add TODOs to track bad dependencies --- cmd/vic-machine-server/.godeps_rules | 2 +- cmd/vic-machine/inspect/.godeps_rules | 2 +- cmd/vicadmin/.godeps_rules | 2 +- lib/apiservers/engine/backends/middleware/.godeps_rules | 4 ++-- lib/apiservers/service/restapi/.godeps_rules | 2 +- lib/config/.godeps_rules | 2 +- lib/constants/.godeps_rules | 2 +- lib/guest/.godeps_rules | 2 +- lib/imagec/.godeps_rules | 2 +- lib/install/data/.godeps_rules | 2 +- lib/install/management/.godeps_rules | 8 +++----- lib/install/validate/.godeps_rules | 2 +- lib/pprof/.godeps_rules | 2 +- lib/spec/.godeps_rules | 2 +- lib/tether/.godeps_rules | 2 +- lib/vicadmin/.godeps_rules | 4 ++-- lib/vspc/.godeps_rules | 2 +- pkg/fetcher/.godeps_rules | 2 +- pkg/kvstore/.godeps_rules | 2 +- pkg/logmgr/.godeps_rules | 2 +- pkg/registry/.godeps_rules | 2 +- pkg/version/.godeps_rules | 2 +- pkg/vsphere/.godeps_rules | 2 +- pkg/vsphere/test/.godeps_rules | 4 ++-- 24 files changed, 29 insertions(+), 31 deletions(-) diff --git a/cmd/vic-machine-server/.godeps_rules b/cmd/vic-machine-server/.godeps_rules index 6af7cf6e8f..c7b6fdea99 100644 --- a/cmd/vic-machine-server/.godeps_rules +++ b/cmd/vic-machine-server/.godeps_rules @@ -3,6 +3,6 @@ ^pkg/* ^vendor/* -# BAD: vic-machine-server currently depends on vic-machine code, but should not +# TODO[#8296]: vic-machine-server transitively depends on vic-machine code, but should not ^cmd/vic-machine/common/* ^cmd/vic-machine/create/* diff --git a/cmd/vic-machine/inspect/.godeps_rules b/cmd/vic-machine/inspect/.godeps_rules index e18b47ea43..48cf8c1726 100644 --- a/cmd/vic-machine/inspect/.godeps_rules +++ b/cmd/vic-machine/inspect/.godeps_rules @@ -6,6 +6,6 @@ # vic-machine packages can also depend on common vic-machine code ^cmd/vic-machine/common/* -# BAD: vic-machine inspect currently depends on sibling commands, but should not +# TODO[#8297]: vic-machine inspect currently depends on sibling commands, but should not ^cmd/vic-machine/converter/* ^cmd/vic-machine/create/* diff --git a/cmd/vicadmin/.godeps_rules b/cmd/vicadmin/.godeps_rules index 10f727b310..e216b816c3 100644 --- a/cmd/vicadmin/.godeps_rules +++ b/cmd/vicadmin/.godeps_rules @@ -3,5 +3,5 @@ ^pkg/* ^vendor/* -# BAD: vicadmin currently depends on vic-machine code, but should not +# TODO[#8296]: vicadmin currently depends on vic-machine code, but should not ^cmd/vic-machine/common/* diff --git a/lib/apiservers/engine/backends/middleware/.godeps_rules b/lib/apiservers/engine/backends/middleware/.godeps_rules index 59d73c7c88..eb7fe3447a 100644 --- a/lib/apiservers/engine/backends/middleware/.godeps_rules +++ b/lib/apiservers/engine/backends/middleware/.godeps_rules @@ -30,8 +30,8 @@ # lib/system also depends on lib/etcconf ^lib/etcconf/* -# BAD: lib/apiservers/engine/backends/middleware depends on lib/dns, which in turn -# depends on a variety of code from the portlayer +# TODO[#8302]: lib/apiservers/engine/backends/middleware depends on lib/dns, +# which in turn depends on a variety of code from the portlayer ^lib/dns/* ^lib/portlayer/event/* ^lib/portlayer/exec/* diff --git a/lib/apiservers/service/restapi/.godeps_rules b/lib/apiservers/service/restapi/.godeps_rules index 29f1ee66ea..7acb137b1d 100644 --- a/lib/apiservers/service/restapi/.godeps_rules +++ b/lib/apiservers/service/restapi/.godeps_rules @@ -24,6 +24,6 @@ ^lib/system/* ^lib/tether/shared/* -# BAD: lib/apiservers/service handlers depend on code from vic-machine +# TODO[#8295]: lib/apiservers/service handlers depend on code from vic-machine ^cmd/vic-machine/common/* ^cmd/vic-machine/create/* diff --git a/lib/config/.godeps_rules b/lib/config/.godeps_rules index 04e81f1de8..f203bbe008 100644 --- a/lib/config/.godeps_rules +++ b/lib/config/.godeps_rules @@ -5,5 +5,5 @@ # lib/config subpackages can depend on each other ^lib/config/* -# BAD: lib/config depends on pkg/version, which depends on lib/migration/feature +# TODO[#8299]: lib/config depends on pkg/version, which depends on lib/migration/feature ^lib/migration/feature/* diff --git a/lib/constants/.godeps_rules b/lib/constants/.godeps_rules index 822a3ef487..bfea018296 100644 --- a/lib/constants/.godeps_rules +++ b/lib/constants/.godeps_rules @@ -2,5 +2,5 @@ ^pkg/* #^vendor/* -# BAD: lib/constants depends on pkg/version, which depends on lib/migration/feature +# TODO[#8299]: lib/constants depends on pkg/version, which depends on lib/migration/feature ^lib/migration/feature/* diff --git a/lib/guest/.godeps_rules b/lib/guest/.godeps_rules index 9ef681d113..0f13933684 100644 --- a/lib/guest/.godeps_rules +++ b/lib/guest/.godeps_rules @@ -9,5 +9,5 @@ # lib/spec in turn depends on ^lib/config/* -# BAD: pkg/version depends on lib/migration/feature +# TODO[#8299]: pkg/version depends on lib/migration/feature ^lib/migration/feature/* diff --git a/lib/imagec/.godeps_rules b/lib/imagec/.godeps_rules index b738310fe1..2063c04955 100644 --- a/lib/imagec/.godeps_rules +++ b/lib/imagec/.godeps_rules @@ -9,5 +9,5 @@ ^lib/constants/* ^lib/metadata/* -# BAD: pkg/version depends on lib/migration/feature +# TODO[#8299]: pkg/version depends on lib/migration/feature ^lib/migration/feature/* diff --git a/lib/install/data/.godeps_rules b/lib/install/data/.godeps_rules index 05aeb8fe13..df29499893 100644 --- a/lib/install/data/.godeps_rules +++ b/lib/install/data/.godeps_rules @@ -7,5 +7,5 @@ ^lib/config/executor/* ^lib/migration/feature/* -# BAD: lib/install/data also depends on code from cmd/vic-machine/common, but it should not +# TODO[#8296]: lib/install/data also depends on code from cmd/vic-machine/common, but it should not ^cmd/vic-machine/common/* diff --git a/lib/install/management/.godeps_rules b/lib/install/management/.godeps_rules index af0928b8c8..777f55062a 100644 --- a/lib/install/management/.godeps_rules +++ b/lib/install/management/.godeps_rules @@ -13,6 +13,7 @@ ^lib/migration/* ^lib/spec/* ^lib/system/* +^lib/tether/shared/* # lib/install/management also depends on other lib/install sub-packages ^lib/install/data/* @@ -20,11 +21,8 @@ ^lib/install/validate/* ^lib/install/vchlog/* -# QUESTIONABLE: lib/install/management also depends on portlayer utilities +# TODO[#8303]: lib/install/management also depends on portlayer utilities ^lib/portlayer/util/* -# QUESTIONABLE: lib/install/management also depends on the shared tether sub-package -^lib/tether/shared/* - -# BAD: lib/install/management also depends on code from cmd/vic-machine/common, but it should not +# TODO[#8296]: lib/install/management also depends on code from cmd/vic-machine/common, but it should not ^cmd/vic-machine/common/* diff --git a/lib/install/validate/.godeps_rules b/lib/install/validate/.godeps_rules index 56d6750e30..8c1144aa5e 100644 --- a/lib/install/validate/.godeps_rules +++ b/lib/install/validate/.godeps_rules @@ -14,5 +14,5 @@ ^lib/install/data/* ^lib/install/opsuser/* -# BAD: lib/install/validate also depends on code from cmd/vic-machine/common, but it should not +# TODO[#8296]: lib/install/validate also depends on code from cmd/vic-machine/common, but it should not ^cmd/vic-machine/common/* diff --git a/lib/pprof/.godeps_rules b/lib/pprof/.godeps_rules index 7d073e7c0f..66c0fb4299 100644 --- a/lib/pprof/.godeps_rules +++ b/lib/pprof/.godeps_rules @@ -5,5 +5,5 @@ # lib/pprof also depends on lib/config ^lib/config/* -# BAD: pkg/version depends on lib/migration/feature +# TODO[#8299]: pkg/version depends on lib/migration/feature ^lib/migration/feature/* diff --git a/lib/spec/.godeps_rules b/lib/spec/.godeps_rules index 159f9722da..c4673fee59 100644 --- a/lib/spec/.godeps_rules +++ b/lib/spec/.godeps_rules @@ -6,5 +6,5 @@ ^lib/config/* ^lib/constants/* -# BAD: pkg/version depends on lib/migration/feature +# TODO[#8299]: pkg/version depends on lib/migration/feature ^lib/migration/feature/* diff --git a/lib/tether/.godeps_rules b/lib/tether/.godeps_rules index 619195ec9b..347a7aad00 100644 --- a/lib/tether/.godeps_rules +++ b/lib/tether/.godeps_rules @@ -12,5 +12,5 @@ ^lib/etcconf/* ^lib/system/* -# BAD: Test code depends on lib/migration/feature for the same reason as pkg/version +# TODO[#8299]: Test code depends on lib/migration/feature for the same reason as pkg/version ^lib/migration/feature/* diff --git a/lib/vicadmin/.godeps_rules b/lib/vicadmin/.godeps_rules index c81c087e43..00faa5ff5a 100644 --- a/lib/vicadmin/.godeps_rules +++ b/lib/vicadmin/.godeps_rules @@ -12,8 +12,8 @@ ^lib/system/* ^lib/tether/shared/* -# BAD: pkg/version depends on lib/migration/feature +# TODO[#8299]: pkg/version depends on lib/migration/feature ^lib/migration/feature/* -# BAD: vicadmin currently depends on code from cmd/vic-machine/common, but it should not +# TODO[#8296]: vicadmin currently depends on code from cmd/vic-machine/common, but it should not ^cmd/vic-machine/common/* diff --git a/lib/vspc/.godeps_rules b/lib/vspc/.godeps_rules index 65defcc46f..01e15f78e9 100644 --- a/lib/vspc/.godeps_rules +++ b/lib/vspc/.godeps_rules @@ -5,5 +5,5 @@ # vspc also depends on lib/constants ^lib/constants/* -# BAD: pkg/version depends on lib/migration/feature +# TODO[#8299]: pkg/version depends on lib/migration/feature ^lib/migration/feature/* diff --git a/pkg/fetcher/.godeps_rules b/pkg/fetcher/.godeps_rules index 4ea02545f2..6e04ca7b00 100644 --- a/pkg/fetcher/.godeps_rules +++ b/pkg/fetcher/.godeps_rules @@ -2,5 +2,5 @@ ^pkg/* ^vendor/* -# BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not +# TODO[#8299]: pkg/version/version.go currently depends on lib/migration/feature, but should not ^lib/migration/feature/* diff --git a/pkg/kvstore/.godeps_rules b/pkg/kvstore/.godeps_rules index 19996c1fde..c13acb3c96 100644 --- a/pkg/kvstore/.godeps_rules +++ b/pkg/kvstore/.godeps_rules @@ -2,7 +2,7 @@ ^pkg/* ^vendor/* -# BAD: pkg/vsphere/session/session.go currently depends on lib/config, but should not +# BAD[#8300]: pkg/vsphere/session/session.go currently depends on lib/config, but should not ^lib/config/* ^lib/config/executor/* ^lib/migration/feature/* diff --git a/pkg/logmgr/.godeps_rules b/pkg/logmgr/.godeps_rules index 9dc02414ee..83cefdc401 100644 --- a/pkg/logmgr/.godeps_rules +++ b/pkg/logmgr/.godeps_rules @@ -2,7 +2,7 @@ ^pkg/* ^vendor/* -# BAD: logmgr depends on tether, but it should not +# TODO[#8298]: logmgr depends on tether, but it should not ^lib/archive/* ^lib/config/executor/* ^lib/dhcp/* diff --git a/pkg/registry/.godeps_rules b/pkg/registry/.godeps_rules index 4ea02545f2..6e04ca7b00 100644 --- a/pkg/registry/.godeps_rules +++ b/pkg/registry/.godeps_rules @@ -2,5 +2,5 @@ ^pkg/* ^vendor/* -# BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not +# TODO[#8299]: pkg/version/version.go currently depends on lib/migration/feature, but should not ^lib/migration/feature/* diff --git a/pkg/version/.godeps_rules b/pkg/version/.godeps_rules index 3258dcc83d..119ce2f980 100644 --- a/pkg/version/.godeps_rules +++ b/pkg/version/.godeps_rules @@ -2,5 +2,5 @@ #^pkg/* #^vendor/* -# BAD: pkg/version/version.go currently depends on lib/migration/feature, but should not +# TODO[#8299]: pkg/version/version.go currently depends on lib/migration/feature, but should not ^lib/migration/feature/* diff --git a/pkg/vsphere/.godeps_rules b/pkg/vsphere/.godeps_rules index 19996c1fde..69b9cba224 100644 --- a/pkg/vsphere/.godeps_rules +++ b/pkg/vsphere/.godeps_rules @@ -2,7 +2,7 @@ ^pkg/* ^vendor/* -# BAD: pkg/vsphere/session/session.go currently depends on lib/config, but should not +# TODO[#8300]: pkg/vsphere/session/session.go currently depends on lib/config, but should not ^lib/config/* ^lib/config/executor/* ^lib/migration/feature/* diff --git a/pkg/vsphere/test/.godeps_rules b/pkg/vsphere/test/.godeps_rules index ce9329e0b4..9933bdb38c 100644 --- a/pkg/vsphere/test/.godeps_rules +++ b/pkg/vsphere/test/.godeps_rules @@ -2,11 +2,11 @@ ^pkg/* ^vendor/* -# BAD: pkg/vsphere/session/session.go currently depends on lib/config, but should not +# TODO[#8300]: pkg/vsphere/session/session.go currently depends on lib/config, but should not ^lib/config/* ^lib/config/executor/* ^lib/migration/feature/* -# BAD: pkg/vsphere/test/test.go currently depends on lib/spec, but should not +# TODO[#8301]: pkg/vsphere/test/test.go currently depends on lib/spec, but should not ^lib/constants/* ^lib/spec/*