Skip to content

Commit 305ae7b

Browse files
authored
feat: initial commit of framework copied from VMClarity (#1)
1 parent a46c9ba commit 305ae7b

25 files changed

+1469
-2
lines changed

.github/CODEOWNERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# CODEOWNERS reference: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
2+
3+
# These owners will be the default owners for everything in
4+
# the repo. Unless a later match takes precedence,
5+
# the following users/teams will be requested for
6+
# review when someone opens a pull request.
7+
* @openclarity/vmclarity-maintainers
8+
9+
# Enforces admin protections for repo configuration via probot settings app.
10+
# ref: https://github.com/probot/settings#security-implications
11+
.github/settings.yml @openclarity/vmclarity-admins
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Description
11+
12+
Please provide a description of the problem.
13+
14+
## Expected Behavior
15+
16+
Please describe what you expected would happen.
17+
18+
## Actual Behavior
19+
20+
Please describe what happened instead.
21+
22+
## Affected Version
23+
24+
Please provide the version number where this issue was encountered.
25+
26+
## Steps to Reproduce
27+
28+
1. First step
29+
1. Second step
30+
1. etc.
31+
32+
## Checklist
33+
34+
- [ ] I have read the [contributing guidelines](/CONTRIBUTING.md)
35+
- [ ] I have verified this does not duplicate an existing issue
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a feature for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Problem Statement
11+
12+
Please describe the problem to be addressed by the proposed feature.
13+
14+
## Proposed Solution
15+
16+
Please describe what you envision the solution to this problem would look like.
17+
18+
## Alternatives Considered
19+
20+
Please briefly describe which alternatives, if any, have been considered, including merits of alternate approaches and
21+
tradeoffs being made.
22+
23+
## Additional Context
24+
25+
Please provide any other information that may be relevant.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Description
2+
3+
Please provide a meaningful description of what this change will do, or is for. Bonus points for including links to
4+
related issues, other PRs, or technical references.
5+
6+
Note that by _not_ including a description, you are asking reviewers to do extra work to understand the context of this
7+
change, which may lead to your PR taking much longer to review, or result in it not being reviewed at all.
8+
9+
## Type of Change
10+
11+
[ ] Bug Fix
12+
[ ] New Feature
13+
[ ] Breaking Change
14+
[ ] Refactor
15+
[ ] Documentation
16+
[ ] Other (please describe)
17+
18+
## Checklist
19+
20+
- [ ] I have read the [contributing guidelines](https://github.com/openclarity/vmclarity/blob/main/CONTRIBUTING.md)
21+
- [ ] Existing issues have been referenced (where applicable)
22+
- [ ] I have verified this change is not present in other open pull requests
23+
- [ ] Functionality is documented
24+
- [ ] All code style checks pass
25+
- [ ] New code contribution is covered by automated tests
26+
- [ ] All new and existing tests pass

.github/actionlint-matcher.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "actionlint",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 4,
12+
"code": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: docker
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10
13+
- package-ecosystem: github-actions
14+
directory: "/"
15+
schedule:
16+
interval: daily
17+
open-pull-requests-limit: 10

.github/settings.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
repository:
2+
# See https://developer.github.com/v3/repos/#edit for all available settings.
3+
4+
# The name of the repository. Changing this will rename the repository
5+
name: simple-controller-runtime
6+
7+
# A short description of the repository that will show up on GitHub
8+
description: |
9+
A simple implementation similar to the Kubernetes controller runtime which
10+
can be used to create controllers for both kubernetes and non-kubernetes
11+
resources.
12+
13+
# A URL with more information about the repository
14+
homepage: openclarity.io
15+
16+
# Updates the default branch for this repository.
17+
default_branch: main
18+
19+
# Either `true` to enable automated security fixes, or `false` to disable
20+
# automated security fixes.
21+
enable_automated_security_fixes: true
22+
23+
# Either `true` to enable vulnerability alerts, or `false` to disable
24+
# vulnerability alerts.
25+
enable_vulnerability_alerts: true
26+
27+
# Either `true` to allow squash-merging pull requests, or `false` to prevent
28+
# squash-merging.
29+
allow_squash_merge: true
30+
31+
# Either `true` to allow merging pull requests with a merge commit, or `false`
32+
# to prevent merging pull requests with merge commits.
33+
allow_merge_commit: false
34+
35+
# Either `true` to allow rebase-merging pull requests, or `false` to prevent
36+
# rebase-merging.
37+
allow_rebase_merge: true
38+
39+
# Either `true` to enable automatic deletion of branches on merge, or `false` to disable
40+
delete_branch_on_merge: false
41+
42+
# See https://docs.github.com/en/rest/reference/teams#add-or-update-team-repository-permissions for available options
43+
teams:
44+
- name: vmclarity-admins
45+
# The permission to grant the team. Can be one of:
46+
# * `pull` - can pull, but not push to or administer this repository.
47+
# * `push` - can pull and push, but not administer this repository.
48+
# * `admin` - can pull, push and administer this repository.
49+
# * `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions.
50+
permission: admin
51+
52+
- name: vmclarity-maintainers
53+
permission: maintain
54+
55+
# Collaborators: give specific users access to this repository.
56+
# See https://docs.github.com/en/rest/reference/collaborators for available options
57+
collaborators: []
58+
59+
branches:
60+
- name: main
61+
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
62+
# Branch Protection settings. Set to null to disable
63+
protection:
64+
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
65+
required_pull_request_reviews:
66+
# The number of approvals required. (1-6)
67+
required_approving_review_count: 1
68+
# Dismiss approved reviews automatically when a new commit is pushed.
69+
dismiss_stale_reviews: true
70+
# Blocks merge until code owners have reviewed.
71+
require_code_owner_reviews: true
72+
# Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions object to disable. User and team dismissal_restrictions are only available for organization-owned repositories. Omit this parameter for personal repositories.
73+
dismissal_restrictions:
74+
users: []
75+
teams: []
76+
# Required. Require status checks to pass before merging. Set to null to disable
77+
required_status_checks:
78+
# Required. Require branches to be up to date before merging.
79+
strict: true
80+
# Required. The list of status checks to require in order to merge into this branch
81+
contexts: []
82+
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
83+
enforce_admins: true
84+
# Prevent merge commits from being pushed to matching branches
85+
required_linear_history: true
86+
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
87+
restrictions:
88+
apps: []
89+
users: []
90+
teams: []

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
merge_group:
6+
7+
permissions:
8+
pull-requests: write
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
verification:
16+
name: Verification
17+
uses: ./.github/workflows/reusable-verification.yml
18+
secrets: inherit
19+
20+
success:
21+
needs:
22+
- verification
23+
name: Success
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Echo Success
27+
run: |
28+
echo "::notice Success!"
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Verification
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
licenses:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Go
14+
uses: actions/setup-go@v4
15+
with:
16+
cache-dependency-path: "**/*.sum"
17+
go-version-file: 'go.mod'
18+
19+
- name: Check license header
20+
run: make license-header
21+
22+
- name: License cache
23+
uses: actions/cache@v3
24+
with:
25+
path: .licensei.cache
26+
key: licensei-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}
27+
restore-keys: |
28+
licensei-${{ github.ref_name }}-
29+
licensei-${{ github.event.repository.default_branch }}-
30+
31+
- name: Download license information for dependencies
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: make license-cache
35+
36+
- name: Vendor dependencies to retrieve licenses locally
37+
# Vendor deps before running https://github.com/goph/licensei
38+
# to avoid false-positives when modules Github repo could not be determined
39+
run: go mod vendor
40+
41+
- name: Check licenses
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
run: make license-check
45+
46+
actions:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Lint Github workflows
53+
run: |
54+
echo "::add-matcher::.github/actionlint-matcher.json"
55+
make lint-actions
56+
echo "::remove-matcher owner=actionlint::"
57+
58+
go:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: Set up Go
65+
uses: actions/setup-go@v4
66+
with:
67+
# NOTE(chrisgacsal): Use actions/cache for caching Go dependency and build caches
68+
# as if provides better flexibility like setting the cache key which reduces cache misses significantly.
69+
cache: false
70+
go-version-file: 'go.mod'
71+
72+
- name: Setup Go caching
73+
uses: actions/cache@v3
74+
with:
75+
path: |
76+
~/.cache/go-build
77+
~/go/pkg/mod
78+
key: ${{ runner.os }}-go-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}
79+
restore-keys: |
80+
${{ runner.os }}-go-${{ github.ref_name }}-
81+
${{ runner.os }}-go-${{ github.event.repository.default_branch }}-
82+
83+
- name: Cache golangci-lint cache
84+
uses: actions/cache@v3
85+
with:
86+
path: ${{ github.workspace }}/.golangci.cache
87+
key: golangci-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}
88+
restore-keys: |
89+
golangci-${{ github.ref_name }}-
90+
golangci-${{ github.event.repository.default_branch }}-
91+
92+
- name: Run linters
93+
env:
94+
GOLANGCI_LINT_CACHE: ${{ github.workspace }}/.golangci.cache
95+
run: |
96+
make lint-go
97+
98+
- name: Run tests
99+
run: |
100+
make test

0 commit comments

Comments
 (0)