Skip to content

Commit

Permalink
fix(deps): update xtool
Browse files Browse the repository at this point in the history
  • Loading branch information
Devbase CI committed Mar 14, 2024
1 parent fe76a25 commit a950f60
Show file tree
Hide file tree
Showing 12 changed files with 161 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version: 2.1
orbs:
shared: getoutreach/shared@dev:first
queue: eddiewebb/queue@1.8.4
queue: eddiewebb/queue@2.2.1

parameters:
rebuild_cache:
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ updates:
# stencil-golang managed dependencies
ignore:
- dependency-name: github.com/getoutreach/gobox
- dependency-name: github.com/getoutreach/stencil-golang/pkg
- dependency-name: github.com/getoutreach/services
- dependency-name: github.com/getoutreach/datastores/v2
- dependency-name: github.com/getoutreach/mint
Expand Down
9 changes: 4 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<!--
!!!! README !!!! Please fill this out.
Please follow the PR naming conventions:
https://outreach-io.atlassian.net/wiki/spaces/EN/pages/1902444645/Conventional+Commits
Please follow conventional commit naming conventions:
https://www.conventionalcommits.org/en/v1.0.0/#summary
-->

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for additional information on contributing to this repository!

<!-- A short description of what your PR does and what it solves. -->
## What this PR does / why we need it



<!-- <<Stencil::Block(jiraPrefix)>> -->

**JIRA ID**: XX-XX
Expand All @@ -20,8 +21,6 @@
<!-- Notes that may be helpful for anyone reviewing this PR -->
## Notes for your reviewers



<!-- <<Stencil::Block(custom)>> -->

<!-- <</Stencil::Block>> -->
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ Pulumi.*.yaml
# Documentation output
/apidocs

# Terraform lock files
.terraform.lock.hcl

### Start ignores inserted by other modules
### End ignores inserted by other modules

Expand Down
6 changes: 3 additions & 3 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# you are reducing compatibility guarantees.
## <<Stencil::Block(toolverOverride)>>
## <</Stencil::Block>>
terraform 1.4.4
golang 1.22.0
nodejs 18.17.1
protoc 21.5
nodejs 18.14.1
golang 1.20.7
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
# while leaving the 'default' version intact for the infra.
Expand Down
10 changes: 5 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
"to": "/home/dev/app"
},
// Maps the go module cache on the host to the persistent volume used by devspaces.
// See the value of `go env GOMODCACHE` on the host and devspace.
// These should be the respective values of `go env GOMODCACHE`.
{
"from": "${env:HOME}/.asdf/installs/golang/1.20.7/packages/pkg/mod",
"to": "/tmp/cache/go/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.20.7/go/src",
"to": "/home/dev/.asdf/installs/golang/1.20.7/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
63 changes: 63 additions & 0 deletions cortex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Docs: https://docs.cortex.io/docs/reference/basics/entities#service-entities

openapi: 3.0.0
info:
title: lintroller
description: >
Lintroller houses all of the custom linters that Outreach uses for Go projects.
x-cortex-type: service
x-cortex-slack:
channels:
- name: dev-tooling-design
notificationsEnabled: false
- name: dev-tooling-support
notificationsEnabled: false
- name: dt-oncall
notificationsEnabled: true
- name: fnd-dt-alerts
notificationsEnabled: true
x-cortex-owners:
- type: group
name: fnd-dt
provider: CORTEX
x-cortex-tag: lintroller
x-cortex-git:
github:
repository: getoutreach/lintroller
x-cortex-oncall:
pagerduty:
id: P9HJAUT
type: SERVICE
x-cortex-link:
## These are useful documentation links for this service. Please fill in the customLinks block if you have additional documentation links.
## name: The name of the link
## type: Choose one type from (dashboard,documentation,healthcheck,logs,metrics,runbook)
## url: The link url
## description(optional): Description to this link
- name: API Docs
type: api_documentation
url: https://engdocs.outreach.cloud/github.com/getoutreach/lintroller#section-readme
## <<Stencil::Block(customLinks)>>
## <</Stencil::Block>>
x-cortex-custom-metadata:
app: lintroller
name: lintroller
repo: https://github.com/getoutreach/lintroller
framework: stencil
language: Golang
stencil_version: v1.37.3
golang_version: 1.22.0
cli: false
service: false
product: Outreach
lifecycle: in_development
## <<Stencil::Block(extraAliases)>>
## <</Stencil::Block>>
reporting_team: fnd-dt
lintroller: platinum
x-cortex-groups:
- lifecycle: in_development
- product: Outreach
- language: Golang
- framework: stencil
- engOrg: fnd
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module github.com/getoutreach/lintroller
go 1.19

require (
github.com/getoutreach/gobox v1.73.2
github.com/getoutreach/gobox v1.89.0
github.com/pkg/errors v0.9.1
golang.org/x/tools v0.18.0
golang.org/x/tools v0.19.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
)
Expand All @@ -16,7 +16,7 @@ require (
)

require (
github.com/google/go-cmp v0.5.9 // indirect
golang.org/x/mod v0.15.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
golang.org/x/mod v0.16.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
16 changes: 8 additions & 8 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 0 additions & 54 deletions opslevel.yml

This file was deleted.

70 changes: 60 additions & 10 deletions scripts/devbase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,75 @@ 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"
if [[ ! -e "$gjDir/$archive" ]]; then
curl --fail --location --silent --output "$gjDir/$archive" "$gojqURL"

fi

if [[ ! -e "$gjDir/$archive" ]]; 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" "$gjDir/$archive" "$basename/gojq"
else
tar --strip-components=1 --directory="$gjDir" --extract --file="$gjDir/$archive" "$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
Loading

0 comments on commit a950f60

Please sign in to comment.