Skip to content

Commit e32037b

Browse files
chore: initial project setup
Add GitHub Actions workflow to validate Rusts This includes checking code formatting with `cargo fmt`, linting with `cargo clippy`, and running tests with `cargo test`. The workflow uses matcher definitions for Cargo error output to improve the error display in the GitHub Actions log output. It also uses a Rust actions cache to speed up subsequent workflow runs. Additionally, this commit adds a basic `.gitignore` file, a `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md` documentation file with contribution guidelines, and a `SECURITY.md` file with vulnerability reporting instructions.
1 parent fe5da10 commit e32037b

File tree

10 files changed

+502
-1
lines changed

10 files changed

+502
-1
lines changed

.github/matcher/cargo.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "Cargo (Rust)",
5+
"pattern": [
6+
{
7+
"regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$",
8+
"severity": 1,
9+
"message": 4,
10+
"code": 3
11+
},
12+
{
13+
"regexp": "^([\\s\\->=]*(.*):(\\d*):(\\d*)|.*)$",
14+
"file": 2,
15+
"line": 3,
16+
"column": 4
17+
}
18+
]
19+
}
20+
]
21+
}

.github/workflows/validate.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Validate
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: validate-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
env:
17+
CARGO_TERM_COLOR: always
18+
CARGO_INCREMENTAL: 0
19+
RUST_BACKTRACE: 1
20+
21+
jobs:
22+
validate:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
26+
- uses: swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2
27+
with:
28+
save-if: ${{ github.ref == 'refs/heads/main' }}
29+
cache-provider: "github"
30+
- run: echo "::add-matcher::.github/matcher/cargo.json"
31+
- name: Check formatting
32+
run: cargo fmt --check
33+
- name: Lint
34+
run: cargo clippy
35+
- name: Test
36+
run: cargo test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

CODE_OF_CONDUCT.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual
11+
identity and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
* Demonstrating empathy and kindness toward other people
22+
* Being respectful of differing opinions, viewpoints, and experiences
23+
* Giving and gracefully accepting constructive feedback
24+
* Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
* Focusing on what is best not just for us as individuals, but for the overall
27+
community
28+
29+
Examples of unacceptable behavior include:
30+
31+
* The use of sexualized language or imagery, and sexual attention or advances of
32+
any kind
33+
* Trolling, insulting or derogatory comments, and personal or political attacks
34+
* Public or private harassment
35+
* Publishing others' private information, such as a physical or email address,
36+
without their explicit permission
37+
* Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official email address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
<!-- TODO: Insert contact method -->
63+
64+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
65+
reported to the community leaders responsible for enforcement at `community@katulu.io`.
66+
All complaints will be reviewed and investigated promptly and fairly.
67+
68+
All community leaders are obligated to respect the privacy and security of the
69+
reporter of any incident.
70+
71+
## Enforcement Guidelines
72+
73+
Community leaders will follow these Community Impact Guidelines in determining
74+
the consequences for any action they deem in violation of this Code of Conduct:
75+
76+
### 1. Correction
77+
78+
**Community Impact**: Use of inappropriate language or other behavior deemed
79+
unprofessional or unwelcome in the community.
80+
81+
**Consequence**: A private, written warning from community leaders, providing
82+
clarity around the nature of the violation and an explanation of why the
83+
behavior was inappropriate. A public apology may be requested.
84+
85+
### 2. Warning
86+
87+
**Community Impact**: A violation through a single incident or series of
88+
actions.
89+
90+
**Consequence**: A warning with consequences for continued behavior. No
91+
interaction with the people involved, including unsolicited interaction with
92+
those enforcing the Code of Conduct, for a specified period of time. This
93+
includes avoiding interactions in community spaces as well as external channels
94+
like social media. Violating these terms may lead to a temporary or permanent
95+
ban.
96+
97+
### 3. Temporary Ban
98+
99+
**Community Impact**: A serious violation of community standards, including
100+
sustained inappropriate behavior.
101+
102+
**Consequence**: A temporary ban from any sort of interaction or public
103+
communication with the community for a specified period of time. No public or
104+
private interaction with the people involved, including unsolicited interaction
105+
with those enforcing the Code of Conduct, is allowed during this period.
106+
Violating these terms may lead to a permanent ban.
107+
108+
### 4. Permanent Ban
109+
110+
**Community Impact**: Demonstrating a pattern of violation of community
111+
standards, including sustained inappropriate behavior, harassment of an
112+
individual, or aggression toward or disparagement of classes of individuals.
113+
114+
**Consequence**: A permanent ban from any sort of public interaction within the
115+
community.
116+
117+
## Attribution
118+
119+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
120+
version 2.1, available at
121+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
122+
123+
Community Impact Guidelines were inspired by
124+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
128+
[https://www.contributor-covenant.org/translations][translations].
129+
130+
[homepage]: https://www.contributor-covenant.org
131+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
132+
[Mozilla CoC]: https://github.com/mozilla/diversity
133+
[FAQ]: https://www.contributor-covenant.org/faq
134+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# Contributing
2+
3+
This guide will help you understand the overall organization of the project. It's the single source of truth for how to contribute to the code base.
4+
5+
> [!TIP]
6+
> The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD","SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
7+
8+
## Setup
9+
10+
<!-- Setup rust -->
11+
12+
## Components
13+
14+
> [!IMPORTANT]
15+
> We will probably split this mono-repo into multiple ones to separate the different components and their responsibilities better, allow for easier maintenance and development, as well as ease license handling.
16+
17+
The project is organized into multiple components (crates), each with its own purpose and responsibilities.
18+
19+
```mermaid
20+
flowchart RL
21+
classDef transparent opacity:0
22+
23+
TODO["TODO: Add component overview"]
24+
```
25+
26+
<!-- TODO: Add short overview describing the main components purpose. -->
27+
28+
### Adding Components
29+
30+
New components SHOULD be added using `cargo new crates/${NAME}`. This will create a new crate directory with the standard Rust project structure.
31+
32+
After creating a new crate, you MUST link the appropriate license:
33+
34+
```sh
35+
ln -s LICENSE-${TYPE} crates/${NAME}/LICENSE-${TYPE}
36+
```
37+
38+
Where `${TYPE}` refers to the license type (e.g., `APACHE` for Apache-2.0).
39+
40+
Make sure to also update the license metadata in each crate's `Cargo.toml` file to correctly reflect the license being used:
41+
42+
```toml
43+
[package]
44+
# Other package metadata...
45+
license = "${TYPE}"
46+
```
47+
48+
The default license is Apache-2.0, but the project uses multiple licenses for the time being. If you're uncertain about which license to use, please consult the project lead. Make sure to use the SPDF license identifier, see https://spdx.org/licenses/ for more information.
49+
50+
### Adding Dependencies
51+
52+
When adding dependencies, these MUST be added to the respective crate's `Cargo.toml` file. You can add dependencies using:
53+
54+
```sh
55+
cargo add ${DEPENDENCY_NAME}
56+
```
57+
58+
Make sure that the dependency is compatible with the project's licenses.
59+
60+
## Upgrade Dependencies
61+
62+
All dependencies SHALL be updated regularly to maintain an up to date and secure product. Updates SHOULD consider backward compatibility and MUST document compatibility issues.
63+
64+
<!-- TODO: Setup dependabot for automatic dependency updates and security updates and document configuration. -->
65+
66+
## Version Control
67+
68+
Changes SHOULD be committed frequently in small logical chunks that MUST be consistent, work independently of any later commits, and pass the linter plus the tests. Doing so eases rollback and rebase operations. Commits MUST not include any customer data.
69+
70+
Commit message SHALL follow the guidelines stated here, as they provide a framework to write explicit messages that are easy to comprehend when looking through the project history and enable automatic changelog generation. Commit messages MUST never include references to individual customer.
71+
72+
The Guidelines are based on
73+
[AngularJS Git Commit Message Conventions](https://goo.gl/27wkkO).
74+
75+
This project uses `commitlint` to ensure that messages follow the guidelines.
76+
Run `yarn install` in the project root to install the respective git hooks.
77+
78+
### Commit-Message
79+
80+
Each commit message MUST consist of a header (type, subject), a body
81+
and a footer separated by empty lines:
82+
83+
```
84+
<type>: <subject>
85+
86+
<message>
87+
88+
<footer>
89+
```
90+
91+
Any line of the commit message MUST NOT be longer than 100 characters to ensure
92+
that the messages are easy to read.
93+
94+
#### Subject
95+
96+
The subject contains a succinct description of the change. It SHOULD use the
97+
imperative and present tense; “change” not “changed” nor “changes”.
98+
The first letter SHALL NOT be capitalized, and MUST NOT end it with a dot.
99+
100+
#### Type
101+
102+
The following commit types are allowed:
103+
104+
- **feat** -
105+
use this type for commits that introduce new features or capabilities
106+
- **fix** - use this one for bug fixes
107+
- **docs** - use this one to indicate documentation adjustments and improvements
108+
- **refactor** -
109+
use this type for adjustments to improve maintainability or performance
110+
- **test** - use this one for commits that add missing tests
111+
- **chore** - use this type for _maintainance_ commits e.g. removing old files
112+
- **ci** - use this type for CI adjustments
113+
- **style** - use this one for commits that fix formatting and linting errors
114+
115+
#### Message
116+
117+
The message SHOULD describe the motivation for the change and contrast it with previous behavior. It SHOULD use the imperative and present tense.
118+
119+
#### Referencing Issues
120+
121+
Closed issues MUST be listed on a separate line in the footer prefixed with
122+
"Closes" keyword.
123+
124+
#### Breaking Changes
125+
126+
All breaking changes MUST be mentioned in the footer with the description of
127+
the change, justification, and migration notes. Start the block explaining the
128+
breaking changes with the words `BREAKING CHANGE:` followed by a space.
129+
130+
### Examples
131+
132+
```
133+
fix: remove UI log statements
134+
135+
Remove console log statements to prevent IE4 errors.
136+
137+
Closes #123, #456
138+
```
139+
140+
```
141+
fix: gracefully handle HTTP connections
142+
143+
Gracefully handle 4xx and 5xx status codes to allow for retries when applicable.
144+
145+
Closes #123
146+
```
147+
148+
```
149+
feat: add new Graphana data sources
150+
151+
Introduce a new Graphana data source
152+
153+
Closes #123
154+
```
155+
156+
```
157+
refactor: change constant names
158+
159+
Adjust constant names, following the new naming conventions.
160+
161+
Closes #123
162+
```
163+
164+
```
165+
refactor: simplify video control interface
166+
167+
Simplify the video player control interface as the current
168+
interface is somewhat hard to use and caused bugs due
169+
to accidental misuse.
170+
171+
BREAKING CHANGE: VideoPlayer control interface has changed
172+
to simplify the general usage.
173+
174+
To migrate the code follow the example below:
175+
176+
Before:
177+
178+
VideoPlayer.prototype.stop({pause:true})
179+
180+
After:
181+
182+
VideoPlayer.prototype.pause()
183+
```

Cargo.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)