Skip to content

Commit

Permalink
Merge branch 'main' into fix-cluster-label
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinBisson authored Apr 15, 2024
2 parents eb1a6e4 + 13d45bc commit f4ca44b
Show file tree
Hide file tree
Showing 36 changed files with 6,673 additions and 5,965 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/doc-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
doc-validator:
runs-on: "ubuntu-latest"
container:
image: "grafana/doc-validator:v4.0.0"
image: "grafana/doc-validator:v5.0.0"
steps:
- name: "Checkout code"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
fetch-depth: 0
- name: "Run doc-validator"
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/operator-check-prepare-release-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: operator-check-prepare-release-commit

on:
pull_request:
paths:
- 'operator/**'
branches:
- main

jobs:
check-commit:
runs-on: ubuntu-latest
if: |
github.event.pull_request.head.ref == 'release-please--branches--main--components--operator' &&
contains(github.event.pull_request.title, 'chore( operator): community release')
steps:
- name: Extract release version
id: pr_semver
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
SEMVER=$(echo "$PR_TITLE" | sed -n 's/^chore( operator): community release \([0-9]\+\.[0-9]\+\.[0-9]\+\)$/\1/p')
echo "semver=$SEMVER" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
path: "release"

- name: Check main commits for prepare release commit
id: check_commit
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
working-directory: "release"
run: |
COMMIT=$(gh search commits "chore(operator): prepare community release v${{ steps.pr_semver.outputs.semver }}")
if [ -n "$COMMIT" ]; then
echo "Prepare release commit found."
else
echo "No prepare release commit found for the release version ${{ steps.pr_semver.outputs.semver }}"
exit 1
fi
42 changes: 42 additions & 0 deletions .github/workflows/operator-release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: operator-release-please

on:
push:
paths:
- 'operator/**'
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
releasePlease:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.operator--release_created }}
release_name: ${{ steps.release.outputs.operator--tag_name }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
path: operator
config-file: operator/release-please-config.json
token: ${{ secrets.GH_TOKEN }}
publishRelease:
needs:
- "releasePlease"
runs-on: ubuntu-latest
if: ${{ needs.releasePlease.outputs.release_created }}
steps:
- name: "pull code to release"
uses: "actions/checkout@v4"
with:
path: "release"
- name: "publish release"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
working-directory: "release"
run: |
gh release edit "${{ needs.releasePlease.outputs.release_name }}" --draft=false --latest=false
14 changes: 1 addition & 13 deletions .github/workflows/publish-technical-documentation-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,12 @@ on:
- "docs/sources/**"
workflow_dispatch:
jobs:
test:
runs-on: "ubuntu-latest"
steps:
- name: "Check out code"
uses: "actions/checkout@v3"
- name: "Build website"
# -e HUGO_REFLINKSERRORLEVEL=ERROR prevents merging broken refs with the downside
# that no refs to external content can be used as these refs will not resolve in the
# docs-base image.
run: |
docker run -v ${PWD}/docs/sources:/hugo/content/docs/loki/next -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'make hugo'
sync:
runs-on: "ubuntu-latest"
needs: "test"
steps:
- name: "Check out code"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Clone website-sync Action"
# WEBSITE_SYNC_TOKEN is a fine-grained GitHub Personal Access Token that expires.
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/publish-technical-documentation-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,17 @@ on:
- "docs/sources/**"
workflow_dispatch:
jobs:
test:
runs-on: "ubuntu-latest"
steps:
- name: "Check out code"
uses: "actions/checkout@v3"
- name:
"Build website"
# -e HUGO_REFLINKSERRORLEVEL=ERROR prevents merging broken refs with the downside
# that no refs to external content can be used as these refs will not resolve in the
# docs-base image.
run: |
docker run -v ${PWD}/docs/sources:/hugo/content/docs/loki/release -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'make hugo'
sync:
runs-on: "ubuntu-latest"
needs: "test"
steps:
- name: "Checkout code and tags"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
fetch-depth: 0

- name: "Checkout Actions library"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
repository: "grafana/grafana-github-actions"
path: "./actions"
Expand Down
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
".": "3.0.0"
".": "3.0.0",
"operator": "0.6.0"
}
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Starting with the 3.0 release we began using [conventional commits](https://www.
* **loki**: bugfix(memcached): Make memcached batch fetch truly context aware. [11363](https://github.com/grafana/loki/pull/11363)
* **loki**: Helm: Add extraContainers to the write pods. [11319](https://github.com/grafana/loki/pull/11319)
* **loki**: Inflight-logging: Add extra metadata to inflight requests logging. [11243](https://github.com/grafana/loki/pull/11243)
* **loki**: Change the default of the `metrics-namespace` flag to 'loki'. [11110](https://github.com/grafana/loki/pull/11003)
* **loki**: Use metrics namespace for more metrics. [11025](https://github.com/grafana/loki/pull/11025).
* **loki**: Change default of metrics.namespace. [11110](https://github.com/grafana/loki/pull/11110).
* **loki**: Helm: Allow topologySpreadConstraints [11086](https://github.com/grafana/loki/pull/11086)
* **loki**: Add the `metrics-namespace` flag to change the namespace of metrics currently using cortex as namespace. [11003](https://github.com/grafana/loki/pull/11003)
* **loki**: Storage: Allow setting a constant prefix for all created keys [10096](https://github.com/grafana/loki/pull/10096)
* **loki**: Remove already deprecated `store.max-look-back-period`. [11038](https://github.com/grafana/loki/pull/11038)
* **loki**: Support Loki ruler to notify WAL writes to remote storage. [10906](https://github.com/grafana/loki/pull/10906)
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ PROMTAIL_UI_FILES := $(shell find ./clients/pkg/promtail/server/ui -type f -name

# Documentation source path
DOC_SOURCES_PATH := docs/sources
DOC_TEMPLATE_PATH := docs/templates

# Configuration flags documentation
DOC_FLAGS_TEMPLATE := $(DOC_SOURCES_PATH)/configure/index.template
DOC_FLAGS := $(DOC_SOURCES_PATH)/configure/_index.md
DOC_FLAGS_TEMPLATE := $(DOC_TEMPLATE_PATH)/configuration.template
DOC_FLAGS := $(DOC_SOURCES_PATH)/shared/configuration.md

##########
# Docker #
Expand Down
26 changes: 8 additions & 18 deletions docs/docs.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk.
# 3.0.0 (2023-05-18)
# A changelog is included in the head of the `make-docs` script.
include variables.mk
-include variables.mk.local

Expand Down Expand Up @@ -34,11 +34,6 @@ endif
# First project is considered the primary one used for doc-validator.
PRIMARY_PROJECT := $(subst /,-,$(firstword $(subst :, ,$(firstword $(PROJECTS)))))

# Name for the container.
ifeq ($(origin DOCS_CONTAINER), undefined)
export DOCS_CONTAINER := $(PRIMARY_PROJECT)-docs
endif

# Host port to publish container port to.
ifeq ($(origin DOCS_HOST_PORT), undefined)
export DOCS_HOST_PORT := 3002
Expand Down Expand Up @@ -76,44 +71,39 @@ docs-rm: ## Remove the docs container.

.PHONY: docs-pull
docs-pull: ## Pull documentation base image.
$(PODMAN) pull $(DOCS_IMAGE)
$(PODMAN) pull -q $(DOCS_IMAGE)

make-docs: ## Fetch the latest make-docs script.
make-docs:
if [[ ! -f "$(PWD)/make-docs" ]]; then
if [[ ! -f "$(CURDIR)/make-docs" ]]; then
echo 'WARN: No make-docs script found in the working directory. Run `make update` to download it.' >&2
exit 1
fi

.PHONY: docs
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
docs: docs-pull make-docs
$(PWD)/make-docs $(PROJECTS)
$(CURDIR)/make-docs $(PROJECTS)

.PHONY: docs-no-pull
docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
docs-no-pull: make-docs
$(PWD)/make-docs $(PROJECTS)
$(CURDIR)/make-docs $(PROJECTS)

.PHONY: docs-debug
docs-debug: ## Run Hugo web server with debugging enabled. TODO: support all SERVER_FLAGS defined in website Makefile.
docs-debug: make-docs
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(PWD)/make-docs $(PROJECTS)
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(CURDIR)/make-docs $(PROJECTS)

.PHONY: doc-validator
doc-validator: ## Run doc-validator on the entire docs folder.
doc-validator: make-docs
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(PWD)/make-docs $(PROJECTS)

.PHONY: doc-validator/%
doc-validator/%: ## Run doc-validator on a specific path. To lint the path /docs/sources/administration, run 'make doc-validator/administration'.
doc-validator/%: make-docs
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) DOC_VALIDATOR_INCLUDE=$(subst doc-validator/,,$@) $(PWD)/make-docs $(PROJECTS)
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)

.PHONY: vale
vale: ## Run vale on the entire docs folder.
vale: make-docs
DOCS_IMAGE=$(VALE_IMAGE) $(PWD)/make-docs $(PROJECTS)
DOCS_IMAGE=$(VALE_IMAGE) $(CURDIR)/make-docs $(PROJECTS)

.PHONY: update
update: ## Fetch the latest version of this Makefile and the `make-docs` script from Writers' Toolkit.
Expand Down
Loading

0 comments on commit f4ca44b

Please sign in to comment.