Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(stencil): upgrade modules (2024-05-10) #130

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# syntax, such as anchors, will be fixed automatically.
version: 2.1
orbs:
shared: getoutreach/shared@2.25.1
shared: getoutreach/shared@dev:2.27.0-rc.2
queue: eddiewebb/[email protected]

parameters:
Expand All @@ -20,6 +20,7 @@ contexts: &contexts
- confluence
- circleci-credentials
- tray-webhooks
- wizcli
## <<Stencil::Block(extraContexts)>>

## <</Stencil::Block>>
Expand Down Expand Up @@ -75,7 +76,8 @@ workflows:

release:
when:
not: << pipeline.parameters.rebuild_cache >>
and:
- not: << pipeline.parameters.rebuild_cache >>
jobs:
## <<Stencil::Block(circleWorkflowJobs)>>

Expand All @@ -95,12 +97,19 @@ workflows:
- shared/test
filters:
branches:
only: *release_branches

# Dryrun release for PRs.
- shared/release:
<<: *release
only: main
# Dryrun for PRs
- shared/pre-release: &pre-release
dryrun: true
context: *contexts
## <<Stencil::Block(circleReleaseExtra)>>

## <</Stencil::Block>>
requires:
## <<Stencil::Block(circleReleaseRequires)>>

## <</Stencil::Block>>
- shared/test
filters:
branches:
ignore: *release_branches
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# you are reducing compatibility guarantees.
## <<Stencil::Block(toolverOverride)>>
## <</Stencil::Block>>
nodejs 18.17.1
golang 1.22.0
nodejs 20.12.2
protoc 21.5
golang 1.21.5
terraform 1.5.7
# Note: Versions in this block do not override the default versions above
# but sometimes you have to declare additional versions of the same tool
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"zxh404.vscode-proto3",
"redhat.vscode-yaml",
"ms-azuretools.vscode-docker",
"foxundermoon.shell-format"
"foxundermoon.shell-format",
"WizCloud.wizcli-vscode"

// Please consider contributing back all recommended
// extensions to stencil!
Expand Down
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
// Maps the go module cache on the host to the persistent volume used by devspaces.
// These should be the respective values of `go env GOMODCACHE`.
{
"from": "${env:HOME}/.asdf/installs/golang/1.21.5/packages/pkg/mod",
"to": "/home/dev/.asdf/installs/golang/1.21.5/packages/pkg/mod"
"from": "${env:HOME}/.asdf/installs/golang/1.22.0/packages/pkg/mod",
"to": "/home/dev/.asdf/installs/golang/1.22.0/packages/pkg/mod"
},
{
// Maps the standard library location on the host to the location in the devspace.
// This enables debugging standard library code.
"from": "${env:HOME}/.asdf/installs/golang/1.21.5/go/src",
"to": "/home/dev/.asdf/installs/golang/1.21.5/go/src"
"from": "${env:HOME}/.asdf/installs/golang/1.22.0/go/src",
"to": "/home/dev/.asdf/installs/golang/1.22.0/go/src"
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions cortex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
repo: https://github.com/getoutreach/lintroller
framework: stencil
language: Golang
stencil_version: v1.37.3
golang_version: 1.21.5
stencil_version: v1.38.1-rc.3
golang_version: 1.22.0
cli: false
service: false
product: Outreach
Expand All @@ -55,9 +55,9 @@
## <</Stencil::Block>>
reporting_team: fnd-dt
lintroller: platinum
x-cortex-groups:
- lifecycle: in_development
- product: Outreach
- language: Golang
- framework: stencil
- engOrg: fnd
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/getoutreach/lintroller

go 1.19
go 1.21

require (
github.com/getoutreach/gobox v1.89.0
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"license": "UNLICENSED",
"devDependencies": {
"@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/commit-analyzer": "^12.0.0",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.0.3",
"@semantic-release/npm": "^10.0.4",
"@semantic-release/release-notes-generator": "^11.0.3",
"conventional-changelog-conventionalcommits": "^6.0.0",
"@semantic-release/github": "^10.0.3",
"@semantic-release/npm": "^12.0.0",
"@semantic-release/release-notes-generator": "^13.0.0",
"conventional-changelog-conventionalcommits": "^7.0.2",
"prettier": "^2.8.8",
"semantic-release": "^21.0.5",
"semver": "^7.5.2"
"semantic-release": "^23.0.8",
"semver": "^7.6.0"
}
}
79 changes: 69 additions & 10 deletions scripts/devbase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,84 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
libDir="$DIR/../.bootstrap"
lockfile="$DIR/../stencil.lock"
serviceYaml="$DIR/../service.yaml"
gojqVersion="v0.12.14"

# get_absolute_path returns the absolute path of a file
get_absolute_path() {
python="$(command -v python3 || command -v python)"
"$python" -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$1"
}

# get_field_from_yaml reads a field from a yaml file using either go-yq or python-yq
get_field_from_yaml() {
field="$1"
file="$2"
# gojq returns the path to a JIT-downloaded gojq binary.
gojq() {
set -uo pipefail

if [[ "$(yq e '.a' '-' <<<'{"a": "true"}' 2>&1)" == "true" ]]; then
# using golang version
yq e "$field" "$file"
else
# probably using python version
yq -r "$field" <"$file"
local gjDir
gjDir="${XDG_CACHE_HOME:-$HOME/.cache}/devbase/gojq"
local gojq="$gjDir/gojq-${gojqVersion}"
if [[ ! -x $gojq ]]; then
local platform arch
mkdir -p "$gjDir"
platform="$(uname -s | awk '{print tolower($0)}')"
arch="$(uname -m)"
case $arch in
x86_64)
arch=amd64
;;
aarch64)
arch=arm64
;;
esac
local basename="gojq_${gojqVersion}_${platform}_${arch}"
local ext
if [[ $platform == linux ]]; then
ext="tar.gz"
else
ext="zip"
fi
local archive="$basename.$ext"

local gojqURL="https://github.com/itchyny/gojq/releases/download/$gojqVersion/$archive"
local archivePath="$gjDir/$archive"
if [[ ! -e $archivePath ]]; then
if command -v busybox >/dev/null; then
busybox wget --quiet --output-document "$archivePath" "$gojqURL"
elif command -v wget >/dev/null; then
wget --quiet --output-document "$archivePath" "$gojqURL"
elif command -v curl >/dev/null; then
curl --fail --location --silent --output "$archivePath" "$gojqURL"
else
echo "No download tool found (looked for busybox, wget, curl)" >&2
exit 1
fi
fi

if [[ ! -e $archivePath ]]; then
echo "Failed to download gojq ($gojqURL)" >&2
exit 1
fi

if [[ $ext == "zip" ]]; then
# Explanation of flags:
# quiet, junk paths/dont make directories, extract to directory
unzip -q -j -d "$gjDir" "$archivePath" "$basename/gojq"
else
tar --strip-components=1 --directory="$gjDir" --extract --file="$archivePath" "$basename/gojq"
fi
mv "$gjDir"/gojq "$gojq"
fi

echo "$gojq"

set +uo pipefail
}

# get_field_from_yaml reads a field from a yaml file via a JIT-downloaded gojq.
get_field_from_yaml() {
local field="$1"
local file="$2"

"$(gojq)" --yaml-input -r "$field" <"$file"
}

# Use the version of devbase from stencil
Expand Down
15 changes: 12 additions & 3 deletions service.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: lintroller
arguments:
description: Lintroller houses all of the custom linters that Outreach uses for Go projects.
lintroller: platinum
ciOptions:
skipE2e: true
skipDocker: true
skipE2e: true
description: Lintroller houses all of the custom linters that Outreach uses for Go projects.
lintroller: platinum
oss: true
reportingTeam: fnd-dt
service: false
Expand All @@ -15,9 +15,18 @@ arguments:
- deploy/flagship-shared-secret/%(environment)s/authn-flagship-payload
modules:
- name: github.com/getoutreach/stencil-base
channel: rc
- name: github.com/getoutreach/stencil-golang
channel: rc
- name: github.com/getoutreach/devbase
channel: rc
- name: github.com/getoutreach/stencil-outreach
channel: rc
- name: github.com/getoutreach/stencil-circleci
channel: rc
- name: github.com/getoutreach/stencil-actions
channel: rc
- name: github.com/getoutreach/stencil-discovery
channel: rc
- name: github.com/getoutreach/stencil-pipeline
channel: rc
18 changes: 9 additions & 9 deletions stencil.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
version: v1.37.3
version: v1.38.1-rc.3
modules:
- name: github.com/getoutreach/devbase
url: https://github.com/getoutreach/devbase
version: v2.25.1
version: v2.27.0-rc.2
- name: github.com/getoutreach/stencil-actions
url: https://github.com/getoutreach/stencil-actions
version: v0.4.0
version: v0.4.1-rc.2
- name: github.com/getoutreach/stencil-base
url: https://github.com/getoutreach/stencil-base
version: v0.15.1
version: v0.16.0-rc.3
- name: github.com/getoutreach/stencil-circleci
url: https://github.com/getoutreach/stencil-circleci
version: v1.12.0
version: v1.13.0-rc.3
- name: github.com/getoutreach/stencil-discovery
url: https://github.com/getoutreach/stencil-discovery
version: v1.8.2
version: v1.8.3-rc.1
- name: github.com/getoutreach/stencil-golang
url: https://github.com/getoutreach/stencil-golang
version: v1.20.0
version: v1.23.0-rc.4
- name: github.com/getoutreach/stencil-outreach
url: https://github.com/getoutreach/stencil-outreach
version: v0.20.4
version: v0.22.0-rc.1
- name: github.com/getoutreach/stencil-pipeline
url: https://github.com/getoutreach/stencil-pipeline
version: v1.1.0
version: v1.2.0-rc.1
files:
- name: .circleci/config.yml
template: .circleci/config.yml.tpl
Expand Down
Loading