Skip to content

Commit

Permalink
ci(style): Add EditorConfig and relevant GH Action (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-stopka authored Jan 25, 2022
1 parent 3a51a7a commit 396e9e4
Show file tree
Hide file tree
Showing 31 changed files with 80 additions and 43 deletions.
36 changes: 36 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# editorconfig.org
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
trim_trailing_whitespace = true

[**.rs]
indent_size = 4

[*.md]
# double whitespace at end of line
# denotes a line break in Markdown
trim_trailing_whitespace = false
indent_size = 2

[**.json]
end_of_line = lf
insert_final_newline = false
charset = utf-8
trim_trailing_whitespace = true

[.gitignore]
end_of_line = lf
insert_final_newline = false
charset = utf-8
trim_trailing_whitespace = true

[README.md]
end_of_line = lf
insert_final_newline = false
charset = utf-8
trim_trailing_whitespace = true
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Ways to Contribute

_ALL_ contributions are welcome:
_ALL_ contributions are welcome:

- if you want to report a bug, please create a github issue following some [basic guidelines](#bug-report).
- if you want request a feature, please create a github issue following some [basic guidelines](#feature-request).
- if you want to submit a bugfix or new feature, please create a [pull request](#pull-requests).

## License

This project is licensed under the Apache-2.0 license.
This project is licensed under the Apache-2.0 license.

All contributions to the project will be licensed under the same terms. Please make sure you agree with these terms before working on your contribution.

Expand Down
2 changes: 1 addition & 1 deletion .github/chglog/RELEASE.tpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
2 changes: 1 addition & 1 deletion .github/chglog/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ options:
- Subject
notes:
keywords:
- BREAKING CHANGE
- BREAKING CHANGE
4 changes: 2 additions & 2 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
Expand All @@ -20,4 +20,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./book/book
publish_dir: ./book/book
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install pkg-config libssl-dev
- name: Prev Build | Get Dependencies [MacOS]
if: matrix.os == 'macOS-latest'
run: |
Expand Down Expand Up @@ -118,11 +118,11 @@ jobs:
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}

# Creates a GitHub Container package using multi-arch docker builds
container_build:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
Expand All @@ -141,7 +141,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand Down Expand Up @@ -188,4 +188,3 @@ jobs:
with:
files: oura-*/oura-*
body_path: RELEASE.md

7 changes: 5 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- '**'
tags-ignore:
- v*
- v*

name: Validate

Expand Down Expand Up @@ -80,4 +80,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -D warnings
args: -- -D warnings

- name: Check EditorConfig Compliance
uses: editorconfig-checker/action-editorconfig-checker@v1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ All contributions are welcome, but please read the [contributing guide](.github/

## License

This project is licensed under the Apache-2.0 license. Please see the [LICENSE](LICENSE.md) file for more details.
This project is licensed under the Apache-2.0 license. Please see the [LICENSE](LICENSE.md) file for more details.
2 changes: 1 addition & 1 deletion book/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
book
book
2 changes: 1 addition & 1 deletion book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
- [Reference](reference/README.md)
- [Data Dictionary](./reference/data_dictionary.md)
- [Guides](./guides/README.md)
- [Cardano => Kafka](./guides/cardano_2_kafka.md)
- [Cardano => Kafka](./guides/cardano_2_kafka.md)
2 changes: 1 addition & 1 deletion book/src/filters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ These are the existing filters that are included as part the main _Oura_ codebas
- [Fingerprint](fingerprint.md): a filter that adds a (probably) unique identifier (fingerprint) to each event.
- [Selection](selection.md): a filter that evaluates different built-in predicates to decide which events should go through the pipeline.

New filters are being developed, information will be added in this documentation to reflect the updated list. Contributions and feature request are welcome in our [Github Repo](https://github.com/txpipe/oura).
New filters are being developed, information will be added in this documentation to reflect the updated list. Contributions and feature request are welcome in our [Github Repo](https://github.com/txpipe/oura).
4 changes: 2 additions & 2 deletions book/src/filters/selection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Selection Filter

A filter that evaluates a set of configurable predicates against each event in the pipeline to decide which records should be sent to the following stage.
A filter that evaluates a set of configurable predicates against each event in the pipeline to decide which records should be sent to the following stage.

Not every use-case requires each and every event to be processed. For example, a pipeline interested in creating a 'metadata' search engine might not care about transactions outputs. With a similar logic, a pipeline aggregating transaction amounts might not care about metadata. The _selection filter_ provides a way to optimize the pipeline so that only relevant events are processed.

Expand Down Expand Up @@ -65,4 +65,4 @@ predicate = "not"
[filters.check.argument]
predicate = "variant_in"
argument = ["Transaction"]
```
```
2 changes: 1 addition & 1 deletion book/src/guides/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Guides
# Guides
2 changes: 1 addition & 1 deletion book/src/guides/cardano_2_kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This guide shows how to leverage _Oura_ to stream data from a Cardano node into

## About Kafka

> Apache Kafka is a framework implementation of a software bus using stream-processing. It is an open-source software platform developed by the Apache Software Foundation written in Scala and Java.
> Apache Kafka is a framework implementation of a software bus using stream-processing. It is an open-source software platform developed by the Apache Software Foundation written in Scala and Java.
Find [more info](https://en.wikipedia.org/wiki/Apache_Kafka) about _Kafka_ in wikipedia or visit _Kafka's_ official [website](https://kafka.apache.org/)

Expand Down
2 changes: 1 addition & 1 deletion book/src/installation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Depending on your needs, _Oura_ provides different installation options:
- [Binary Release](binary_release.md): to use one of our pre-compiled binary releases for the supported platforms.
- [From Source](from_source.md): to compile a binary from source code using Rust's toolchain
- [Docker](docker.md): to run the tool from a pre-built docker image
- [Kubernetes](kubernetes.md): to deploy _Oura_ as a resource within a Kuberentes cluster
- [Kubernetes](kubernetes.md): to deploy _Oura_ as a resource within a Kuberentes cluster
8 changes: 4 additions & 4 deletions book/src/installation/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ kind: StatefulSet
metadata:
name: cardano-node
spec:

# REDACTED: here goes your normal cardano node sts / deployment spec

template:
spec:

# REDACTED: here goes your normal cardano node pod specs

containers:
- name: main

# REDACTED: here goes your normal cardano node container properties

# add a new volume mount to enable the socket to be
Expand Down Expand Up @@ -120,4 +120,4 @@ spec:
- name: config
configMap:
name: oura
```
```
2 changes: 1 addition & 1 deletion book/src/reference/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Reference
# Reference
2 changes: 1 addition & 1 deletion book/src/sinks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ These are the existing sinks that are included as part the main _Oura_ codebase:
- [Elasticsearch](elastic.md): a sink that writes events into an Elasticsearch index or data stream.
- [Webhook](webhook.md): a sink that outputs each event as an HTTP call to a remote endpoint.

New sinks are being developed, information will be added in this documentation to reflect the updated list. Contributions and feature request are welcome in our [Github Repo](https://github.com/txpipe/oura).
New sinks are being developed, information will be added in this documentation to reflect the updated list. Contributions and feature request are welcome in our [Github Repo](https://github.com/txpipe/oura).
4 changes: 2 additions & 2 deletions book/src/sinks/elastic.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ This section configures the auth mechanism against Elasticsearch. You can remove
We currently only implement _basic_ auth, other mechanisms will be implemented at some point.

- `type`: the mechanism to use for authentication, only `Basic` is currenty implemented
- `username`: username of the user with access to Elasticsearch
- `password`: password of the user with access to Elasticsearch
- `username`: username of the user with access to Elasticsearch
- `password`: password of the user with access to Elasticsearch
2 changes: 1 addition & 1 deletion book/src/sinks/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ extra_header_2 = "123"
- `timeout` (optional): the timeout value for the HTTP response in milliseconds. Default value is `30000`.
- `error_policy` (optional): either `Continue` or `Retry`. Default value is `Retry`.
- `max_retries` (optional): the max number of retries before failing the whole pipeline. Default value is `30`
- `backoff_delay` (optional): the delay expressed in milliseconds between each retry. Default value is `5000`.
- `backoff_delay` (optional): the delay expressed in milliseconds between each retry. Default value is `5000`.
2 changes: 1 addition & 1 deletion book/src/sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ These are the currently available sources included as part the main _Oura_ codeb
- [N2N](n2n.md): an Ourboros agent that connects to a Cardano node using node-2-node protocols
- [N2C](n2c.md): an Ourboros agent that connects to a Cardano node using node-2-client protocols

New source are being developed, information will be added in this documentation to reflect the updated list. Contributions and feature request are welcome in our [Github Repo](https://github.com/txpipe/oura).
New source are being developed, information will be added in this documentation to reflect the updated list. Contributions and feature request are welcome in our [Github Repo](https://github.com/txpipe/oura).
3 changes: 1 addition & 2 deletions book/src/usage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ _Oura_ provides three different execution modes:

- [Dameon](daemon.md): a fully-configurable pipeline that runs in the background. Sources, filters and sinks can be combined to fulfil particular use-cases.
- [Watch](watch.md): to watch live block events from a node directly in the terminal. It is meant for humans, it uses colors and throttling to facilitate reading.
- [Dump](dump.md): to dump live block events from a node into rotation log files or stdout. It uses JSONL format for persistence of the events.

- [Dump](dump.md): to dump live block events from a node into rotation log files or stdout. It uses JSONL format for persistence of the events.
2 changes: 1 addition & 1 deletion book/src/usage/daemon.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _Oura's_ `daemon` mode processes data in the background, without any live output

## Start Daemon Mode

To start _Oura_ in _daemon mode_, use the following command:
To start _Oura_ in _daemon mode_, use the following command:

```
oura dameon
Expand Down
2 changes: 1 addition & 1 deletion book/src/usage/watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ oura watch /opt/cardano/cnode/sockets/node0.socket --bearer unix --magic testnet
oura watch relays-new.cardano-mainnet.iohk.io:3001 \
--bearer tcp \
--since 49159253,d034a2d0e4c3076f57368ed59319010c265718f0923057f8ff914a3b6bfd1314
```
```
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
edition = "2021"
wrap_comments = true
wrap_comments = true
2 changes: 1 addition & 1 deletion testdrive/cardano2elastic/k8s/elastic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ spec:
version: 7.16.1
count: 1
elasticsearchRef:
name: sink
name: sink
2 changes: 1 addition & 1 deletion testdrive/cardano2elastic/k8s/oura.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
valueFrom:
secretKeyRef:
key: elastic
name: sink-es-elastic-user
name: sink-es-elastic-user
resources:
requests:
memory: 100Mi
Expand Down
2 changes: 1 addition & 1 deletion testdrive/cardano2elastic/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kind: Config
metadata:
name: oura
requires:
- configs: [elastic]
- configs: [elastic]
deploy:
kubectl:
manifests:
Expand Down
2 changes: 1 addition & 1 deletion testdrive/cardano2webhook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Check the logs:

```
skaffold run --module oura --namespace cardano2webhook
```
```
2 changes: 1 addition & 1 deletion testdrive/cardano2webhook/k8s/endpoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ spec:
ports:
- protocol: TCP
port: 5000
targetPort: 5000
targetPort: 5000
2 changes: 1 addition & 1 deletion testdrive/cardano2webhook/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kind: Config
metadata:
name: oura
requires:
- configs: [elastic]
- configs: [elastic]
deploy:
kubectl:
manifests:
Expand Down

0 comments on commit 396e9e4

Please sign in to comment.