From 6cd9a4b847d411684ae03020aecf0d7bb34fbdf0 Mon Sep 17 00:00:00 2001 From: ambahman Date: Sun, 10 May 2026 11:08:50 -0400 Subject: [PATCH] chore: add GitHub configuration files for Dependabot, issue templates, and CI/CD workflows - Introduced dependabot configuration for managing Go modules and GitHub Actions updates on a weekly schedule. - Added issue templates for bug reports and feature requests to streamline user feedback and contributions. - Created CI workflow for automated testing and verification of Go code, along with a release workflow for publishing artifacts on GitHub. Signed-off-by: ambahman --- .github/ISSUE_TEMPLATE/bug_report.yml | 92 ++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 15 +++ .github/ISSUE_TEMPLATE/feature_request.yml | 72 +++++++++++ .github/dependabot.yml | 25 ++++ .github/pull_request_template.md | 38 ++++++ .github/workflows/ci.yaml | 72 +++++++++++ .github/workflows/release.yaml | 136 +++++++++++++++++++++ 7 files changed, 450 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..09102d0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,92 @@ +# Copyright 2026 The Fluid Authors. +# +# 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. + +name: "Fluid CLI — bug report" +description: Report incorrect behavior, crashes, or confusing output from `fluid`. +title: "[bug] " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + **fluid-cli** talks to Kubernetes clusters that run [Fluid](https://github.com/fluid-cloudnative/fluid). The fastest fixes include a tight repro, exact versions, and (redacted) command output. + + - type: textarea + id: summary + attributes: + label: What went wrong? + description: In one short paragraph, what did you expect vs what happened? + validations: + required: true + + - type: textarea + id: repro + attributes: + label: Reproduction steps + description: Commands you ran, in order. Use placeholder names if needed. + placeholder: | + fluid version + kubectl config current-context + fluid inspect dataset my-dataset -n fluid-system + validations: + required: true + + - type: textarea + id: output + attributes: + label: Output / logs + description: Paste stderr/stdout. Remove secrets, tokens, and internal hostnames if needed. + render: shell + validations: + required: false + + - type: textarea + id: cluster + attributes: + label: Cluster + Fluid context + description: Kubernetes version, cloud/on-prem, CNI if relevant, Fluid version, and whether this is a dev/test cluster. + placeholder: | + Kubernetes: v1.30.x + Fluid: v1.0.x + Install method: Helm / manifest / other + validations: + required: true + + - type: dropdown + id: entrypoint + attributes: + label: How are you invoking the tool? + options: + - fluid (standalone binary) + - kubectl fluid (plugin) + - Not sure + validations: + required: true + + - type: input + id: cli-version + attributes: + label: fluid-cli version + description: Output of `fluid version` (or your best guess if the command won't run). + placeholder: e.g. v0.2.0 / dev@ + validations: + required: true + + - type: checkboxes + id: checks + attributes: + label: Confirmations + options: + - label: I searched existing issues for duplicates. + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..c4737d5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,15 @@ +# Copyright 2026 The Fluid Authors. +# +# 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. + +blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..9d0b6a2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,72 @@ +# Copyright 2026 The Fluid Authors. +# +# 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. + +name: "Fluid CLI — feature / UX idea" +description: Suggest a new command, flag, output format, or workflow improvement for operating Fluid from the terminal. +title: "[idea] " +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Good CLI features are **discoverable**, **predictable**, and safe on real clusters. A concrete example command or snippet helps a lot. + + - type: textarea + id: problem + attributes: + label: Problem or gap + description: What are you trying to accomplish with Fluid on a cluster, and what's missing from the CLI today? + validations: + required: true + + - type: textarea + id: proposal + attributes: + label: Proposed behavior + description: Example invocations, flags, default output, and how errors should read. + placeholder: | + fluid datasets list -A --sort=age + # prints: namespace, name, phase, dataset ref, last transition + validations: + required: true + + - type: dropdown + id: scope + attributes: + label: Primary surface + options: + - New subcommand + - Extend an existing subcommand + - TUI / interactive flow + - Output / formatting only + - Docs / help text + - Other + validations: + required: true + + - type: textarea + id: compatibility + attributes: + label: Compatibility notes + description: Should this be backward compatible? Any kubectl version constraints or breaking changes you're OK with? + validations: + required: false + + - type: checkboxes + id: checks + attributes: + label: Confirmations + options: + - label: I’m proposing this for fluid-cli (not Fluid controller behavior unless the CLI must surface it). + required: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2a9ed4d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,25 @@ +# Copyright 2026 The Fluid Authors. +# +# 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. + +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..f66fc03 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,38 @@ +## Summary + + +## Motivation / context + +Why is this needed? Link an issue if one exists: Fixes # + +## Type of change + +- [ ] Bug fix (user-visible misbehavior or broken command) +- [ ] Feature / UX improvement +- [ ] Refactor (no intended user-visible change) +- [ ] Tests only +- [ ] Docs / comments / metadata + +## Risk & rollout + +- **User impact:** (none / low / medium) — brief note +- **Backward compatibility:** (yes / no — explain if no) + +## Verification + +What did you run locally? + +- [ ] `go test ./...` +- [ ] `go vet ./...` +- [ ] `gofmt` clean +- [ ] Exercised the command path manually (describe below) + +**Manual check (optional):** + +```text +(paste commands + short output) +``` + +## Screenshots / TUI + +If this affects Bubble Tea / tables / spinners, attach a short recording or screenshot when possible. diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..2f2a74c --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,72 @@ +# Copyright 2026 The Fluid Authors. +# +# 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. + +# CI uses only the Go toolchain and GitHub-hosted runners (no Dagger or other build DAG). + +name: CI + +on: + push: + branches: [main] + pull_request: + paths-ignore: + - "*.md" + - "assets/**" + - "doc/**" + workflow_dispatch: + +concurrency: + group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Verify module checksums + run: go mod verify + + - name: Verify gofmt + run: | + set -euo pipefail + out="$(find . -name '*.go' -not -path './vendor/*' -print0 | xargs -0 -r gofmt -l)" + if [ -n "${out}" ]; then + echo "${out}" + exit 1 + fi + + - name: Vet + run: go vet ./... + + - name: Test (race) + run: go test ./... -count=1 -race -timeout=5m + + - name: Build + env: + CGO_ENABLED: "0" + run: | + go build -trimpath -ldflags '-s -w' -o /dev/null ./cmd/fluid diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..1e511b9 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,136 @@ +# Copyright 2026 The Fluid Authors. +# +# 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. + +# Publishes tarball artifacts to a GitHub Release when a semver tag is pushed, +# or when this workflow is run manually against an existing tag. +# Builds use plain `go build` — no container DAG / Dagger. + +name: Release + +on: + push: + tags: + - "v*.*.*" + workflow_dispatch: + inputs: + tag: + description: "Existing git tag to build and publish (e.g. v1.0.0)" + required: true + type: string + +concurrency: + group: release-${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} + cancel-in-progress: false + +permissions: + contents: write + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Vet + run: go vet ./... + + - name: Test (race) + run: go test ./... -count=1 -race -timeout=5m + + release: + needs: test + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Resolve release tag + id: meta + shell: bash + run: | + set -euo pipefail + if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then + TAG="${{ inputs.tag }}" + else + TAG="${GITHUB_REF_NAME}" + fi + TAG="${TAG#refs/tags/}" + if [[ ! "${TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::error ::Tag must look like vMAJOR.MINOR.PATCH (got: ${TAG})" + exit 1 + fi + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + echo "Releasing ${TAG}" + + - name: Build release archives + env: + TAG: ${{ steps.meta.outputs.tag }} + shell: bash + run: | + set -euo pipefail + COMMIT="$(git rev-parse --short HEAD)" + DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" + # Match Makefile versioning; use reproducible-ish builds on the runner. + LDFLAGS="-s -w \ + -X github.com/fluid-cloudnative/fluid-cli/cmd/fluid/internal/version.Version=${TAG} \ + -X github.com/fluid-cloudnative/fluid-cli/cmd/fluid/internal/version.GitCommit=${COMMIT} \ + -X github.com/fluid-cloudnative/fluid-cli/cmd/fluid/internal/version.BuildDate=${DATE}" + + mkdir -p artifacts tmp + for os in linux darwin; do + for arch in amd64 arm64; do + dir="tmp/fluid_${TAG}_${os}_${arch}" + mkdir -p "$dir" + CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" \ + go build -trimpath -buildid= -ldflags="${LDFLAGS}" -o "$dir/fluid" ./cmd/fluid + tar -czf "artifacts/fluid_${TAG}_${os}_${arch}.tar.gz" -C "$dir" fluid + done + done + rm -rf tmp + ( cd artifacts && sha256sum fluid_*.tar.gz > checksums.txt ) + + - name: Publish GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.meta.outputs.tag }} + name: Fluid CLI ${{ steps.meta.outputs.tag }} + files: | + artifacts/*.tar.gz + artifacts/checksums.txt + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}