Skip to content

Commit 7599c8a

Browse files
Align files (#376)
Co-authored-by: github-actions <action@github.com>
1 parent 24dbdcc commit 7599c8a

9 files changed

Lines changed: 148 additions & 17 deletions
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
description: Instructions for AI/LLM assistants
3+
alwaysApply: true
4+
---
5+
6+
# Instructions for AI/LLM assistants
7+
8+
You are an AI assistant acting as an expert software developer and platform engineer working on Giant Swarm platform components. Your task is to act as a pair programmer and help others working in this codebase to keep the code delightful to work with. This includes ensuring that the code adheres to Giant Swarm's quality standards, keeping the project well-architected and organized, and maintaining supporting documentation, diagrams, and rules for other AI assistants.
9+
10+
# Persona: Senior Giant Swarm Platform Engineer
11+
12+
- **Technical Depth**: You are a domain expert in Go (formerly, golang), Helm, Kubernetes APIs and development, software design patterns, software architecture, Go application security, software testing, and software performance optimization,
13+
- **Problem-Solver**: You approach issues methodically, prioritizing safety and stability. You first investigate deeply with the tools provided to you, before suggesting changes. You find and fix the root cause, not the symptoms.
14+
- **Clear Communicator**: You explain complex topics clearly and provide actionable steps.
15+
- **Collaborative**: You guide users, suggest diagnostic paths, and help them think through problems.
16+
- **Best Practices**: You adhere to Giant Swarm operational and technical standards.
17+
18+
# Reviewer Guidelines
19+
20+
## Core Behaviors
21+
22+
- Unless directed by the user, never use or recommend external linters, code analysis, or other tooling which isn't already recommended in Giant Swarm agent rules or style guides.
23+
- Always adhere to the central coding guidelines and best practices maintained at: @https://github.com/giantswarm/fmt/
24+
- Prioritize readability, maintainability, and security.
25+
- Write comprehensive tests and documentation.
26+
- If documentation is available in the `docs` folder, keep this up-to-date when changing code.
27+
- Maintain the main README.md file for correctness.
28+
- If a changelog is available as CHANGELOG.md, add your changes to it.
29+
30+
## Release Management
31+
32+
- Follow the changelog and release guidelines from @https://github.com/giantswarm/fmt/tree/main/releases
33+
- Use semantic versioning and conventional commits
34+
35+
36+
## Language-Specific Guidelines
37+
38+
Additional language-specific rules can be found in the general style guide and in the other rules files in this repository.
39+
40+
41+
### Go Development
42+
43+
- Go code must always adhere to the Go language-specific development guidelines and patterns rules in this repository.
44+
45+
### Go Application Security
46+
47+
- Ensure all Go dependencies are up to date.
48+
- Follow best security practices for Go applications.
49+
50+
51+
---
52+
53+
For detailed guidelines and examples, always refer to: @https://github.com/giantswarm/fmt/
54+
55+
56+
<!--
57+
DO NOT EDIT. Generated with devctl.
58+
This file is maintained at:
59+
https://github.com/giantswarm/devctl/blob/3bbd5cb47ff855f0b9c88881fbdcaa907d85647c/pkg/gen/input/llm/internal/file/base_llm_rules.mdc.template
60+
Manual changes will be overwritten.
61+
-->
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
description: Go language-specific development guidelines and patterns
3+
globs: **/*.go,go.mod,go.sum
4+
---
5+
6+
These guidelines apply to Go code and supplement any other general development instructions or workflows.
7+
8+
# Go Code Guidelines
9+
10+
- All Go code is expected to adhere to the rules outlined in the Giant Swarm style guide located at @https://github.com/giantswarm/fmt/tree/main/go .
11+
- Always fetch and fully understand the style guide before reviewing any code.
12+
- The Giant Swarm style guide linked above must always be considered definitive. ALL rules and provisions contained in the style guide MUST be met.
13+
- When applying the style guide, always list all instances of a particular issue, grouped by the finding type.
14+
15+
## Formatting
16+
17+
CI will perform the following check for proper code formatting and sorting/grouping of imports:
18+
19+
```bash
20+
go install golang.org/x/tools/cmd/goimports@latest && \
21+
if [[ -n $(goimports -local github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} -l .) ]];
22+
then
23+
goimports -local github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} -d . && exit 1;
24+
fi
25+
```
26+
27+
When creating or modifying Go files, perform the according check and mitigate any issues before committing.
28+
29+
30+
<!--
31+
DO NOT EDIT. Generated with devctl.
32+
This file is maintained at:
33+
https://github.com/giantswarm/devctl/blob/83dbeb7aedca2abc8fd38c99e3cfa49f58d8ff82/pkg/gen/input/llm/internal/file/go_rules.mdc.template
34+
Manual changes will be overwritten.
35+
-->

.github/workflows/pre_commit_go.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
go-version: "1.25"
2323
- name: Install goimports
2424
run: |
25-
go install golang.org/x/tools/cmd/goimports@v0.34.0
25+
go install golang.org/x/tools/cmd/goimports@v0.40.0
2626
- name: Install golangci-lint
2727
uses: giantswarm/install-binary-action@c37eb401e5092993fc76d545030b1d1769e61237 # v3.0.0
2828
with:

.github/workflows/zz_generated.create_release.yaml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/063b90515fe92a8350c734f2caea0343ae3aca64/pkg/gen/input/workflows/internal/file/create_release.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/1acd23e6a78c21ca61ccbe8a7e5a8a3139feeab5/pkg/gen/input/workflows/internal/file/create_release.yaml.template
66
#
77
name: Create Release
88
on:
@@ -14,6 +14,9 @@ on:
1414
- 'release-v*.*.x'
1515
# "!" negates previous positive patterns so it has to be at the end.
1616
- '!release-v*.x.x'
17+
18+
permissions: {}
19+
1720
jobs:
1821
debug_info:
1922
name: Debug info
@@ -27,6 +30,8 @@ jobs:
2730
gather_facts:
2831
name: Gather facts
2932
runs-on: ubuntu-22.04
33+
permissions:
34+
contents: read
3035
outputs:
3136
project_go_path: ${{ steps.get_project_go_path.outputs.path }}
3237
ref_version: ${{ steps.ref_version.outputs.refversion }}
@@ -54,7 +59,7 @@ jobs:
5459
echo "version=${version}" >> $GITHUB_OUTPUT
5560
- name: Checkout code
5661
if: ${{ steps.get_version.outputs.version != '' }}
57-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
62+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5863
- name: Get project.go path
5964
id: get_project_go_path
6065
if: ${{ steps.get_version.outputs.version != '' }}
@@ -85,25 +90,27 @@ jobs:
8590
update_project_go:
8691
name: Update project.go
8792
runs-on: ubuntu-22.04
93+
permissions:
94+
contents: read
8895
if: ${{ needs.gather_facts.outputs.version != '' && needs.gather_facts.outputs.project_go_path != '' && needs.gather_facts.outputs.ref_version != 'true' }}
8996
needs:
9097
- gather_facts
9198
steps:
9299
- name: Install architect
93-
uses: giantswarm/install-binary-action@0797deb878056114fa54ee30c519f617716e8c69 # v3.1.1
100+
uses: giantswarm/install-binary-action@c94c7adadeb14af4bdbdd601f9a6e7f69638134c # v4.0.0
94101
with:
95102
binary: "architect"
96103
version: "6.14.1"
97104
- name: Install semver
98-
uses: giantswarm/install-binary-action@0797deb878056114fa54ee30c519f617716e8c69 # v3.1.1
105+
uses: giantswarm/install-binary-action@c94c7adadeb14af4bdbdd601f9a6e7f69638134c # v4.0.0
99106
with:
100107
binary: "semver"
101108
version: "3.2.0"
102109
download_url: "https://github.com/fsaintjacques/${binary}-tool/archive/${version}.tar.gz"
103110
tarball_binary_path: "*/src/${binary}"
104111
smoke_test: "${binary} --version"
105112
- name: Checkout code
106-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
113+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
107114
- name: Update project.go
108115
id: update_project_go
109116
env:
@@ -156,14 +163,16 @@ jobs:
156163
create_release:
157164
name: Create release
158165
runs-on: ubuntu-22.04
166+
permissions:
167+
contents: read
159168
needs:
160169
- gather_facts
161170
if: ${{ needs.gather_facts.outputs.version }}
162171
outputs:
163172
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
164173
steps:
165174
- name: Checkout code
166-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
175+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
167176
with:
168177
ref: ${{ github.sha }}
169178
- name: Ensure correct version in project.go
@@ -204,20 +213,22 @@ jobs:
204213
create-release-branch:
205214
name: Create release branch
206215
runs-on: ubuntu-22.04
216+
permissions:
217+
contents: write
207218
needs:
208219
- gather_facts
209220
if: ${{ needs.gather_facts.outputs.version }}
210221
steps:
211222
- name: Install semver
212-
uses: giantswarm/install-binary-action@0797deb878056114fa54ee30c519f617716e8c69 # v3.1.1
223+
uses: giantswarm/install-binary-action@c94c7adadeb14af4bdbdd601f9a6e7f69638134c # v4.0.0
213224
with:
214225
binary: "semver"
215226
version: "3.0.0"
216227
download_url: "https://github.com/fsaintjacques/${binary}-tool/archive/${version}.tar.gz"
217228
tarball_binary_path: "*/src/${binary}"
218229
smoke_test: "${binary} --version"
219230
- name: Check out the repository
220-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
231+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
221232
with:
222233
fetch-depth: 0 # Clone the whole history, not just the most recent commit.
223234
- name: Fetch all tags and branches

.github/workflows/zz_generated.create_release_pr.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/ad0a25fbf301b2513e169ec964a8785d28f75be4/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template
66
#
77
name: Create Release PR
88
on:
@@ -30,9 +30,13 @@ on:
3030
required: true
3131
type: string
3232

33+
permissions: {}
34+
3335
jobs:
3436
publish:
3537
uses: giantswarm/github-workflows/.github/workflows/create-release-pr.yaml@main
38+
permissions:
39+
contents: read
3640
with:
3741
branch: ${{ inputs.branch }}
3842
secrets:

.github/workflows/zz_generated.fix_vulnerabilities.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/251fa7d9bd403e23321bad6714c1e26c375fedf3/pkg/gen/input/workflows/internal/file/fix_vulnerabilities.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/fix_vulnerabilities.yaml.template
66
#
77

88
name: Fix Go vulnerabilities
@@ -16,12 +16,21 @@ on:
1616
description: Branch on which to fix vulnerabilities
1717
required: true
1818
type: string
19+
log_level:
20+
description: Log Level (info / error / debug)
21+
default: "info"
22+
type: string
23+
24+
permissions: {}
1925

2026
jobs:
2127
fix:
2228
uses: giantswarm/github-workflows/.github/workflows/fix-vulnerabilities.yaml@main
29+
permissions:
30+
contents: read
2331
with:
2432
branch: ${{ inputs.branch || github.ref }}
33+
log_level: ${{ inputs.log_level }}
2534
secrets:
2635
HERALD_APP_ID: ${{ secrets.HERALD_APP_ID }}
2736
HERALD_APP_KEY: ${{ secrets.HERALD_APP_KEY }}

.github/workflows/zz_generated.gitleaks.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/ad0a25fbf301b2513e169ec964a8785d28f75be4/pkg/gen/input/workflows/internal/file/gitleaks.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/gitleaks.yaml.template
66
#
77
name: gitleaks
88

99
on:
1010
- pull_request
1111

12+
permissions: {}
13+
1214
jobs:
1315
publish:
1416
uses: giantswarm/github-workflows/.github/workflows/gitleaks.yaml@main
17+
permissions:
18+
contents: read

.github/workflows/zz_generated.run_ossf_scorecard.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/ad0a25fbf301b2513e169ec964a8785d28f75be4/pkg/gen/input/workflows/internal/file/run_ossf_scorecard.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/run_ossf_scorecard.yaml.template
66
#
77

88
# This workflow uses actions that are not certified by GitHub. They are provided
@@ -24,8 +24,14 @@ on:
2424
- master
2525
workflow_dispatch: {}
2626

27+
permissions: {}
28+
2729
jobs:
2830
analysis:
2931
uses: giantswarm/github-workflows/.github/workflows/ossf-scorecard.yaml@main
32+
permissions:
33+
contents: read
34+
security-events: write
35+
id-token: write
3036
secrets:
3137
scorecard_token: ${{ secrets.SCORECARD_TOKEN }}

.github/workflows/zz_generated.validate_changelog.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/ad0a25fbf301b2513e169ec964a8785d28f75be4/pkg/gen/input/workflows/internal/file/validate_changelog.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/validate_changelog.yaml.template
66
#
77
name: Validate changelog
88

@@ -12,10 +12,11 @@ on:
1212
paths:
1313
- 'CHANGELOG.md'
1414

15-
permissions:
16-
contents: read
17-
pull-requests: write
15+
permissions: {}
1816

1917
jobs:
2018
validate-changelog:
2119
uses: giantswarm/github-workflows/.github/workflows/validate-changelog.yaml@main
20+
permissions:
21+
contents: read
22+
pull-requests: write

0 commit comments

Comments
 (0)