Skip to content

Commit

Permalink
initialize repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillem committed Feb 13, 2025
1 parent 8d5b4b5 commit 23495c8
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 140 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Define code owners (individuals or teams that are responsible for code in this repository)
# More about code owners at https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
* @ConduitIO/conduit-core
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Fixes # (issue)

### Quick checks:

- [ ] There is no other [pull request](https://github.com/conduitio/conduit-processor-processorname/pulls) for the same update/change.
- [ ] There is no other [pull request](https://github.com/conduitio-labs/conduit-processor-textgen/pulls) for the same update/change.
- [ ] I have written unit tests.
- [ ] I have made sure that the PR is of reasonable size and can be easily reviewed.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.vscode

# Binary, built with `make build`
/conduit-processor-processorname.wasm
/conduit-processor-textgen.wasm

### OS ###
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ builds:
env:
- CGO_ENABLED=0
ldflags:
- "-s -w -X 'github.com/conduitio/conduit-processor-processorname.version={{ .Tag }}'"
- "-s -w -X 'github.com/conduitio-labs/conduit-processor-textgen.version={{ .Tag }}'"
checksum:
name_template: checksums.txt
archives:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VERSION=$(shell git describe --tags --dirty --always)

.PHONY: build
build:
GOARCH=wasm GOOS=wasip1 go build -o conduit-processor-processorname.wasm cmd/processor/main.go
GOARCH=wasm GOOS=wasip1 go build -o conduit-processor-textgen.wasm cmd/processor/main.go

.PHONY: test
test:
Expand Down
75 changes: 18 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,32 @@
# Conduit Processor Template
# Conduit Processor for <resource>

This is a template project for building [Conduit](https://conduit.io) processors in Go. It makes it possible to
start working on a Conduit processor in a matter of seconds.
[Conduit](https://conduit.io) processor for <resource>.

> [!TIP]
> Are you looking to write a simple processor for your specific use case? In that case you could take the simpler
> approach - check out the
> [documentation](https://conduit.io/docs/developing/processors/building#using-sdknewprocesorfunc) how you
> can write a processor in a single function!
## How to build?

## Quick start
Run `make build` to build the processor.

1. Click [_Use this template_](https://github.com/new?template_name=conduit-processor-template&template_owner=ConduitIO) and clone your new repository.
2. Initialize the repository using [`setup.sh`](https://github.com/ConduitIO/conduit-processor-template/blob/main/setup.sh) and commit your changes.
```sh
./setup.sh github.com/myusername/conduit-processor-myprocessor
git add -A
git commit -m "initialize repository"
```
3. Set up [automatic Dependabot PR merges](#automatically-merging-dependabot-prs).
## Testing

With that, you're all set up and ready to start working on your processor! As a next step, we recommend that you
check out the [Conduit Processor SDK](https://github.com/ConduitIO/conduit-processor-sdk).
Run `make test` to run all the unit tests.

## What's included?
## Functionality

* Skeleton code for the processor and its configuration.
* Example unit tests.
* A [Makefile](/Makefile) with commonly used targets.
* A [GitHub workflow](/.github/workflows/test.yml) to build the code and run the tests.
* A [GitHub workflow](/.github/workflows/lint.yml) to run a pre-configured set of linters.
* A [GitHub workflow](/.github/workflows/release.yml) which automatically creates a release when a tag is pushed.
* A [Dependabot setup](/.github/dependabot.yml) which checks your dependencies for available updates and
[merges minor version upgrades](/.github/workflows/dependabot-auto-merge-go.yml) automatically.
* [Issue](/.github/ISSUE_TEMPLATE) and [PR templates](/.github/pull_request_template.md).
* A [README template](/README_TEMPLATE.md).
A description of what the processor achieves.

## Automatically merging Dependabot PRs
### Processor Configuration

> [!NOTE]
> This applies only to public processor repositories, as branch protection rules are not enforced in private repositories.
| name | description | required | default value |
|--------------------------|------------------------------------------|----------|---------------|
| `processor_config_param` | Description of `processor_config_param`. | true | "" |

The template makes it simple to keep your processor up-to-date using automatic merging of
[Dependabot](https://github.com/dependabot) PRs. To make use of this setup, you need to adjust
some repository settings.

1. Navigate to Settings -> General and allow auto-merge of PRs.
## Known Issues & Limitations

![Allow auto-merge](https://github.com/user-attachments/assets/c1b6605a-866d-4bb6-b374-32328d83cd2d)
- Known issue A
- Limitation A

2. Navigate to Settings -> Branches and add a branch protection rule.
## Planned work

![Add branch protection rule](https://github.com/user-attachments/assets/dda83e9c-195b-40a0-87bb-7ae7dc8683ca)

3. Create a rule for branch `main` that requires status checks `build` and `golangci-lint`.

![Status checks](https://github.com/user-attachments/assets/bfc69fe8-8c3d-4f2a-a2c5-ae4395d7019f)

## Recommended repository settings

- Allow squash merging only.
- Always suggest updating pull request branches.
- Automatically delete head branches.
- Branch protection rules on branch `main` (only in public repositories):
- Require a pull request before merging.
- Require approvals.
- Require status checks `build` and `golangci-lint`.
- Require branches to be up to date before merging.
- Require conversation resolution before merging.
- Do not allow bypassing the above settings.
- [ ] Item A
- [ ] Item B
32 changes: 0 additions & 32 deletions README_TEMPLATE.md

This file was deleted.

4 changes: 2 additions & 2 deletions cmd/processor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ package main

import (
sdk "github.com/conduitio/conduit-processor-sdk"
processorname "github.com/conduitio/conduit-processor-template"
textgen "github.com/conduitio/conduit-processor-template"
)

func main() {
sdk.Run(processorname.NewProcessor())
sdk.Run(textgen.NewProcessor())
}
2 changes: 1 addition & 1 deletion paramgen_proc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions processor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package processorname
package textgen

import (
"context"
Expand Down Expand Up @@ -55,7 +55,7 @@ func (p *Processor) Specification() (sdk.Specification, error) {
// parameters it expects.

return sdk.Specification{
Name: "processorname",
Name: "textgen",
Summary: "<describe your processor>",
Description: "<describe your processor in detail>",
Version: "devel",
Expand Down
2 changes: 1 addition & 1 deletion processor_test.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package processorname
package textgen
40 changes: 0 additions & 40 deletions setup.sh

This file was deleted.

0 comments on commit 23495c8

Please sign in to comment.