Skip to content

Commit 544076a

Browse files
Initial commit — NiFi Hub: extension bundles, flows, and Openflow-as-Code CI/CD pipelines
0 parents  commit 544076a

92 files changed

Lines changed: 15641 additions & 0 deletions

File tree

Some content is hidden

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

.cursor/rules/nifihub.mdc

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
description: "NiFi Hub coding conventions and build instructions"
3+
alwaysApply: true
4+
---
5+
6+
## Project Overview
7+
8+
NiFi Hub is a repository of independently-versioned Apache NiFi extension bundles and versioned flow definitions.
9+
All Java code uses package `com.snowflake.nifihub`.
10+
11+
## Building
12+
13+
NiFi Hub uses Maven. Never use `javac` directly. Each bundle builds independently:
14+
15+
```bash
16+
./mvnw clean verify -Pcontrib-check -f <bundle-path>/pom.xml
17+
```
18+
19+
The root POM has no `<modules>` block. Do NOT run `mvn install` from root expecting to build all bundles.
20+
21+
## Code Style
22+
23+
1. Mark all possible variables `final` (method arguments, local variables, member variables, catch variables).
24+
2. No star imports. Import each class individually.
25+
3. No underscores in class names, variables, or filenames.
26+
4. Line width: up to 200 characters.
27+
5. 4-space indentation, no tabs.
28+
6. Use SLF4J loggers, never `System.out.println`.
29+
7. Use `.formatted()` for string formatting instead of `+` concatenation.
30+
8. Include Apache 2.0 license header in all source files.
31+
9. Avoid creating trivial 1-2 line private methods called only once.
32+
10. Private/helper methods should not appear before the first public/protected method that calls them.
33+
34+
## Testing
35+
36+
- Unit tests use `nifi-mock` framework via `TestRunner` from `TestRunners.newTestRunner()`.
37+
- Test classes are named `Test<ClassName>.java`.
38+
- Code coverage must be >= 80%.
39+
- Never use `assertDoesNotThrow`. Just call the method directly.
40+
- Never add `// Given`, `// When`, `// Then` comments.
41+
- Use JUnit assertions (never the `assert` keyword).
42+
43+
## Package Naming
44+
45+
Java packages follow: `com.snowflake.nifihub.<category>.<bundlename>`
46+
47+
Example: `com.snowflake.nifihub.example` for the example bundle.
48+
49+
## Bundle Structure
50+
51+
Every bundle follows this structure:
52+
```
53+
nifi-<name>-bundle/
54+
├── pom.xml (packaging: pom, parent: nifihub-parent)
55+
├── SKILL.md (agent-readable bundle documentation)
56+
├── nifi-<name>-processors/
57+
│ ├── pom.xml (packaging: jar)
58+
│ └── src/
59+
└── nifi-<name>-nar/
60+
└── pom.xml (packaging: nar)
61+
```
62+
63+
## Ending Conditions
64+
65+
Before considering a task complete:
66+
1. `./mvnw clean verify -Pcontrib-check -f <bundle>/pom.xml` passes
67+
2. Code coverage >= 80%
68+
3. SKILL.md is present and up-to-date
69+
4. All code follows the style rules above

.editorconfig

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# EditorConfig helps maintain consistent coding styles
2+
# https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
indent_style = space
12+
indent_size = 4
13+
14+
[*.xml]
15+
indent_size = 4
16+
17+
[*.yml]
18+
indent_size = 2
19+
20+
[*.yaml]
21+
indent_size = 2
22+
23+
[*.json]
24+
indent_size = 2
25+
26+
[*.md]
27+
trim_trailing_whitespace = false
28+
29+
[*.sh]
30+
indent_size = 2
31+
32+
[Makefile]
33+
indent_style = tab

.github/CODEOWNERS

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# NiFi Hub Code Owners
2+
# See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3+
4+
# Default owners for everything
5+
* @Snowflake-Labs/nifihub-maintainers
6+
7+
# Root build configuration
8+
/pom.xml @Snowflake-Labs/nifihub-maintainers
9+
/checkstyle.xml @Snowflake-Labs/nifihub-maintainers
10+
/pmd-ruleset.xml @Snowflake-Labs/nifihub-maintainers
11+
12+
# CI/CD workflows
13+
/.github/ @Snowflake-Labs/nifihub-maintainers
14+
15+
# Extension bundles (add category-specific owners below)
16+
/extensions/ @Snowflake-Labs/nifihub-maintainers
17+
18+
# Flow definitions (add bucket-specific owners below)
19+
/flows/ @Snowflake-Labs/nifihub-maintainers

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Description
2+
3+
<!-- Describe your changes. What does this PR add, change, or fix? -->
4+
5+
## Type of Change
6+
7+
- [ ] New extension bundle
8+
- [ ] Extension bundle update
9+
- [ ] New flow definition
10+
- [ ] Flow definition update
11+
- [ ] Infrastructure / CI change
12+
- [ ] Documentation
13+
14+
## Checklist
15+
16+
### For Extension Bundles
17+
- [ ] Build passes: `./mvnw clean verify -Pcontrib-check -f <bundle-path>/pom.xml`
18+
- [ ] Unit tests added/updated
19+
- [ ] Code coverage >= 80%
20+
- [ ] `SKILL.md` added/updated at bundle root
21+
- [ ] Apache 2.0 license header on all new files
22+
- [ ] All code in package `com.snowflake.nifihub.*`
23+
24+
### For Flow Definitions
25+
- [ ] Flow JSON is valid and exported from NiFi
26+
- [ ] Companion `.md` documentation added/updated
27+
- [ ] Validation tests added at `flows/<bucket>/tests/`
28+
- [ ] Tests pass: `pytest flows/<bucket>/tests/ -v`
29+
30+
### General
31+
- [ ] No secrets or credentials in the PR
32+
- [ ] Documentation is clear and complete
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Flow checkstyle rules for Snowflake Flow Diff
2+
# See: https://github.com/Snowflake-Labs/snowflake-flow-diff
3+
4+
include:
5+
- concurrentTasks
6+
- snapshotMetadata
7+
- emptyParameter
8+
- unusedParameter
9+
- noSelfLoop
10+
- backpressureThreshold
11+
12+
rules:
13+
concurrentTasks:
14+
parameters:
15+
limit: 4
16+
backpressureThreshold:
17+
parameters: {}

.github/dependabot.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
labels:
8+
- "dependencies"
9+
- "infra"
10+
11+
- package-ecosystem: "maven"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
labels:
16+
- "dependencies"
17+
ignore:
18+
- dependency-name: "org.apache.nifi:*"
19+
update-types: ["version-update:semver-major"]
20+
21+
- package-ecosystem: "maven"
22+
directories:
23+
- "/extensions/*/*/nifi-*-bundle"
24+
schedule:
25+
interval: "weekly"
26+
labels:
27+
- "dependencies"
28+
- "extensions"
29+
ignore:
30+
- dependency-name: "org.apache.nifi:*"
31+
update-types: ["version-update:semver-major"]
32+
33+
- package-ecosystem: "pip"
34+
directory: "/flows"
35+
schedule:
36+
interval: "weekly"
37+
labels:
38+
- "dependencies"
39+
- "flows"

.github/labeler.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
extensions:
2+
- changed-files:
3+
- any-glob-to-any-file: 'extensions/**'
4+
5+
flows:
6+
- changed-files:
7+
- any-glob-to-any-file: 'flows/**'
8+
9+
infra:
10+
- changed-files:
11+
- any-glob-to-any-file:
12+
- '.github/**'
13+
- 'pom.xml'
14+
- 'checkstyle.xml'
15+
- 'pmd-ruleset.xml'
16+
- 'codecov.yml'
17+
- '.editorconfig'
18+
19+
documentation:
20+
- changed-files:
21+
- any-glob-to-any-file:
22+
- '**/*.md'
23+
- 'AGENTS.md'
24+
- 'CONTRIBUTING.md'
25+
- 'README.md'

.github/versions-rules.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
-->
15+
<!--
16+
Rules for the versions-maven-plugin dependency freshness check.
17+
Dependencies managed by the parent POM are excluded because their
18+
versions are intentionally pinned and upgraded centrally.
19+
-->
20+
<ruleset comparisonMethod="maven"
21+
xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0
24+
https://www.mojohaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
25+
<rules>
26+
<!-- Ignore NiFi dependencies: versions are pinned in the parent POM -->
27+
<rule groupId="org.apache.nifi" comparisonMethod="maven">
28+
<ignoreVersions>
29+
<ignoreVersion type="regex">.*</ignoreVersion>
30+
</ignoreVersions>
31+
</rule>
32+
<!-- Ignore snapshot and milestone versions globally -->
33+
<rule groupId="*" comparisonMethod="maven">
34+
<ignoreVersions>
35+
<ignoreVersion type="regex">.*-SNAPSHOT</ignoreVersion>
36+
<ignoreVersion type="regex">.*-M\d+</ignoreVersion>
37+
<ignoreVersion type="regex">.*-alpha.*</ignoreVersion>
38+
<ignoreVersion type="regex">.*-beta.*</ignoreVersion>
39+
<ignoreVersion type="regex">.*-RC\d+</ignoreVersion>
40+
<ignoreVersion type="regex">.*-rc\d+</ignoreVersion>
41+
</ignoreVersions>
42+
</rule>
43+
</rules>
44+
</ruleset>

0 commit comments

Comments
 (0)