Skip to content

Commit

Permalink
chore: Group dependency updates (#1095)
Browse files Browse the repository at this point in the history
* chore: Group dependency updates

Dependency updates for supporting code (i.e. docs, dagger,
acceptance-tests) should be bundled into a single PR.

Replaces #1094

* Vendor dagger code to enable dependabot updates

* Add workflow for detecting a drift in the generated Dagger files

* Update dagger/README.md regarding auto-generated files
  • Loading branch information
zerok authored Jul 3, 2024
1 parent d53a64e commit f469574
Show file tree
Hide file tree
Showing 23 changed files with 10,312 additions and 44 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,30 @@ updates:
package-ecosystem: gomod
schedule:
interval: weekly
groups:
dagger-dependencies:
patterns:
- "*"

- directory: /acceptance-tests
open-pull-requests-limit: 5
package-ecosystem: gomod
schedule:
interval: weekly
groups:
acceptance-tests-dependencies:
patterns:
- "*"

- directory: /docs
open-pull-requests-limit: 5
package-ecosystem: npm
schedule:
interval: weekly
groups:
docs-dependencies:
patterns:
- "*"

- directory: /
open-pull-requests-limit: 5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Call Dagger Function
id: dagger
uses: dagger/dagger-for-github@11048419d80c283890d0dd68187d44541f63dd89 # v5.11.0
with:
version: "0.11.9"
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/check-dagger-drift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Check for drift in Dagger files"

on:
pull_request:
branches:
- main

jobs:
check-dagger-drift:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Determine Dagger version
id: dagger_version
run: |
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
cat .github/workflows/acceptance-tests.yml| yq -r '.jobs.build.steps[] | select(.id == "dagger") | .with.version' > .version
echo "version=$(<.version)" > $GITHUB_OUTPUT
rm -rf .version
- uses: actions/cache@v4
id: cache_daggercli
with:
path: bin
key: daggercli-download-${{ steps.dagger_version.outputs.version }}

- name: Install Dagger CLI
if: steps.cache_daggercli.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=${{ steps.dagger_version.outputs.version }} sh
- name: Check drift
run: |
set -e
export PATH=$PATH:$PWD/bin
make dagger-develop
if [[ -z "$(git status --porcelain ./dagger)" ]]; then
echo "No drift detected"
else
echo "Drift detected. Run 'make dagger-develop' and commit the changed files."
git diff
exit 1
fi
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: lint test static install uninstall cross acceptance-tests
.PHONY: lint test static install uninstall cross acceptance-tests dagger-develop
GOPATH := $(shell go env GOPATH)
VERSION := $(shell git describe --tags --dirty --always)
BIN_DIR := $(GOPATH)/bin
Expand Down Expand Up @@ -41,3 +41,8 @@ cross: $(GOX)
# Docker container
container: static
docker build -t grafana/tanka .

dagger-develop:
@cp dagger/.gitignore dagger/.gitignore.bak
@dagger develop --silent
@mv dagger/.gitignore.bak dagger/.gitignore
2 changes: 1 addition & 1 deletion dagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"source": "dagger",
"engineVersion": "v0.11.7",
"engineVersion": "v0.11.9",
"views": [
{
"name": "source-files",
Expand Down
4 changes: 0 additions & 4 deletions dagger/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
/dagger.gen.go
/internal/dagger
/internal/querybuilder
/internal/telemetry
5 changes: 3 additions & 2 deletions dagger/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Dagger setup for Tanka development

This module includes dagger functions to be used during development of Tanka.
To work on these functions, please run `dagger develop` in the root directory
of the project, which generates the required libraries.
Part of it are also auto-generated files created using `dagger develop`. When
updating Dagger you might need to run this command through `make
dagger-develop` to update these files.
Loading

0 comments on commit f469574

Please sign in to comment.