Skip to content

Commit a4b159e

Browse files
feat: add CI/CD workflows and project setup (#1)
* feat: add CI/CD workflows and project setup - Added GitHub Actions workflows (CLA, CI, Release) - Added Dockerfile with multi-stage build (Node + Nginx) - Added comprehensive README with Module examples - Added CLA.md and CONTRIBUTING.md - Added GitHub issue templates (bug, feature, question) - Added branch protection guidelines - Update .gitignore for React app * fix: remove --only=production flag from npm ci in Dockerfile React builds require devDependencies (react-scripts) to run npm run build * fix: allow package-lock.json in Docker build context npm ci requires package-lock.json to be present * fix: update test to match actual App component Replace default CRA test with test that checks for app-container * fix: add missing dependencies to useEffect hooks - Wrap loadWorkspaces in useCallback - Add loadWorkspaces to useEffect dependency arrays - Fixes ESLint react-hooks/exhaustive-deps warnings * fix: remove unused formatDate function Fixes ESLint no-unused-vars warning * fix: remove unused getStatusBadgeClass and getStatusIcon functions Fixes ESLint no-unused-vars warnings * fix: remove unused icon imports Remove FiLoader, FiAlertCircle, FiClock - no longer used after removing helper functions
1 parent 237e32b commit a4b159e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+22525
-0
lines changed

.dockerignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Dependencies
2+
node_modules
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
yarn.lock
7+
8+
# Testing
9+
coverage
10+
.nyc_output
11+
12+
# Production
13+
build
14+
dist
15+
16+
# Misc
17+
.DS_Store
18+
.env
19+
.env.local
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
*.log
24+
25+
# IDE
26+
.vscode
27+
.idea
28+
*.swp
29+
*.swo
30+
*~
31+
32+
# Git
33+
.git
34+
.gitignore
35+
.github
36+
37+
# Documentation
38+
README.md
39+
docs
40+
41+
# CI/CD
42+
.github/workflows
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Bug Report
2+
description: Report a bug or unexpected behavior
3+
labels: ["bug", "needs-triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to report a bug! Please fill out the form below with as much detail as possible.
9+
10+
- type: textarea
11+
id: description
12+
attributes:
13+
label: Bug Description
14+
description: A clear and concise description of what the bug is.
15+
placeholder: The module deployment wizard crashes when...
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: reproduce
21+
attributes:
22+
label: Steps to Reproduce
23+
description: Steps to reproduce the behavior
24+
placeholder: |
25+
1. Go to '...'
26+
2. Click on '...'
27+
3. Scroll down to '...'
28+
4. See error
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
id: expected
34+
attributes:
35+
label: Expected Behavior
36+
description: What did you expect to happen?
37+
placeholder: The module should deploy successfully...
38+
validations:
39+
required: true
40+
41+
- type: textarea
42+
id: actual
43+
attributes:
44+
label: Actual Behavior
45+
description: What actually happened?
46+
placeholder: Instead, I see an error message...
47+
validations:
48+
required: true
49+
50+
- type: textarea
51+
id: screenshots
52+
attributes:
53+
label: Screenshots
54+
description: If applicable, add screenshots to help explain your problem.
55+
placeholder: Drag and drop images here or paste URLs
56+
57+
- type: dropdown
58+
id: browser
59+
attributes:
60+
label: Browser
61+
description: Which browser are you using?
62+
options:
63+
- Chrome
64+
- Firefox
65+
- Safari
66+
- Edge
67+
- Other
68+
validations:
69+
required: true
70+
71+
- type: input
72+
id: browser-version
73+
attributes:
74+
label: Browser Version
75+
description: What version of the browser?
76+
placeholder: "120.0.6099.129"
77+
78+
- type: input
79+
id: ui-version
80+
attributes:
81+
label: Operator UI Version
82+
description: What version of the Operator UI are you using?
83+
placeholder: "v0.1.0"
84+
validations:
85+
required: true
86+
87+
- type: input
88+
id: operator-version
89+
attributes:
90+
label: Forkspacer Operator Version
91+
description: What version of the Forkspacer operator is running?
92+
placeholder: "v0.1.3"
93+
94+
- type: textarea
95+
id: environment
96+
attributes:
97+
label: Environment Details
98+
description: Any other relevant environment information
99+
placeholder: |
100+
- OS: macOS 14.0
101+
- Kubernetes version: 1.28
102+
- Deployment method: Helm
103+
104+
- type: textarea
105+
id: logs
106+
attributes:
107+
label: Logs
108+
description: If applicable, paste any relevant logs or error messages
109+
render: shell
110+
111+
- type: textarea
112+
id: additional
113+
attributes:
114+
label: Additional Context
115+
description: Add any other context about the problem here

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: GitHub Discussions
4+
url: https://github.com/forkspacer/operator-ui/discussions
5+
about: Ask questions and discuss ideas with the community
6+
- name: Documentation
7+
url: https://github.com/forkspacer/operator-ui#readme
8+
about: Read the documentation for setup and usage guides
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Feature Request
2+
description: Suggest a new feature or enhancement
3+
labels: ["enhancement", "needs-triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for suggesting a new feature! Please describe your idea below.
9+
10+
- type: textarea
11+
id: problem
12+
attributes:
13+
label: Problem Statement
14+
description: Is your feature request related to a problem? Please describe.
15+
placeholder: I'm frustrated when...
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: solution
21+
attributes:
22+
label: Proposed Solution
23+
description: Describe the solution you'd like
24+
placeholder: I would like the UI to...
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: alternatives
30+
attributes:
31+
label: Alternatives Considered
32+
description: Describe any alternative solutions or features you've considered
33+
placeholder: I also thought about...
34+
35+
- type: textarea
36+
id: use-case
37+
attributes:
38+
label: Use Case
39+
description: How would this feature benefit you or other users?
40+
placeholder: This would help me...
41+
42+
- type: textarea
43+
id: additional
44+
attributes:
45+
label: Additional Context
46+
description: Add any other context, screenshots, or mockups about the feature request
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Question
2+
description: Ask a question about usage or configuration
3+
labels: ["question"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Have a question? Please fill out the form below.
9+
10+
- type: textarea
11+
id: question
12+
attributes:
13+
label: Question
14+
description: What would you like to know?
15+
placeholder: How do I...
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: context
21+
attributes:
22+
label: Context
23+
description: Provide any relevant context or what you've already tried
24+
placeholder: I'm trying to... I've already looked at...
25+
26+
- type: input
27+
id: version
28+
attributes:
29+
label: Operator UI Version
30+
description: What version are you using?
31+
placeholder: "v0.1.0"
32+
33+
- type: textarea
34+
id: additional
35+
attributes:
36+
label: Additional Information
37+
description: Any other relevant information

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '18'
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linter
30+
run: npm run lint --if-present || echo "No lint script found, skipping"
31+
32+
test:
33+
name: Test
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '18'
43+
cache: 'npm'
44+
45+
- name: Install dependencies
46+
run: npm ci
47+
48+
- name: Run tests
49+
run: npm test -- --coverage --watchAll=false --passWithNoTests
50+
51+
build:
52+
name: Build
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Setup Node.js
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: '18'
62+
cache: 'npm'
63+
64+
- name: Install dependencies
65+
run: npm ci
66+
67+
- name: Build application
68+
run: npm run build
69+
70+
docker-build:
71+
name: Docker Build (Verification)
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v4
76+
77+
- name: Set up Docker Buildx
78+
uses: docker/setup-buildx-action@v3
79+
80+
- name: Build Docker image (no push)
81+
uses: docker/build-push-action@v5
82+
with:
83+
context: .
84+
push: false
85+
tags: ghcr.io/forkspacer/operator-ui:test
86+
cache-from: type=gha
87+
cache-to: type=gha,mode=max

.github/workflows/cla.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "CLA Assistant"
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_target:
7+
types: [opened, closed, synchronize, reopened]
8+
9+
permissions:
10+
actions: write
11+
contents: write
12+
pull-requests: write
13+
statuses: write
14+
15+
jobs:
16+
CLAAssistant:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: "CLA Assistant"
20+
if: >
21+
(github.event.comment.body == 'recheck' ||
22+
github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') ||
23+
github.event_name == 'pull_request_target'
24+
uses: contributor-assistant/[email protected]
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
with:
28+
path-to-signatures: 'signatures/version1/cla.json'
29+
path-to-document: 'CLA.md'
30+
branch: 'cla-signatures'
31+
allowlist: 'bot*,dependabot[bot]'
32+
use-dco-flag: false
33+
lock-pullrequest-aftermerge: true
34+
suggest-recheck: true

0 commit comments

Comments
 (0)