Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/ci-test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'Test: CI build'

on:
pull_request:
push:
branches:
- main

permissions:
id-token: write
contents: read

jobs:
linux-test-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Run tests
run: |
cd ./streamx-cli && ./mvnw clean test
windows-test-build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Run tests
run: |
cd ./streamx-cli && ./mvnw clean test
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties
.flattened-pom.xml

# Eclipse
.project
.classpath
.settings/

# IntelliJ
.idea
*.ipr
*.iml
*.iws

# NetBeans
nb-configuration.xml

# Visual Studio Code
.vscode
.factorypath

# OSX
.DS_Store

# Vim
*.swp
*.swo

# patch
*.orig
*.rej

# Plugin directory
/.quarkus/cli/plugins/

streamx.log
streamx.*
streamx-*.log
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Contributing

- All commands should extend `AbstractCommand` from [this package](./streamx-cli/src/main/java/com/streamx/cli/framework).
- There are helper classes which extend the `AbstractCommand` class:
- Use `AbstractCommandGroup` for commands which only contain subcommands and don't do anything else, e.g. `streamx settings`.
- Use `AbstractSilentCommand` for commands which don't print any user-faced output, e.g. `streamx settings set`.
- Commands should throw only the [`CliException`](./streamx-cli/src/main/java/com/streamx/cli/framework/CliException.java).
- All user facing messages should be provided by [`MessageProvider`](./streamx-cli/src/main/java/com/streamx/cli/i18n/MessageProvider.java).

## Development

- Enter Quarkus development console.

`cd streamx-cli && ./mvnw quarkus:dev`

- Use `e` button to edit CLI arguments.

## Running tests

`cd streamx-cli && ./mvnw test`
68 changes: 9 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,15 @@
# **StreamX Dev Repository Template**
# **StreamX CLI v2.x**

This repository serves as a **template** for creating new repositories within the **streamx-dev** organization. It includes pre-configured settings, templates, and best practices to ensure consistency and compliance across all projects.
This project provides utilities for managing the mesh:
* It allows to run a defined mesh from commands,
* It allows to ingest data into mesh.

## **Included Configurations**
For more information, see the [StreamX CLI Reference](https://www.streamx.dev/guides/main/streamx-command-line-interface-reference.html).

1. **EULA License:**
- A sample **End-User License Agreement (EULA)** is included for repositories that require it.
- Located in the `LICENSE.md` file.

2. **Issue Templates:**
- Standardized templates for reporting bugs, requesting features, and general contacts links.
- Located in the `.github/ISSUE_TEMPLATE/` directory.
⚠️ Please read the [contributing guidelines](./CONTRIBUTING.md) if you're a developer and wish to contribute to the project.

3. **Pull Request (PR) Templates:**
- A default PR template is provided to maintain quality and structure in submissions.
- Located in the `.github/PULL_REQUEST_TEMPLATE.md` file.
## Configuration

4. **Codeowners:**
- Defines the responsible individuals or teams for reviewing changes.
- Located in the `.github/CODEOWNERS` file.

5. **Dependabot:**
- It is a tool that automates dependency updates, ensuring your project stays up-to-date with the latest security patches and version improvements.
- Located in the `.github/dependabot.yml` file.
- The provided Dependabot setup performs a monthly scan of the subfolders in your repository for Maven projects, checking dependencies for outdated versions. If any outdated dependencies are detected, Dependabot automatically creates a new Pull Request (PR) with the updates.
- It is often necessary to establish a CI/CD pipeline to validate and test updates whenever a new PR is opened. These pipelines require specific credentials to operate effectively. However, it is important to note that pipelines triggered by Dependabot use a different set of variables and secrets than those triggered by GitHub users manually opening a PR.
Please contact the Principal Engineer responisble for Infrastructure to provide the appropriate secrets for Dependabot-triggered pipelines.
- You can learn more about managing secrets for Dependabot-triggered pipelines in the [GitHub documentation on Accessing Secrets in Dependabot](https://docs.github.com/en/code-security/dependabot/troubleshooting-dependabot/troubleshooting-dependabot-on-github-actions#accessing-secrets).
There are several ways of configuring and several properties to configure.

## **Repository Settings Standards**

1. **Main Branch Protection Rules**
- The main branch is protected to maintain code quality and stability.
- Merging to `main` requires: a review with approval from at least one **code owner**.

3. **Default reposiotry settings**:
- Wikis - disabled
- Issues - enabled
- for PRs only squash merging are allowed
- Automatically delete head branches - allowed

## **How to Use This Template**
1. **Clone or Use as Template:**
- Create by cloning the repository.
- Create a new repository based on this template. See example below:
<img width="758" alt="image" src="https://github.com/user-attachments/assets/91bc7776-e7ef-421e-9405-abf68f1e5013" />

2. **Update Configurations:**
- **Adjust the License:** If needed, replace the default license with one that matches your project’s requirements. When there are any dobts, check the [decision log](https://teamds.atlassian.net/wiki/x/AYA1KQ) related to Licensing Policy.
- **Modify codeowners:** Ensure the responsible teams or individuals are correctly listed in `.github/CODEOWNERS`. It's importnant to avoid merge bottlenecks.
- **Adjust Dependabot configuration:** Adjust dependabot config to fit the project needs. Provide CI/CD pipelines to validate and test updates, as well.
- **Provide a JIRA release GitHub action:** [here](https://github.com/streamx-dev/streamx-common-github-actions) you can find more details on how and why to create it.
- **Update README.md:** Add specific details about your project to replace this template content.

3. **Start Developing:**
- Get familiar with [Contribution Policy](https://github.com/streamx-dev/streamx/blob/main/CONTRIBUTING.md).
- Push your code, create issues, and submit PRs following the provided templates.

## **Best Practices**
- Regularly review the codeowners file to ensure it reflects the correct reviewers.
- Keep your license file up to date with the project’s purpose and legal requirements.
- Ensure all team members are familiar with the repository’s templates and protection rules.

By using this template, you’re setting up your repository for success with clear structure, strong protections, and organizational consistency.
For details refer to [StreamX CLI Reference](https://www.streamx.dev/guides/streamx-command-line-interface-reference.html).
1 change: 1 addition & 0 deletions streamx-cli/.mvn/wrapper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
maven-wrapper.jar
98 changes: 98 additions & 0 deletions streamx-cli/.mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* 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.
*/

import java.io.IOException;
import java.io.InputStream;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

public final class MavenWrapperDownloader
{
private static final String WRAPPER_VERSION = "3.2.0";

private static final boolean VERBOSE = Boolean.parseBoolean( System.getenv( "MVNW_VERBOSE" ) );

public static void main( String[] args )
{
log( "Apache Maven Wrapper Downloader " + WRAPPER_VERSION );

if ( args.length != 2 )
{
System.err.println( " - ERROR wrapperUrl or wrapperJarPath parameter missing" );
System.exit( 1 );
}

try
{
log( " - Downloader started" );
final URL wrapperUrl = new URL( args[0] );
final String jarPath = args[1].replace( "..", "" ); // Sanitize path
final Path wrapperJarPath = Paths.get( jarPath ).toAbsolutePath().normalize();
downloadFileFromURL( wrapperUrl, wrapperJarPath );
log( "Done" );
}
catch ( IOException e )
{
System.err.println( "- Error downloading: " + e.getMessage() );
if ( VERBOSE )
{
e.printStackTrace();
}
System.exit( 1 );
}
}

private static void downloadFileFromURL( URL wrapperUrl, Path wrapperJarPath )
throws IOException
{
log( " - Downloading to: " + wrapperJarPath );
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
{
final String username = System.getenv( "MVNW_USERNAME" );
final char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
Authenticator.setDefault( new Authenticator()
{
@Override
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication( username, password );
}
} );
}
try ( InputStream inStream = wrapperUrl.openStream() )
{
Files.copy( inStream, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING );
}
log( " - Downloader complete" );
}

private static void log( String msg )
{
if ( VERBOSE )
{
System.out.println( msg );
}
}

}
18 changes: 18 additions & 0 deletions streamx-cli/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
9 changes: 9 additions & 0 deletions streamx-cli/codestyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN"
"https://checkstyle.org/dtds/suppressions_1_0.dtd">
<!-- Default setup of check style suppressions. This file can be overridden on module level. -->
<suppressions>
<suppress checks="javadoc" files="."/>
<suppress checks="AbbreviationAsWordInName" files=".+IT\.java$"/>
</suppressions>
Loading
Loading