forked from apache/nifi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NIFI-13105 Implement a FlowRegistryClient that use GitHub for version…
…ing flows
- Loading branch information
Showing
16 changed files
with
1,348 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
nifi-extension-bundles/nifi-github-bundle/nifi-github-extensions/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-github-bundle</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>nifi-github-extensions</artifactId> | ||
<packaging>jar</packaging> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-utils</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kohsuke</groupId> | ||
<artifactId>github-api</artifactId> | ||
<version>${github-api.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
101 changes: 101 additions & 0 deletions
101
...fi-github-extensions/src/main/java/org/apache/nifi/github/GitHubCreateContentRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
* | ||
* * Licensed to the Apache Software Foundation (ASF) under one or more | ||
* * contributor license agreements. See the NOTICE file distributed with | ||
* * this work for additional information regarding copyright ownership. | ||
* * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* * (the "License"); you may not use this file except in compliance with | ||
* * the License. You may obtain a copy of the License at | ||
* * | ||
* * http://www.apache.org/licenses/LICENSE-2.0 | ||
* * | ||
* * Unless required by applicable law or agreed to in writing, software | ||
* * distributed under the License is distributed on an "AS IS" BASIS, | ||
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* * See the License for the specific language governing permissions and | ||
* * limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.apache.nifi.github; | ||
|
||
import java.util.Objects; | ||
|
||
public class GitHubCreateContentRequest { | ||
|
||
private final String branch; | ||
private final String path; | ||
private final String content; | ||
private final String message; | ||
private final String existingContentSha; | ||
|
||
private GitHubCreateContentRequest(final Builder builder) { | ||
this.branch = Objects.requireNonNull(builder.branch); | ||
this.path = Objects.requireNonNull(builder.path); | ||
this.content = Objects.requireNonNull(builder.content); | ||
this.message = Objects.requireNonNull(builder.message); | ||
// Will be null for create, and populated for update | ||
this.existingContentSha = builder.existingContentSha; | ||
} | ||
|
||
public String getBranch() { | ||
return branch; | ||
} | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public String getExistingContentSha() { | ||
return existingContentSha; | ||
} | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public static final class Builder { | ||
private String branch; | ||
private String path; | ||
private String content; | ||
private String message; | ||
private String existingContentSha; | ||
|
||
public Builder branch(final String branch) { | ||
this.branch = branch; | ||
return this; | ||
} | ||
|
||
public Builder path(final String path) { | ||
this.path = path; | ||
return this; | ||
} | ||
|
||
public Builder content(final String content) { | ||
this.content = content; | ||
return this; | ||
} | ||
|
||
public Builder message(final String message) { | ||
this.message = message; | ||
return this; | ||
} | ||
|
||
public Builder existingContentSha(final String existingSha) { | ||
this.existingContentSha = existingSha; | ||
return this; | ||
} | ||
|
||
public GitHubCreateContentRequest build() { | ||
return new GitHubCreateContentRequest(this); | ||
} | ||
} | ||
} |
Oops, something went wrong.