[VOL-5009] - Update release notes
config.mk
makefiles/*
-----------
o Refresh library makefiles from https://github.com/opencord/onf-make.
o More lint targets added with exclusions in config.mk
makefiles/virtualenv.mk
patches/lib/python3.10/site-packages/robot/utils/normalizing.py/patch
patches/lib/python3.10/site-packages/robot/utils/robottypes3.py/patch
patches/python_310_migration.sh
---------------------------------------------------------------------
o Continue normalizing virtualenv install directory.
o Update patches to modify .venv VS vst_venv [, vdoc_venv, vfoo_venv, vbar_venv, ...)
o virtualenv.mk now defines named targets for patching-up-to 3.10 installs.
release_notes/voltha_2.12.rst
-----------------------------
o Update version string info.
o Onos component table condensed and populated with versioned urls.
o voltha components table is a WIP.
howto/release/repositories/
---------------------------
o Begin capturing repo-specific activities for release.
o Silly having to figure this out each release cycle.
o Automation and release helper scripts can be found here:
- https://github.com/joey-onf/voltha-release
sphinx_conf/exclude_patterns.py
-------------------------------
o Roach squashing exercise, external repos pulled in as git-submodules.
o New repository files appear as problems when running 'make reload'
o Exclude files to squelch messages.
Change-Id: I7adf7b84498511f5cde1e43ad304f9e33283241e
diff --git a/makefiles/bin/compare_sandbox_makefiles.sh b/makefiles/bin/compare_sandbox_makefiles.sh
new file mode 100755
index 0000000..6075386
--- /dev/null
+++ b/makefiles/bin/compare_sandbox_makefiles.sh
@@ -0,0 +1,77 @@
+#!/bin/bash
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefile.version = 1.0
+# -----------------------------------------------------------------------
+# Intent: This script is used to bulk refactor and merge makefile changes
+## between development repositories and repo:onf-make.
+## -----------------------------------------------------------------------
+
+## -----------------------------------------------------------------------
+## Intent:
+## -----------------------------------------------------------------------
+function error
+{
+ echo "$*"
+ exit 1
+}
+
+##----------------##
+##---] MAIN [---##
+##----------------##
+# src="$HOME/projects/sandbox/onf-make/makefiles"
+# src="$HOME/projects/sandbox/ci-management/makefiles"
+src="$HOME/projects/sandbox/onf-make-all/20230709/makefiles"
+
+dst="$(realpath .)"
+
+[[ $# -eq 0 ]] && error "At least one directory or file is required"
+
+while [ $# -gt 0 ]; do
+ fyl=$1; shift
+
+ echo "FYL: $fyl"
+ if [ -d "$fyl" ]; then
+ readarray -t fyls < <(find "$fyl" -type f -print)
+ [[ ${#@} -gt 0 ]] && fyls+=("$@")
+ # declare -p fyls
+ [[ ${#fyls} -gt 0 ]] && set -- "${fyls[@]}"
+ continue
+ fi
+
+ case "$fyl" in
+ *~) continue ;;
+ '#*#') continue ;;
+ '\.#*') continue ;;
+ esac
+
+ src0="$src/$fyl"
+ dst0="$dst/$fyl"
+
+ [[ ! -e "$src0" ]] && error "File does not exist in src= $src0"
+ [[ ! -e "$dst0" ]] && error "File does not exist in dst= $dst0"
+
+ if ! diff -qr "$src0" "$dst0"; then
+ emacs "$src0" "$dst0"
+ fi
+done
+
+# [EOF]
+
diff --git a/makefiles/bootstrap.mk b/makefiles/bootstrap.mk
new file mode 100644
index 0000000..5a9433b
--- /dev/null
+++ b/makefiles/bootstrap.mk
@@ -0,0 +1,61 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Intent: Dependency-free macros used to source library makefiles
+# and define the build environment.
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG-bootstrap_mk),$(warning ENTER))
+
+##---------------------##
+##---] CONSTANTS [---##
+##---------------------##
+is-false = $(if $(1),true,$(null))
+is-true = $(if $(1),$(null),true)
+
+##--------------------------##
+##---] LIBRARY MACROS [---##
+##--------------------------##
+is-null = $(if $(1),$(null),$(error $(1)= is undef))
+is-null-var = $(if $$(1),$(null),$(error $(1)= is undef))
+is-null-var-indirect = $(if $(1),$(null),$(error $(1)= is undef))
+
+## variable flavor:
+# origin - undefned
+# default
+# environment
+# environment override
+# automatic
+# null(blah) ? - true
+
+## -----------------------------------------------------------------------
+## Intent: Given an indirect var containing varname of a makefile *_ROOT
+## parent director, derive a *_MKDIR variable and conditionally
+## include the makefile hierarchy.
+## -----------------------------------------------------------------------
+## Given:
+## o var containing OPT_ROOT=path
+## Return:
+## o OPT_MKDIR=$(OPT_ROOT)/makefiles
+## o If exists include $(OPT_MKDIR)/include.mk
+## -----------------------------------------------------------------------
+mk-library-include=$(strip \
+ $(warning mk-library-include: $(1) = $($(1)))\
+ $(call is-null-var,1)\
+ $(foreach var,$$(1),\
+ $(info var=$(var) is-null=$(call is-null-var,var))\
+ $(foreach val,$$(var),\
+ $(info val=$(val))\
+ $(foreach makedir,$(subst _ROOT,_MKDIR,$(var)),\
+$(warning makedir=$(makedir))\
+ $(if $($(makedir)),$(null),\
+ $(eval $(makedir)=$$$$($(var))/makefiles)\
+$(warning $(makedir) = $($($(makedir))))\
+$(info $$(wildcard $(val)/makefiles/include.mk) = $(wildcard $(val)/makefiles/include.mk))\
+ $(foreach mf,$(wildcard $(wildcard $(val)/makefiles/include.mk)),\
+$(warning $$(eval include $(mf)))\
+ $(eval include $(mf)))\
+)
+
+$(if $(DEBUG-bootstrap_mk),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/commands/include.mk b/makefiles/commands/include.mk
new file mode 100644
index 0000000..01fa145
--- /dev/null
+++ b/makefiles/commands/include.mk
@@ -0,0 +1,36 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefile.version = 1.0
+# -----------------------------------------------------------------------
+
+ifndef mk-include--onf-commands
+
+$(if $(DEBUG),$(warning ENTER))
+
+include $(ONF_MAKEDIR)/commands/kail.mk
+
+$(if $(DEBUG),$(warning LEAVE))
+
+mk-include--onf-commands := true
+
+endif # mk-include--onf-make
+
+# [EOF]
diff --git a/makefiles/commands/kail.mk b/makefiles/commands/kail.mk
new file mode 100644
index 0000000..ff6691d
--- /dev/null
+++ b/makefiles/commands/kail.mk
@@ -0,0 +1,46 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+MAKEDIR ?= $(error MAKEDIR= is required)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help::
+ @echo " kail Install the kail command"
+ifdef VERBOSE
+ @echo " make kail KAIL_PATH="
+endif
+
+# -----------------------------------------------------------------------
+# Install the 'kail' tool if needed: https://github.com/boz/kail
+# o WORKSPACE - jenkins aware
+# o Default to /usr/local/bin/kail
+# + revisit this, system directories should not be a default path.
+# + requires sudo and potential exists for overwrite conflict.
+# -----------------------------------------------------------------------
+KAIL_PATH ?= $(if $(WORKSPACE),$(WORKSPACE)/bin,/usr/local/bin)
+kail-cmd ?= $(KAIL_PATH)/kail
+$(kail-cmd):
+ etc/godownloader.sh -b .
+ rsync -v --checksum kail "$@"
+ $@ version
+ $(RM) kail
+
+.PHONY: kail
+kail : $(kail-cmd)
+
+# [EOF]
diff --git a/makefiles/etc/include.mk b/makefiles/etc/include.mk
new file mode 100644
index 0000000..a48b42c
--- /dev/null
+++ b/makefiles/etc/include.mk
@@ -0,0 +1,48 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+# Usage:
+#
+# mytarget:
+# $(call banner-enter,target $@)
+# @echo "Hello World"
+# $(call banner-leave,target $@)
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+target-banner = ** ---------------------------------------------------------------------------
+
+## -----------------------------------------------------------------------
+## Intent: Return a command line able to display a banner hilighting
+## make target processing within a logfile.
+## -----------------------------------------------------------------------
+banner-enter=\
+ @echo -e \
+ "\n"\
+ "$(target-banner)\n"\
+ "** $(MAKE) ENTER: $(1)\n"\
+ "$(target-banner)"\
+
+banner-leave=\
+ @echo -e "** $(MAKE) LEAVE: $(1)"
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/etc/todo.mk b/makefiles/etc/todo.mk
new file mode 100644
index 0000000..31fc736
--- /dev/null
+++ b/makefiles/etc/todo.mk
@@ -0,0 +1,21 @@
+## -----------------------------------------------------------------------
+## Intent: Cast value into a boolean string.
+## NOTE: : Careful with line comment placement, when octolthorp is indented
+## in a makefile return value will have whitespace appended.
+## -----------------------------------------------------------------------
+boolean = $(if $(strip $($(1))),false,true)# trailing whitespace is bad here
+
+## -----------------------------------------------------------------------
+## Intet: Negate input value for conditional use.
+## Return success when input value is null.
+## Usage:
+## $(info ** defined[true] = $(call not,value))
+## $(info ** defined[false] = $(call not,$(null)))
+## $(if $(call not,varname),$(error varname= is not set))
+## -----------------------------------------------------------------------
+not = $(strip \
+ $(foreach true-false\
+ ,$(info true-false=$(true-false))$(strip $(call boolean,$(1)))\
+ $(subst true,$(null),$(true-false))\
+ )\
+)
diff --git a/makefiles/gerrit/help.mk b/makefiles/gerrit/help.mk
new file mode 100644
index 0000000..2ba155b
--- /dev/null
+++ b/makefiles/gerrit/help.mk
@@ -0,0 +1,30 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+# -----------------------------------------------------------------------
+# -----------------------------------------------------------------------
+help-summary ::
+ @echo ' help-gerrit Display help for gerrit targets'
+
+help-verbose :: help-gerrit
+
+help-gerrit:
+ @echo
+ @echo '[GERRIT]'
+ @echo ' replication-status Report sync status of the gerrit-to-github mirror.'
+
+# [EOF]
diff --git a/makefiles/gerrit/include.mk b/makefiles/gerrit/include.mk
new file mode 100644
index 0000000..5ae76a4
--- /dev/null
+++ b/makefiles/gerrit/include.mk
@@ -0,0 +1,44 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+##--------------------##
+##---] INCLUDES [---##
+##--------------------##
+include $(ONF_MAKEDIR)/gerrit/help.mk
+
+# -----------------------------------------------------------------------
+# -----------------------------------------------------------------------
+replication-status:
+ ssh gerrit.opencord.org replication list --detail
+
+# -----------------------------------------------------------------------
+# NOTE: Gerrit ssh targets assume use of ~/.ssh config files
+# port, login, etc are
+# -----------------------------------------------------------------------
+# % ssh -p 29418 <username>@gerrit.opencord.org replication list --detail
+# % ssh gerrit.opencord.org replication list --detail
+# -----------------------------------------------------------------------
+# Host gerrit.opencord.org
+# Hostname gerrit.opencord.org
+# IdentityFile ~/.ssh/gerrit.opencord.org/{ssh_keyfile}
+# IdentitiesOnly yes
+# AddKeysToAgent yes
+# Port 29418
+# User tux@opennetworking.org
+# -----------------------------------------------------------------------
+
+# [EOF]
diff --git a/makefiles/git/ci-management.mk b/makefiles/git/ci-management.mk
new file mode 100644
index 0000000..373dc23
--- /dev/null
+++ b/makefiles/git/ci-management.mk
@@ -0,0 +1,80 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+GIT ?= git
+
+## -----------------------------------------------------------------------
+## Intent: Checkout submodules required by ci-management
+## -----------------------------------------------------------------------
+submodule-repos := $(null)
+submodule-repos += global-jjb
+submodule-repos += lf-ansible
+submodule-repos += packer
+
+submodule-deps := $(null)
+submodule-deps += submodules# # named pseudo target
+submodule-deps += $(submodule-repos)
+
+.PHONY: $(submodule-deps)
+$(submodule-deps):
+ @echo
+ @echo "Checkout dependent submodules"
+ $(GIT) submodule init
+ $(GIT) submodule update
+
+# Abstraction: named target for submodule checkout
+checkout-ci-management-sub-modules: $(submodule-repos)
+
+## -----------------------------------------------------------------------
+## Intent: Revert sandbox to a pristine state.
+## -----------------------------------------------------------------------
+sterile ::
+ $(RM) -r $(submodule-repos)
+
+ # FIXME:
+ # o restore hierarchy to avoid git status 'deleted:'
+ # o remove: externals should not be under revision control
+ $(GIT) co $(submodule-repos)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help ::
+ @echo
+ @echo '[GIT-SUBMODULES: docs]'
+ @echo ' reload Setup to auto-reload sphinx doc changes in browser'
+ @echo
+ @echo '[GIT-SUBMODULES: deps]'
+ @echo ' submodules Checkout dependent git submodules'
+ ifdef VERBOSE
+ @echo ' global-jjb Checkout ci-management submodule global-jjb'
+ @echo ' lf-ansible Checkout ci-management submodule lf-ansible'
+ @echo ' packer Checkout ci-management submodule packer'
+ endif
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+todo ::
+ @echo "Generalize logc, update to depend on .git/ rather than named targets."
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/git/help.mk b/makefiles/git/help.mk
new file mode 100644
index 0000000..cbd33ee
--- /dev/null
+++ b/makefiles/git/help.mk
@@ -0,0 +1,31 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+# Intent: Helper makefile target used to setup for a release
+# -----------------------------------------------------------------------
+
+## ---------------------------------------------------------------------------
+## Intent: Display supported targets
+## ---------------------------------------------------------------------------
+help-onf-git :
+ @echo
+ @echo '[GIT]'
+ @echo ' show-submodules Display a list of repository submodules and versions'
+
+help ::
+ @echo ' help-onf-git Display git makefile targets'
+
+# [EOF]
diff --git a/makefiles/git/include.mk b/makefiles/git/include.mk
new file mode 100644
index 0000000..9d2558c
--- /dev/null
+++ b/makefiles/git/include.mk
@@ -0,0 +1,37 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##--------------------##
+##---] INCLUDES [---##
+##--------------------##
+include $(ONF_MAKEDIR)/git/help.mk
+include $(ONF_MAKEDIR)/git/required.mk
+
+## Special snowflakes: per-repository logic
+-include $(ONF_MAKEDIR)/git/$(--repo-name--).mk
+
+ifdef USE-ONF-GIT-MK
+ # Dynamic loading when targets are requested by name
+ include $(ONF_MAKEDIR)/git/submodules.mk
+endif
+
+# [EOF]
diff --git a/makefiles/git/required.mk b/makefiles/git/required.mk
new file mode 100644
index 0000000..44f498d
--- /dev/null
+++ b/makefiles/git/required.mk
@@ -0,0 +1,32 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+# Intent: Conditionally load when named targets are requested.
+# var ?= $(error ...) definitions are fatal to "make help" and others
+# -----------------------------------------------------------------------
+
+git-mk-targets := $(NULL)
+git-mk-targets := show-submodules
+
+# -----------------------------------------------------------------------
+# Define a flag to only load release targets when mentioned by name
+# Makefile can also explicitly define the flag to force always loading.
+# -----------------------------------------------------------------------
+$(foreach tgt,$(git-mk-targets),\
+ $(if $(findstring $(tgt),$(MAKECMDGOALS)),$(eval USE-ONF-GIT-MK := true))\
+)
+
+# [EOF]
diff --git a/makefiles/git/submodules.mk b/makefiles/git/submodules.mk
new file mode 100644
index 0000000..42c2fc2
--- /dev/null
+++ b/makefiles/git/submodules.mk
@@ -0,0 +1,57 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+show-submodules:
+
+ $(HIDE)cat .gitmodules
+
+ @echo
+ $(HIDE) git submodule
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# https://github.com/lfit/releng-global-jjb/tags
+# git checkout v0.86.7
+# [crucible:global-jjb] git checkout v0.86.7
+# Previous HEAD position was 5dc3432 Update regexp in lf-infra-ship-logs macro
+# HEAD is now at c5bd1d3 Fix: Pin urllib3~=1.26.15 in pypi dist jobs
+
+# 5dc3432cae2f13d9e5151a00a76a78ce73d92d70 global-jjb (v0.53.3)
+# 0d88f8b7a24b53b1c3e189e30ab94373c51eea91 lf-ansible (0d88f8b)
+# 4a5b0cd9032938194c4813fe36663ddee4f9e60e packer/common-packer (v0.1.0~22)
+
+# https://stackoverflow.com/questions/30301510/git-submodule-specify-version
+# cd global-jjb
+# git checkout v0.86.7
+# cd -
+# git commit . -m "use submodule v0.86.7"
+
+# https://github.com/lfit/releng-lf-ansible.git
+# tag==master, no release
+
+# https://github.com/lfit/releng-common-packer.git
+# cd packer/common-packer
+# git checkout v0.12.1
+# cd -
+# git commit . -m "use submodule v0.12.1""
+
+# [EOF]
diff --git a/makefiles/include.mk b/makefiles/include.mk
index db96771..0536563 100644
--- a/makefiles/include.mk
+++ b/makefiles/include.mk
@@ -1,6 +1,6 @@
# -*- makefile -*-
# -----------------------------------------------------------------------
-# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,32 +13,63 @@
# 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.
-#
-# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# -----------------------------------------------------------------------
+# SPDX-FileCopyrightText: 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefiles.include.version = 1.1
+# -----------------------------------------------------------------------
+
+ifndef mk-include--onf-make # single-include guard macro
$(if $(DEBUG),$(warning ENTER))
-# OPT_ROOT ?= /opt/trainlab/current
-# OPT_MAKEDIR := $(OPT_ROOT)/makefiles
-# MAKEDIR ?= $(OPT_MAKEDIR)
+## -----------------------------------------------------------------------
+## Define vars based on relative import (normalize symlinks)
+## Usage: include makefiles/onf/include.mk
+## -----------------------------------------------------------------------
+onf-mk-abs ?= $(abspath $(lastword $(MAKEFILE_LIST)))
+onf-mk-top := $(subst /include.mk,$(null),$(onf-mk-abs))
+ONF_MAKEDIR := $(onf-mk-top)
-ONF_MAKE ?= $(MAKEDIR)# [TODO] -- local and library makefiles/ needed.
-ONF_MAKE ?= $(error ONF_MAKE= is required)
+TOP ?= $(patsubst %/makefiles/include.mk,%,$(onf-mk-abs))
-include $(ONF_MAKE)/consts.mk
-include $(ONF_MAKE)/help/include.mk
+include $(ONF_MAKEDIR)/consts.mk
+include $(ONF_MAKEDIR)/help/include.mk # render target help
+include $(ONF_MAKEDIR)/utils/include.mk # dependency-less helper macros
+include $(ONF_MAKEDIR)/etc/include.mk # banner macros
+include $(ONF_MAKEDIR)/commands/include.mk # Tools and local installers
-include $(ONF_MAKE)/virtualenv.mk# # lint-{jjb,python} depends on venv
-include $(ONF_MAKE)/lint/include.mk
-include $(ONF_MAKE)/todo.mk
-include $(MAKEDIR)/patches/include.mk# # Patch when python 3.10+ in use
-include $(ONF_MAKE)/help/variables.mk
+include $(ONF_MAKEDIR)/virtualenv.mk# # lint-{jjb,python} depends on venv
+include $(ONF_MAKEDIR)/patches/include.mk# # Patch when python 3.10+ in use
+include $(ONF_MAKEDIR)/lint/include.mk
-include $(ONF_MAKE)/targets/include.mk
+include $(ONF_MAKEDIR)/gerrit/include.mk
+include $(ONF_MAKEDIR)/git/include.mk
+include $(ONF_MAKEDIR)/jjb/include.mk
+$(if $(USE-VOLTHA-RELEASE-MK),\
+ $(eval include $(ONF_MAKEDIR)/release/include.mk))
+
+include $(ONF_MAKEDIR)/todo.mk
+include $(ONF_MAKEDIR)/help/variables.mk
+
+##---------------------##
+##---] ON_DEMAND [---##
+##---------------------##
+$(if $(USE-ONF-GERRIT-MK),$(eval include $(ONF_MAKEDIR)/gerrit/include.mk))
+$(if $(USE-ONF-DOCKER-MK),$(eval include $(ONF_MAKEDIR)/docker/include.mk))
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+include $(ONF_MAKEDIR)/targets/include.mk # clean, sterile
$(if $(DEBUG),$(warning LEAVE))
+mk-include--onf-make := true
+
+endif # mk-include--onf-make
+
# [EOF]
diff --git a/makefiles/targets/tox.mk b/makefiles/jjb/help.mk
similarity index 65%
copy from makefiles/targets/tox.mk
copy to makefiles/jjb/help.mk
index 5942774..331c68a 100644
--- a/makefiles/targets/tox.mk
+++ b/makefiles/jjb/help.mk
@@ -13,29 +13,26 @@
# 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.
-#
-# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
-# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+# Intent: Helper makefile target used to setup for a release
# -----------------------------------------------------------------------
-$(if $(DEBUG),$(warning ENTER))
-
-## -----------------------------------------------------------------------
-## Intent: Sanity check incoming JJB config changes.
-## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
-## -----------------------------------------------------------------------
-# lint : lint-jjb
-lint-tox: lint-jjb
- tox -e py310 --workers=auto
-
-## -----------------------------------------------------------------------
-## -----------------------------------------------------------------------
-help-verbose += help-tox
-help-tox ::
+## ---------------------------------------------------------------------------
+## Intent: Display supported targets
+## ---------------------------------------------------------------------------
+help-jjb:
@echo
- @echo '[MAKE: tox]'
- @echo ' lint-tox Python unit testing, sanity check incoming JJB changes.'
+ @echo '[JJB]'
+ @echo ' jjb-gen Generate a local set of JJB pipelines'
-$(if $(DEBUG),$(warning LEAVE))
+ ifdef VERBOSE
+ @echo ' LOGS=1 Display log from jjb-gen target'
+ @echo ' VERBOSE=1 Display generated pipeline files'
+ endif
+
+## ---------------------------------------------------------------------------
+## ---------------------------------------------------------------------------
+help ::
+ @echo ' help-jjb Display Jenkins Job Builder targets'
# [EOF]
diff --git a/makefiles/jjb/include.mk b/makefiles/jjb/include.mk
new file mode 100644
index 0000000..7d213b4
--- /dev/null
+++ b/makefiles/jjb/include.mk
@@ -0,0 +1,36 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##--------------------##
+##---] INCLUDES [---##
+##--------------------##
+include $(ONF_MAKEDIR)/jjb/help.mk
+include $(ONF_MAKEDIR)/jjb/required.mk
+
+ifdef USE-ONF-JJB-MK
+ # Dynamic loading when targets are requested by name
+ include $(ONF_MAKEDIR)/jjb/targets.mk
+endif
+
+# [EOF]
+
+
diff --git a/makefiles/jjb/required.mk b/makefiles/jjb/required.mk
new file mode 100644
index 0000000..17371e9
--- /dev/null
+++ b/makefiles/jjb/required.mk
@@ -0,0 +1,33 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+# Intent: Conditionally load when named targets are requested.
+# var ?= $(error ...) definitions are fatal to "make help" and others
+# -----------------------------------------------------------------------
+
+onf-mk-jjb-targets := $(NULL)
+onf-mk-jjb-targets += jjb-gen
+onf-mk-jjb-targets += sterile
+
+# -----------------------------------------------------------------------
+# Define a flag to only load release targets when mentioned by name
+# Makefile can also explicitly define the flag to force always loading.
+# -----------------------------------------------------------------------
+$(foreach tgt,$(onf-mk-jjb-targets),\
+ $(if $(findstring $(tgt),$(MAKECMDGOALS)),$(eval USE-ONF-JJB-MK := true))\
+)
+
+# [EOF]
diff --git a/makefiles/jjb/targets.mk b/makefiles/jjb/targets.mk
new file mode 100644
index 0000000..730d229
--- /dev/null
+++ b/makefiles/jjb/targets.mk
@@ -0,0 +1,65 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+# Intent: Helper makefile target used to setup for a release
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+jjb-gen-dir := build
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+all: help
+
+## -----------------------------------------------------------------------
+## Intent: Generate pipeline jobs
+## -----------------------------------------------------------------------
+.PHONY: jjb-gen
+
+jjb-gen-log := $(jjb-gen-dir)/jjb-gen.log
+jjb-gen:
+ $(call banner-enter,Target $@)
+ @mkdir -p $(jjb-gen-dir)
+ @touch "$(jjb-gen-dir)/.sentinel"
+ ( $(activate) \
+ && jenkins-jobs test $(PWD)/jjb -o $(jjb-gen-dir) 3>&1 2>&1 \
+ ) | tee "$(jjb-gen-log)"
+
+ ifdef LOGS
+ -@less "$(jjb-gen-log)"
+ endif
+
+ ifdef VERBOSE
+ @echo
+ @echo "** Display generated pipelines"
+ find "$(jjb-gen-dir)" -newer "$(jjb-gen-dir)/.sentinel" -ls
+ endif
+
+ $(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+sterile ::
+ $(RM) -r $(jjb-gen-dir)
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/Makefile b/makefiles/lint/Makefile
new file mode 100644
index 0000000..2754d0f
--- /dev/null
+++ b/makefiles/lint/Makefile
@@ -0,0 +1,93 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+#
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+.DEFAULT_GOAL := test
+
+HIDE ?= @
+SHELL := bash -e -o pipefail
+
+dot ?= .
+TOP ?= $(dot)
+MAKEDIR ?= $(TOP)/makefiles
+
+env-clean = /usr/bin/env --ignore-environment
+
+jq = $(env-clean) jq
+jq-args += --exit-status
+
+YAMLLINT = $(shell which yamllint)
+yamllint := $(env-clean) $(YAMLLINT)
+yamllint-args := -c .yamllint
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+all:
+
+lint += lint-json
+lint += lint-yaml
+
+lint : $(lint)
+test : lint
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-yaml yaml-lint:
+ifeq ($(null),$(shell which yamllint))
+ $(error "Please install yamllint to run linting")
+endif
+ $(HIDE)$(env-clean) find . -name '*.yaml' -type f -print0 \
+ | xargs -0 -t -n1 $(yamllint) $(yamllint-args)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-json:
+ $(HIDE)$(env-clean) find . -name '*.json' -type f -print0 \
+ | xargs -0 -t -n1 $(jq) $(jq-args) $(dot) >/dev/null
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+pre-check:
+ @echo "[REQUIRED] Checking for linting tools"
+ $(HIDE)which jq
+ $(HIDE)which yamllint
+ @echo
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+clean:
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+todo:
+ @echo
+ @echo "USAGE: $(MAKE)"
+ @echo "[TODO]"
+ @echo " o Update to support standard makefile target behavior:"
+ @echo " all taget is test not default behavior for automation."
+ @echo " o Change lint target dep from test to check -or smoke"
+ @echo " target test sould be more involved with content validation"
+ @echo " o Refactor lint target(s) with voltha-system-tests/makefiles"
+ @echo " o Linting should be dependency driven,"
+ @echo " only check when sources are modified."
+ @echo
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help:
+ @echo
+ @echo "USAGE: $(MAKE)"
+ @echo " lint perform syntax checks on source"
+ @echo " test perform syntax checks on source"
+ @echo " pre-check Verify tools and deps are available for testing"
+ @echo
+ @echo "[LINT]"
+ @echo " lint-json Syntax check .json sources"
+ @echo " lint-yaml Syntax check .yaml sources"
+ @echo
+# [EOF]
diff --git a/makefiles/lint/doc8/include.mk b/makefiles/lint/doc8/include.mk
index d0263af..6490b89 100644
--- a/makefiles/lint/doc8/include.mk
+++ b/makefiles/lint/doc8/include.mk
@@ -36,7 +36,7 @@
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
-include $(MAKEDIR)/lint/doc8/excl.mk
+include $(ONF_MAKEDIR)/lint/doc8/excl.mk
ifdef lint-doc8-excl
lint-doc8-excl-args += $(addprefix --ignore-path$(space),$(lint-doc8-excl))
diff --git a/makefiles/lint/groovy/README.md b/makefiles/lint/groovy/README.md
new file mode 100644
index 0000000..aa9b41a
--- /dev/null
+++ b/makefiles/lint/groovy/README.md
@@ -0,0 +1,13 @@
+# lint: groovy source
+
+# Invoke the linting tool
+% make lint-groovy
+
+# Alt checking: groovy interpreter
+
+Odd syntax errors can be detected by the groovy interpreter.
+
+% groovy path/to/{source}.groovy
+
+jjb/ pipeline scripts will eventually due to syntax problems but groovy can
+still detect problems like mismatched quotes, invalid op tokens, etc.
diff --git a/makefiles/lint/groovy/include.mk b/makefiles/lint/groovy/include.mk
new file mode 100644
index 0000000..61719a8
--- /dev/null
+++ b/makefiles/lint/groovy/include.mk
@@ -0,0 +1,80 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefiles.lint.groovy.version = 1.1.1 (+local edits)
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+
+groovy-check := npm-groovy-lint
+
+groovy-check-args := $(null)
+# groovy-check-args += --loglevel info
+# groovy-check-args += --ignorepattern
+# groovy-check-args += --verbose
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+
+## -----------------------------------------------------------------------
+## Intent: Enabled by repository_sandbox_root/config.mk
+## -----------------------------------------------------------------------
+ifndef NO-LINT-GROOVY
+ lint : lint-groovy
+endif
+
+## -----------------------------------------------------------------------
+## Target type: lint all or individual files:
+## o make lint-groovy GROOVY_SRC="a/b/c.groovy d/e/f.groovy"
+## -----------------------------------------------------------------------
+lint-groovy : lint-groovy-$(if $(GROOVY_SRC),src,all)
+
+## -----------------------------------------------------------------------
+## Intent: Perform a lint check on command line script sources
+## -----------------------------------------------------------------------
+lint-groovy-all :
+ $(groovy-check) --version
+ @echo
+ $(HIDE)$(env-clean) find . -iname '*.groovy' -print0 \
+ | $(xargs-n1) $(groovy-check) $(groovy-check-args)
+
+## -----------------------------------------------------------------------
+## Intent: On-demand lint checking
+## -----------------------------------------------------------------------
+lint-groovy-src :
+ ifndef GROOVY_SRC
+ @echo "ERROR: Usage: $(MAKE) $@ GROOVY_SRC="
+ @exit 1
+ endif
+ $(groovy-check) --version
+ @echo
+ $(HIDE) $(groovy-check) $(groovy-check-args) $(GROOVY_SRC)
+
+## -----------------------------------------------------------------------
+## Intent: Display command help
+## -----------------------------------------------------------------------
+help-summary ::
+ @echo ' lint-groovy Syntax check groovy sources'
+ ifdef VERBOSE
+ @echo ' lint-groovy-all Lint all sources'
+ @echo ' lint-groovy-src Lint only files listed in GROOVY_SRC='
+ endif
+
+# [EOF]
diff --git a/makefiles/lint/groovy/urls b/makefiles/lint/groovy/urls
new file mode 100644
index 0000000..aa5c5eb
--- /dev/null
+++ b/makefiles/lint/groovy/urls
@@ -0,0 +1,8 @@
+# -*- makefile -*-
+
+# Config file and exclusions
+https://www.npmjs.com/package/npm-groovy-lint#Configuration
+
+https://github.com/nvuillam/npm-groovy-lint
+
+# [EOF]
diff --git a/makefiles/lint/help.mk b/makefiles/lint/help.mk
new file mode 100644
index 0000000..24a5aa1
--- /dev/null
+++ b/makefiles/lint/help.mk
@@ -0,0 +1,31 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+help ::
+
+# -----------------------------------------------------------------------
+# -----------------------------------------------------------------------
+help-summary ::
+ @echo ' help-lint Display lint target help'
+
+help-simple :: help-lint
+help-lint :
+ @echo
+ @echo "[LINT]"
+ @echo ' help-lint Display lint target help'
+
+# [EOF]
diff --git a/makefiles/lint/include.mk b/makefiles/lint/include.mk
index 25d12e9..6586040 100644
--- a/makefiles/lint/include.mk
+++ b/makefiles/lint/include.mk
@@ -1,6 +1,6 @@
# -*- makefile -*-
# -----------------------------------------------------------------------
-# Copyright 2017-2023 Open Networking Foundation
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,36 +13,32 @@
# 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.
+#
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefile.version = 1.1
# -----------------------------------------------------------------------
$(if $(DEBUG),$(warning ENTER))
-# -----------------------------------------------------------------------
-# Intent: Display help banner early before library lint help targets.
-# -----------------------------------------------------------------------
-help::
+help ::
@echo
@echo "[LINT]"
-## Disable python linting in bulk ?
-ifdef NO-LINT-PYTHON
- NO-LINT-FLAKE8 := true
- NO-LINT-PYLINT := true
-endif
+include $(ONF_MAKEDIR)/lint/doc8/include.mk
+include $(ONF_MAKEDIR)/lint/groovy/include.mk
+include $(ONF_MAKEDIR)/lint/jjb.mk
+include $(ONF_MAKEDIR)/lint/json.mk
+include $(ONF_MAKEDIR)/lint/license/include.mk
+include $(ONF_MAKEDIR)/lint/makefile.mk
+include $(ONF_MAKEDIR)/lint/python/include.mk
+include $(ONF_MAKEDIR)/lint/shell.mk
+# include $(ONF_MAKEDIR)/lint/tox/include.mk
+include $(ONF_MAKEDIR)/lint/yaml.mk
-# Define early else {flake8,pylint}.mk will complain:
-# PYTHON_FILES ?= $(error)
-have-python-files := $(if $(strip $(PYTHON_FILES)),true)
-
-##--------------------##
-##---] INCLUDES [---##
-##--------------------##
-include $(MAKEDIR)/lint/doc8/include.mk
-include $(MAKEDIR)/lint/json.mk
-include $(MAKEDIR)/lint/python/include.mk
-include $(MAKEDIR)/lint/robot.mk
-include $(MAKEDIR)/lint/shell.mk
-include $(MAKEDIR)/lint/yaml.mk
+include $(ONF_MAKEDIR)/lint/help.mk
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/lint/jjb.mk b/makefiles/lint/jjb.mk
new file mode 100644
index 0000000..ccfa073
--- /dev/null
+++ b/makefiles/lint/jjb.mk
@@ -0,0 +1,60 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+.PHONY: lint-venv
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+ifndef NO-LINT-JJB
+ lint : lint-jjb
+endif
+
+## -----------------------------------------------------------------------
+## Intent: Construct command line for linting jenkins-job-builder config
+## -----------------------------------------------------------------------
+
+ifdef DEBUG
+ lint-jjb-args += --log_level DEBUG# # verbosity: high
+else
+ lint-jjb-args += --log_level INFO# # verbosity: default
+endif
+lint-jjb-args += --ignore-cache
+lint-jjb-args += test# # command action
+lint-jjb-args += -o archives/job-configs# # Generated jobs written here
+lint-jjb-args += --recursive
+lint-jjb-args += --config-xml# # JJB v3.0 write to OUTPUT/jobname/config.xml
+lint-jjb-args += jjb/# # JJB config sources (input)
+
+lint-jjb-deps := $(null)
+lint-jjb-deps += $(venv-activate-script)
+lint-jjb-deps += checkout-ci-management-sub-modules
+lint-jjb: $(lint-jjb-deps)
+ $(activate) && { jenkins-jobs $(lint-jjb-args); }
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help ::
+ @echo ' lint-jjb Validate jjb job generation'
+ifdef VERBOSE
+ @echo ' DEBUG=1 lint-jjb --log_level=DEBUG'
+endif
+
+# [EOF]
diff --git a/makefiles/targets/tox.mk b/makefiles/lint/license/include.mk
similarity index 67%
copy from makefiles/targets/tox.mk
copy to makefiles/lint/license/include.mk
index 5942774..2b42049 100644
--- a/makefiles/targets/tox.mk
+++ b/makefiles/lint/license/include.mk
@@ -13,29 +13,29 @@
# 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.
-#
-# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
-# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------
-$(if $(DEBUG),$(warning ENTER))
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+ifndef NO-LINT-REUSE
+ lint : lint-license
+endif
## -----------------------------------------------------------------------
-## Intent: Sanity check incoming JJB config changes.
-## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
+## Intent: Perform a lint check on makefile sources
## -----------------------------------------------------------------------
-# lint : lint-jjb
-lint-tox: lint-jjb
- tox -e py310 --workers=auto
+lint-license:
+ reuse --root . lint
## -----------------------------------------------------------------------
+## Intent: Display command help
## -----------------------------------------------------------------------
-help-verbose += help-tox
-help-tox ::
- @echo
- @echo '[MAKE: tox]'
- @echo ' lint-tox Python unit testing, sanity check incoming JJB changes.'
-
-$(if $(DEBUG),$(warning LEAVE))
+help-summary ::
+ @echo ' lint-reuse License syntax checking'
# [EOF]
diff --git a/makefiles/targets/tox.mk b/makefiles/lint/license/reuse.mk
similarity index 67%
copy from makefiles/targets/tox.mk
copy to makefiles/lint/license/reuse.mk
index 5942774..5572bef 100644
--- a/makefiles/targets/tox.mk
+++ b/makefiles/lint/license/reuse.mk
@@ -13,29 +13,29 @@
# 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.
-#
-# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
-# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------
-$(if $(DEBUG),$(warning ENTER))
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+ifndef NO-LINT-REUSE
+ lint : lint-license
+endif
## -----------------------------------------------------------------------
-## Intent: Sanity check incoming JJB config changes.
-## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
+## Intent: Perform a lint check on makefile sources
## -----------------------------------------------------------------------
-# lint : lint-jjb
-lint-tox: lint-jjb
- tox -e py310 --workers=auto
+lint-license:
+ reuse --root . lint
## -----------------------------------------------------------------------
+## Intent: Display command help
## -----------------------------------------------------------------------
-help-verbose += help-tox
-help-tox ::
- @echo
- @echo '[MAKE: tox]'
- @echo ' lint-tox Python unit testing, sanity check incoming JJB changes.'
-
-$(if $(DEBUG),$(warning LEAVE))
+help-summary ::
+ @echo ' lint-reuse License syntax checking"
# [EOF]
diff --git a/makefiles/lint/makefile.mk b/makefiles/lint/makefile.mk
new file mode 100644
index 0000000..27206e0
--- /dev/null
+++ b/makefiles/lint/makefile.mk
@@ -0,0 +1,65 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+xargs-n1-local := $(subst -t,$(null),$(xargs-n1))# inhibit cmd display
+
+# Gather sources to check
+# TODO: implement deps, only check modified files
+make-check-find := find . -name 'vendor' -prune
+make-check-find += -o \( -iname makefile -o -name '*.mk' \)
+make-check-find += -type f -print0
+
+make-check := $(MAKE)
+
+make-check-args += --dry-run
+make-check-args += --keep-going
+make-check-args += --warn-undefined-variables
+make-check-args += --no-print-directory
+
+# Quiet internal undef vars
+make-check-args += DEBUG=
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+ifndef NO-LINT-MAKEFILE
+ lint : lint-make
+endif
+
+## -----------------------------------------------------------------------
+## Intent: Perform a lint check on makefile sources
+## -----------------------------------------------------------------------
+lint-make-ignore += JSON_FILES=
+lint-make-ignore += YAML_FILES=
+lint-make:
+ @echo
+ @echo "** -----------------------------------------------------------------------"
+ @echo "** Makefile syntax checking"
+ @echo "** -----------------------------------------------------------------------"
+ $(HIDE)$(env-clean) $(make-check-find) \
+ | $(xargs-n1-local) $(make-check) $(make-check-args) $(lint-make-ignore)
+
+## -----------------------------------------------------------------------
+## Intent: Display command help
+## -----------------------------------------------------------------------
+help-summary ::
+ @echo ' lint-make Syntax check [Mm]akefile and *.mk'
+
+# [EOF]
diff --git a/makefiles/lint/python/find_utils.mk b/makefiles/lint/python/find_utils.mk
new file mode 100644
index 0000000..7ab4c4f
--- /dev/null
+++ b/makefiles/lint/python/find_utils.mk
@@ -0,0 +1,32 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Intent:
+# o Construct a find command able to gather python files with filtering.
+# o Used by library makefiles flake8.mk and pylint.mk for iteration.
+# -----------------------------------------------------------------------
+
+## -----------------------------------------------------------------------
+## Intent: Construct a string for invoking find \( excl-pattern \) -prune
+# -----------------------------------------------------------------------
+gen-python-find-excl = \
+ $(strip \
+ -name '__ignored__' \
+ $(foreach dir,$($(1)),-o -name $(dir)) \
+ )
+
+## -----------------------------------------------------------------------
+## Intent: Construct a find command to gather a list of python files
+## with exclusions.
+## -----------------------------------------------------------------------
+## Usage:
+# $(activate) & $(call gen-python-find-cmd) | $(args-n1) pylint
+## -----------------------------------------------------------------------
+gen-python-find-cmd = \
+ $(strip \
+ find . \
+ \( $(call gen-python-find-excl,onf-excl-dirs) \) -prune \
+ -o -name '*.py' \
+ -print0 \
+ )
+
+# [EOF]
diff --git a/makefiles/lint/python/flake8.mk b/makefiles/lint/python/flake8.mk
index bb474a9..cf1bc2b 100644
--- a/makefiles/lint/python/flake8.mk
+++ b/makefiles/lint/python/flake8.mk
@@ -32,18 +32,26 @@
## -----------------------------------------------------------------------
ifndef NO-LINT-FLAKE8
lint-flake8-mode := $(if $(have-python-files),modified,all)
- lint : lint-flake8-$(lint-flake8-mode)
+ lint : lint-flake8
+ lint-flake8 : lint-flake8-$(lint-flake8-mode)
endif# NO-LINT-FLAKE8
## -----------------------------------------------------------------------
## Intent: exhaustive flake8 syntax checking
## -----------------------------------------------------------------------
+# Construct: find . \( -name '__ignored__' -o -name dir -o name dir \)
+# flake8-find-filter := $(null)
+# flake8-find-filter += -name '__ignored__'# # for alignment
+# flake8-find-filter += $(foreach dir,$(onf-excl-dirs),-o -name $(dir)))
+
lint-flake8-all: $(venv-activate-script)
$(HIDE)$(MAKE) --no-print-directory lint-flake8-install
- $(activate)\
- && find . \( -name '$(venv-name)' \) -prune -o -name '*.py' -print0 \
- | $(xargs-n1) flake8 --max-line-length=99 --count
+ $(activate) && $(call gen-python-find-cmd) \
+ | $(xargs-n1) flake8 --max-line-length=99 --count
+
+# && find . \( $(flake8-find-filter) \) -prune -o -name '*.py' -print0 \
+# | $(xargs-n1) flake8 --max-line-length=99 --count
## -----------------------------------------------------------------------
## Intent: check deps for format and python3 cleanliness
@@ -78,6 +86,7 @@
@echo ' $(MAKE) lint-pylint PYTHON_FILES=...'
@echo ' lint-flake8-modified flake8 checking: only modified'
@echo ' lint-flake8-all flake8 checking: exhaustive'
+ @echo ' lint-flake8-install Install the flake8 command'
endif
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/lint/python/include.mk b/makefiles/lint/python/include.mk
index 69811a5..ce7d7af 100644
--- a/makefiles/lint/python/include.mk
+++ b/makefiles/lint/python/include.mk
@@ -15,13 +15,17 @@
# limitations under the License.
# -----------------------------------------------------------------------
+$(if $(DEBUG),$(warning ENTER))
+
##-------------------##
##---] GLOBALS [---##
##-------------------##
$(if $(UNSTABLE),$(eval lint-python-all := true))
-include $(MAKEDIR)/lint/python/flake8.mk
-include $(MAKEDIR)/lint/python/pylint.mk
-# include $(MAKEDIR)/lint/python/tox.mk
+include $(ONF_MAKEDIR)/lint/python/find_utils.mk
+include $(ONF_MAKEDIR)/lint/python/flake8.mk
+include $(ONF_MAKEDIR)/lint/python/pylint.mk
+
+$(if $(DEBUG),$(warning LEAVE))
# [EOF]
diff --git a/makefiles/lint/python/pylint.mk b/makefiles/lint/python/pylint.mk
index 9dc1c7c..87ffb43 100644
--- a/makefiles/lint/python/pylint.mk
+++ b/makefiles/lint/python/pylint.mk
@@ -34,21 +34,26 @@
## -----------------------------------------------------------------------
ifndef NO-LINT-PYLINT
lint-pylint-mode := $(if $(have-python-files),modified,all)
- lint : lint-pylint-$(lint-pylint-mode)
+ lint : lint-pylint
+ lint-pylint : lint-pylint-$(lint-pylint-mode)
endif# NO-LINT-PYLINT
## -----------------------------------------------------------------------
## Intent: exhaustive pylint syntax checking
## -----------------------------------------------------------------------
-pylint-find-args := $(null)
-pylint-find-args += -name '$(venv-name)'
-pylint-find-args += -o -name 'patches'
+
+# Construct: find . \( -name '__ignored__' -o -name dir -o name dir \)
+# pylint-find-filter := $(null)
+# pylint-find-filter += -name '__ignored__'# # for alignment
+# pylint-find-filter += $(foreach dir,$(onf-excl-dirs),-o -name $(dir)))
+
+# pylint-find-filter := $(call gen-python-find-excl,onf-excl-dirs)
+# $(error pylint-find-filter := $(pylint-find-filter))
lint-pylint-all: $(venv-activate-script)
$(MAKE) --no-print-directory lint-pylint-install
- $(activate)\
- && find . \( $(pylint-find-args) \) -prune -o -name '*.py' -print0 \
- | $(xargs-n1) pylint
+ $(activate) && $(call gen-python-find-cmd) | $(xargs-n1) pylint
+# | $(xargs-n1-clean) yamllint --strict
## -----------------------------------------------------------------------
## Intent: check deps for format and python3 cleanliness
@@ -82,6 +87,7 @@
@echo ' $(MAKE) lint-pylint PYTHON_FILES=...'
@echo ' lint-pylint-modified pylint checking: only modified'
@echo ' lint-pylint-all pylint checking: exhaustive'
+ @echo ' lint-pylint-install Install the pylint command'
endif
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/lint/robot.mk b/makefiles/lint/robot.mk
index fa8175c..6c67ad3 100644
--- a/makefiles/lint/robot.mk
+++ b/makefiles/lint/robot.mk
@@ -15,15 +15,7 @@
# limitations under the License.
# -----------------------------------------------------------------------
-$(if $(DEBUG),$(warning ENTER))
-
-##-------------------##
-##---] GLOBALS [---##
-##-------------------##
-.PHONY: lint-robot lint-robot-all lint-robot-modified
-
-have-robot-files := $(if $(ROBOT_FILES),true)
-ROBOT_FILES ?= $(error ROBOT_FILES= required)
+ROBOT_FILES ?= $(error ROBOT_FILES= is required)
LINT_ARGS ?= --verbose --configure LineTooLong:130 -e LineTooLong \
--configure TooManyTestSteps:65 -e TooManyTestSteps \
@@ -33,62 +25,19 @@
--configure FileTooLong:2000 -e FileTooLong \
-e TrailingWhitespace
-## -----------------------------------------------------------------------
-## Intent: Use the robot command to perform syntax checking.
-## % make lint
-## % make lint-robot-all
-## % make lint-robot-modified
-## -----------------------------------------------------------------------
+
+.PHONY: lint-robot
+
ifndef NO-LINT-ROBOT
- lint-robot-mode := $(if $(have-robot-files),modified,all)
- lint : lint-robot-$(lint-robot-mode)
-endif# NO-LINT-ROBOT
+ lint : lint-robot
+endif
-## -----------------------------------------------------------------------
-## Intent: exhaustive robot syntax checking
-## -----------------------------------------------------------------------
-lint-robot-all:
- $(HIDE)$(MAKE) --no-print-directory rflint-install
+lint-robot: vst_venv
+ source ./$</bin/activate \
+ ; set -u \
+ ; rflint $(LINT_ARGS) $(ROBOT_FILES)
- $(activate)\
- && find . \( -iname '*.robot' \) -print0 \
- | $(xargs-n1) rflint $(LINT_ARGS)
-
-## -----------------------------------------------------------------------
-## Intent: check deps for format and python3 cleanliness
-## Note:
-## robot --py3k option no longer supported
-## -----------------------------------------------------------------------
-lint-robot-modified: $(venv-activate-script)
- $(HIDE)$(MAKE) --no-print-directory rflint-install
-
- $(activate) && rflint $(LINT_ARGS) $(ROBOT_FILES)
-
-## -----------------------------------------------------------------------
-## Intent: Install the rflint command for syntax checking.
-## Note: requirements.txt pip install not used here ATM due to implicit
-## per-repository dependency config to enable checking.
-## -----------------------------------------------------------------------
-rflint-install: $(venv-activate-script)
- @echo
- @echo "** -----------------------------------------------------------------------"
- @echo "** robot syntax checking"
- @echo "** -----------------------------------------------------------------------"
- $(activate)\
- && pip install --upgrade robotframework-lint
- $(activate) && rflint --version
- @echo
-
-## -----------------------------------------------------------------------
-## Intent: Display command usage
-## -----------------------------------------------------------------------
help::
- @echo ' lint-robot Syntax check python using the robot command'
- ifdef VERBOSE
- @echo ' lint-robot-all robot checking: exhaustive'
- @echo ' lint-robot-modified robot checking: only modified'
- endif
-
-$(if $(DEBUG),$(warning LEAVE))
+ @echo " lint-robot Syntax check robot sources using rflint"
# [EOF]
diff --git a/makefiles/lint/shell.mk b/makefiles/lint/shell.mk
index 3c04539..3c33bb2 100644
--- a/makefiles/lint/shell.mk
+++ b/makefiles/lint/shell.mk
@@ -1,8 +1,8 @@
# -*- makefile -*-
# -----------------------------------------------------------------------
-# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
#
-# Licensed under the Apache License, Version 2.0 (the "License")
+# 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
#
@@ -14,74 +14,52 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# -----------------------------------------------------------------------
-
-$(if $(DEBUG),$(warning ENTER))
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefile.version = 1.0
+# -----------------------------------------------------------------------
##-------------------##
##---] GLOBALS [---##
##-------------------##
-.PHONY: lint-shell lint-shell-all lint-shell-modified
-have-shell-sources := $(if $(strip $(SHELL_SOURCES)),true)
-SHELL_SOURCES ?= $(error SHELL_SOURCES= required)
+# Gather sources to check
+# TODO: implement deps, only check modified files
+shell-check-find := find .
+# vendor scripts but they really should be lintable
+shell-check-find += -name 'vendor' -prune
+shell-check-find += -o \( -name '*.sh' \)
+shell-check-find += -type f -print0
-## -----------------------------------------------------------------------
-## Intent: Use the shell command to perform syntax checking.
-## % make lint
-## % make lint-shell-all
-## -----------------------------------------------------------------------
+shell-check := $(env-clean) shellcheck
+# shell-check := shellcheck
+
+shell-check-args += --check-sourced
+shell-check-args += --external-sources
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
ifndef NO-LINT-SHELL
- lint-shell-mode := $(if $(have-shell-sources),modified,all)
- lint : lint-shell-$(lint-shell-mode)
-endif# NO-LINT-SHELL
+ lint : lint-shell
+endif
## -----------------------------------------------------------------------
-## Intent: exhaustive shell syntax checking
+## Intent: Perform a lint check on command line script sources
## -----------------------------------------------------------------------
-shellcheck-find-args := $(null)
-shellcheck-find-args += -name '$(venv-name)'
-shellcheck-find-args += -o -name 'staging'
-lint-shell-all:
- $(MAKE) --no-print-directory lint-shellcheck-install
-
- find . \( $(shellcheck-find-args) \) -prune -name '*.sh' -print0 \
- | $(xargs-n1-clean) shellcheck
-
-## -----------------------------------------------------------------------
-## Intent: check deps for format and python3 cleanliness
-## Note:
-## shell --py3k option no longer supported
-## -----------------------------------------------------------------------
-lint-shell-modified:
- $(MAKE) --no-print-directory lint-shell-install
-
- shellcheck $(SHELL_SOURCES)
-
-## -----------------------------------------------------------------------
-## Intent:
-## -----------------------------------------------------------------------
-.PHONY: lint-shellcheck-install
-lint-shellcheck-install:
+lint-shell:
+ $(shell-check) -V
@echo
- @echo "** -----------------------------------------------------------------------"
- @echo '** command shell syntax checking'
- @echo "** -----------------------------------------------------------------------"
-
- # {apt-get,rpm,yum} install shellcheck
- shellcheck --version
- @echo
+ $(HIDE)$(env-clean) $(shell-check-find) \
+ | $(xargs-n1) $(shell-check) $(shell-check-args)
## -----------------------------------------------------------------------
-## Intent: Display command usage
+## Intent: Display command help
## -----------------------------------------------------------------------
-help::
- @echo ' lint-shell Syntax check sources using shellcheck'
- ifdef VERBOSE
- @echo ' $(MAKE) lint-shell SHELL_SOURCES=...'
- @echo ' lint-shell-modified shell checking: only modified'
- @echo ' lint-shell-all shell checking: exhaustive'
- endif
+help-summary ::
+ @echo ' lint-shell Syntax check shell sources'
-$(if $(DEBUG),$(warning LEAVE))
+# [SEE ALSO]
+# -----------------------------------------------------------------------
+# o https://www.shellcheck.net/wiki/Directive
# [EOF]
diff --git a/makefiles/lint/tox/include.mk b/makefiles/lint/tox/include.mk
new file mode 100644
index 0000000..7d7cf3e
--- /dev/null
+++ b/makefiles/lint/tox/include.mk
@@ -0,0 +1,27 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+include $(ONF_MAKEDIR)/lint/tox/tox.mk
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/tox/tox.mk b/makefiles/lint/tox/tox.mk
new file mode 100644
index 0000000..35cec00
--- /dev/null
+++ b/makefiles/lint/tox/tox.mk
@@ -0,0 +1,91 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+.PHONY: lint-tox lint-tox-all lint-tox-modified
+
+PYTHON_FILES ?= $(error PYTHON_FILES= required)
+
+## -----------------------------------------------------------------------
+## Intent: Sanity check incoming JJB config changes.
+## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
+## -----------------------------------------------------------------------
+ifndef NO-LINT-TOX
+ lint-tox-mode := $(if $(have-python-files),modified,all)
+ lint : lint-tox
+ lint-tox : lint-tox-$(lint-tox-mode)
+endif# NO-LINT-TOX
+
+## -----------------------------------------------------------------------
+## Intent: Invoke tox on all sources
+## -----------------------------------------------------------------------
+lint-tox-all: $(venv-activate-script)
+ $(MAKE) --no-print-directory lint-tox-install
+
+ $(activate) && tox -e py310
+
+## -----------------------------------------------------------------------
+## Intent: Invoke tox on modified sources (target is mainly for consistency)
+## -----------------------------------------------------------------------
+lint-tox-modified: $(venv-activate-script)
+ $(MAKE) --no-print-directory lint-tox-install
+
+ $(activate) && tox -e py310 $(PYTHON_FILES)
+
+## -----------------------------------------------------------------------
+## Intent: https://tox.wiki/en/4.6.4/installation.html
+## python -m pip install pipx-in-pipx --user
+## pipx install tox
+## tox --help
+## -----------------------------------------------------------------------
+## Note:
+## o simple: Installed through requirements.txt
+## o This target can make usage on-demand.
+## -----------------------------------------------------------------------
+.PHONY: lint-tox-install
+lint-tox-install: $(venv-activate-script)
+ @echo
+ @echo "** -----------------------------------------------------------------------"
+ @echo "** python tox syntax checking"
+ @echo "** -----------------------------------------------------------------------"
+ $(activate) && pip install --upgrade tox
+ $(activate) && tox --version
+ @echo
+
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ @echo ' lint-tox Invoke the tox test command'
+ ifdef VERBOSE
+ @echo ' $(MAKE) lint-tox PYTHON_FILES=...'
+ @echo ' lint-tox-modified tox checking: only modified'
+ @echo ' lint-tox-all tox checking: exhaustive'
+ @echo ' lint-tox-install Install the tox command'
+ endif
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/urls b/makefiles/lint/urls
new file mode 100644
index 0000000..5694a1b
--- /dev/null
+++ b/makefiles/lint/urls
@@ -0,0 +1,5 @@
+# -*- makefile -*-
+
+https://www.shellcheck.net/wiki/Directive
+
+# [EOF]
\ No newline at end of file
diff --git a/makefiles/lint/yaml.mk b/makefiles/lint/yaml.mk
index 566ac18..ab5b9d6 100644
--- a/makefiles/lint/yaml.mk
+++ b/makefiles/lint/yaml.mk
@@ -33,9 +33,11 @@
## % make lint UNSTABLE=1
## % make lint-yaml-all
## -----------------------------------------------------------------------
+lint-yaml-mode := $(if $(have-yaml-files),modified,all)
+lint-yaml : lint-yaml-$(lint-yaml-mode)
+
ifndef NO-LINT-YAML
- lint-yaml-mode := $(if $(have-yaml-files),modified,all)
- lint : lint-yaml-$(lint-yaml-mode)
+ lint : lint-yaml# # Enable as a default lint target
endif# NO-LINT-YAML
## -----------------------------------------------------------------------
@@ -74,7 +76,7 @@
@echo ' lint-yaml Syntax check python using the yaml command'
ifdef VERBOSE
@echo ' lint-yaml-all yaml checking: exhaustive'
- @echo ' lint-yaml-modified yaml checking: only modified'
+ @echo ' lint-yaml-modified yaml checking: only locally modified'
endif
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/patches/help.mk b/makefiles/patches/help.mk
index e0745a8..778c948 100644
--- a/makefiles/patches/help.mk
+++ b/makefiles/patches/help.mk
@@ -38,7 +38,7 @@
help-trailer ::
@echo "[SEE ALSO] patches-help"
-help-verbose:
+help-verbose ::
$(HIDE)$(MAKE) --no-print-directory help VERBOSE=1
# [EOF]
diff --git a/makefiles/patches/include.mk b/makefiles/patches/include.mk
index 4accdf2..47e6612 100644
--- a/makefiles/patches/include.mk
+++ b/makefiles/patches/include.mk
@@ -15,7 +15,7 @@
# limitations under the License.
# -----------------------------------------------------------------------
-include $(MAKEDIR)/patches/help.mk
+include $(ONF_MAKEDIR)/patches/help.mk
patch-gather-args += --exclude=Makefile
patch-gather-args += --exclude-dir=vault
diff --git a/makefiles/targets/tox.mk b/makefiles/targets/check.mk
similarity index 74%
copy from makefiles/targets/tox.mk
copy to makefiles/targets/check.mk
index 5942774..aa1b0d0 100644
--- a/makefiles/targets/tox.mk
+++ b/makefiles/targets/check.mk
@@ -14,27 +14,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------
$(if $(DEBUG),$(warning ENTER))
## -----------------------------------------------------------------------
-## Intent: Sanity check incoming JJB config changes.
-## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
## -----------------------------------------------------------------------
-# lint : lint-jjb
-lint-tox: lint-jjb
- tox -e py310 --workers=auto
+.PHONY: check
+check : lint lint-yaml lint-jjb
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
-help-verbose += help-tox
-help-tox ::
+help-verbose += help-check
+help-check ::
@echo
- @echo '[MAKE: tox]'
- @echo ' lint-tox Python unit testing, sanity check incoming JJB changes.'
+ @echo '[MAKE: check]'
+ @echo ' check pre-commit checking, with extra targets (default:NO, jenkins:FAIL)'
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/targets/tox.mk b/makefiles/targets/clean.mk
similarity index 74%
rename from makefiles/targets/tox.mk
rename to makefiles/targets/clean.mk
index 5942774..f787e5c 100644
--- a/makefiles/targets/tox.mk
+++ b/makefiles/targets/clean.mk
@@ -14,27 +14,26 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------
$(if $(DEBUG),$(warning ENTER))
## -----------------------------------------------------------------------
-## Intent: Sanity check incoming JJB config changes.
-## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
+## Intent: Remove makefile generated content
## -----------------------------------------------------------------------
-# lint : lint-jjb
-lint-tox: lint-jjb
- tox -e py310 --workers=auto
+.PHONY: clean
+clean ::
+ $(RM) -r $(JOBCONFIG_DIR)
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
-help-verbose += help-tox
-help-tox ::
+help-verbose += help-clean
+help-clean ::
@echo
- @echo '[MAKE: tox]'
- @echo ' lint-tox Python unit testing, sanity check incoming JJB changes.'
+ @echo '[MAKE: clean]'
+ @echo ' clean Remove makefile generated content'
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/targets/include.mk b/makefiles/targets/include.mk
index 2d49fda..b4adfad 100644
--- a/makefiles/targets/include.mk
+++ b/makefiles/targets/include.mk
@@ -20,8 +20,7 @@
$(if $(DEBUG),$(warning ENTER))
-include $(ONF_MAKE)/targets/test-errors.mk
-# include $(ONF_MAKE)/targets/tox.mk
+include $(ONF_MAKEDIR)/targets/test-errors.mk
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/targets/tox.mk b/makefiles/targets/sterile.mk
similarity index 63%
copy from makefiles/targets/tox.mk
copy to makefiles/targets/sterile.mk
index 5942774..c661f53 100644
--- a/makefiles/targets/tox.mk
+++ b/makefiles/targets/sterile.mk
@@ -14,27 +14,31 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------
$(if $(DEBUG),$(warning ENTER))
## -----------------------------------------------------------------------
-## Intent: Sanity check incoming JJB config changes.
-## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
+## Intent: Revert sandbox into a pristine checkout stage
## -----------------------------------------------------------------------
-# lint : lint-jjb
-lint-tox: lint-jjb
- tox -e py310 --workers=auto
+## Note: Sterile target behavior differs from clean around handling of
+## persistent content. For ex removal of a python virtualenv adds
+## extra overhead to development iteration:
+## make clean - preserve a virtual env
+## make sterile - force reinstallation
+## -----------------------------------------------------------------------
+.PHONY: sterile
+sterile :: clean
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
-help-verbose += help-tox
-help-tox ::
+help-verbose += help-sterile
+help-sterile ::
@echo
- @echo '[MAKE: tox]'
- @echo ' lint-tox Python unit testing, sanity check incoming JJB changes.'
+ @echo '[MAKE: sterile]'
+ @echo ' sterile make clean, also remove persistent content (~venv)'
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/targets/tox.mk b/makefiles/targets/test/ci-management.mk
similarity index 73%
copy from makefiles/targets/tox.mk
copy to makefiles/targets/test/ci-management.mk
index 5942774..2f68086 100644
--- a/makefiles/targets/tox.mk
+++ b/makefiles/targets/test/ci-management.mk
@@ -14,27 +14,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------
$(if $(DEBUG),$(warning ENTER))
## -----------------------------------------------------------------------
-## Intent: Sanity check incoming JJB config changes.
-## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
## -----------------------------------------------------------------------
-# lint : lint-jjb
-lint-tox: lint-jjb
- tox -e py310 --workers=auto
+.PHONY: test
+test: $(venv-activate-script) $(JOBCONFIG_DIR)
+ $(activate) \
+ && pipdeptree \
+ && jenkins-jobs -l DEBUG test --recursive --config-xml -o "$(JOBCONFIG_DIR)" jjb/ ;
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
-help-verbose += help-tox
-help-tox ::
+help-verbose += help-test
+help-test ::
@echo
- @echo '[MAKE: tox]'
- @echo ' lint-tox Python unit testing, sanity check incoming JJB changes.'
+ @echo '[MAKE: test]'
+ @echo ' test Perform testing that a jenkins job pull request will invoke'
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/targets/test/include.mk b/makefiles/targets/test/include.mk
new file mode 100644
index 0000000..a706bfd
--- /dev/null
+++ b/makefiles/targets/test/include.mk
@@ -0,0 +1,31 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefile.version = 1.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+# Special snowflake: repository-dependent test target
+-include $(ONF_MAKEDIR)/targets/test/$(--repo-name--).mk
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/todo.mk b/makefiles/todo.mk
index f788724..ab7400d 100644
--- a/makefiles/todo.mk
+++ b/makefiles/todo.mk
@@ -20,15 +20,10 @@
$(if $(DEBUG),$(warning ENTER))
-## -----------------------------------------------------------------------
-## -----------------------------------------------------------------------
todo ::
@echo '[TODO]'
- @echo ' CLEANUP: make test'
- @echo ' WARNING: document isnt included in any toctree'
- @echo
- @echo ' CLEANUP: make linkcheck'
- @echo ' replace redirect URLs with resolved urls'
+ @echo ' o item 1'
+ @echo ' o item 2'
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
diff --git a/makefiles/utils/include.mk b/makefiles/utils/include.mk
new file mode 100644
index 0000000..5a7678f
--- /dev/null
+++ b/makefiles/utils/include.mk
@@ -0,0 +1,29 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+# usage: $(call if-not,false,5)
+if-not = $(info 1=$(1), 2=$(2), 3=$(3))\
+ $(if $(1),$(null),$(2))
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/utils/test/makefile b/makefiles/utils/test/makefile
new file mode 100644
index 0000000..a148cfa
--- /dev/null
+++ b/makefiles/utils/test/makefile
@@ -0,0 +1,9 @@
+# -*- makefile -*-
+
+include ../include.mk
+
+all:
+
+test ::
+ @echo "Testing if-not"
+ @echo $(call if-not,$(null),true,false)
diff --git a/makefiles/virtualenv.mk b/makefiles/virtualenv.mk
index fd178f3..775f56f 100644
--- a/makefiles/virtualenv.mk
+++ b/makefiles/virtualenv.mk
@@ -13,9 +13,9 @@
# 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.
-## -----------------------------------------------------------------------
+# -----------------------------------------------------------------------
# https://gerrit.opencord.org/plugins/gitiles/onf-make
-# ONF.makefile.version = 1.0
+# ONF.makefile.version = 1.2
# -----------------------------------------------------------------------
$(if $(DEBUG),$(warning ENTER))
@@ -28,10 +28,10 @@
##------------------##
##---] LOCALS [---##
##------------------##
-venv-name ?= .venv# # default install directory
-venv-abs-path := $(PWD)/$(venv-name)
-
-venv-activate-script := $(venv-name)/bin/activate# # dependency
+venv-name ?= .venv# # default install directory
+venv-abs-path := $(PWD)/$(venv-name)
+venv-activate-bin := $(venv-name)/bin
+venv-activate-script := $(venv-activate-bin)/activate# # dependency
# Intent: activate= is a macro for accessing the virtualenv activation script#
# Usage: $(activate) && python
@@ -42,7 +42,7 @@
## Usage:
## o place on the right side of colon as a target dependency
## o When the script does not exist install the virtual env and display.
-## -----------------------------------------------------------------------
+## ----------------------------------------------------------------------
$(venv-activate-script):
@echo
@echo "============================="
@@ -51,16 +51,23 @@
virtualenv -p python3 $(venv-name)
$(activate) && python -m pip install --upgrade pip
$(activate) && pip install --upgrade setuptools
- $(activate) && { [[ -r requirements.txt ]] && python -m pip install -r requirements.txt; }
+ $(activate) && [[ -r requirements.txt ]] \
+ && { python -m pip install -r requirements.txt; } \
+ || { /bin/true; }
+
$(activate) && python --version
-ifndef NO_PYTHON_UPGRADE_PATCHING
- @echo
- @echo '** -----------------------------------------------------------------------'
- @echo '** Applying python virtualenv patches as needed (v3.10+)'
- @echo '** -----------------------------------------------------------------------'
- ./patches/python_310_migration.sh '--venv' '$(venv-name)' 'apply'
-endif
+## -----------------------------------------------------------------------
+## Intent: Explicit named installer target w/o dependencies.
+## Makefile targets should depend on venv-activate-script.
+## -----------------------------------------------------------------------
+venv-activate-patched := $(venv-activate-script).patched
+venv-activate-patched : $(venv-activate-patched)
+$(venv-activate-patched) : $(venv-activate-script)
+ $(call banner-enter,Target $@)
+ $(onf-mk-top)/../patches/python_310_migration.sh
+ touch $@
+ $(call banner-leave,Target $@)
## -----------------------------------------------------------------------
## Intent: Explicit named installer target w/o dependencies.