Skip to content

Commit

Permalink
Merge branch 'main' into addTotalTimeout_backend
Browse files Browse the repository at this point in the history
  • Loading branch information
shaileshpadave authored Nov 27, 2024
2 parents c4ff8b2 + c67b2eb commit 174ac79
Show file tree
Hide file tree
Showing 39 changed files with 453 additions and 140 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: CI
on:
push:
paths-ignore:
- 'conductor-clients/**'
- "conductor-clients/**"
pull_request:
paths-ignore:
- 'conductor-clients/**'
- "conductor-clients/**"

jobs:
build:
Expand All @@ -21,8 +21,8 @@ jobs:
- name: Set up Zulu JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
distribution: "zulu"
java-version: "17"
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -53,20 +53,20 @@ jobs:
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
report_paths: "**/build/test-results/test/TEST-*.xml"
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: '**/build/reports'
path: "**/build/reports"
- name: Store Buildscan URL
uses: actions/upload-artifact@v3
with:
name: build-scan
path: 'buildscan.log'
path: "buildscan.log"
build-ui:
runs-on: ubuntu-latest
container: cypress/browsers:node14.17.6-chrome100-ff98
container: cypress/browsers:node-22.11.0-chrome-130.0.6723.116-1-ff-132.0.1-edge-130.0.2849.68-1
defaults:
run:
working-directory: ui
Expand All @@ -81,15 +81,15 @@ jobs:

- name: Run E2E Tests
uses: cypress-io/github-action@v4
with:
with:
working-directory: ui
install: false
start: yarn run serve-build
wait-on: 'http://localhost:5000'
wait-on: "http://localhost:5000"

- name: Run Component Tests
uses: cypress-io/github-action@v4
with:
with:
working-directory: ui
install: false
component: true
Expand All @@ -100,11 +100,10 @@ jobs:
with:
name: cypress-screenshots
path: ui/cypress/screenshots

- name: Archive test videos
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: ui/cypress/videos

2 changes: 1 addition & 1 deletion .github/workflows/generate_gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.DOCSITE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yml
REQUIREMENTS: requirements.txt
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ I have a question!
We have a dedicated [discussion forum](https://github.com/conductor-oss/conductor/discussions) for asking "how to" questions and to discuss ideas. The discussion forum is a great place to start if you're considering creating a feature request or work on a Pull Request.
*Please do not create issues to ask questions.*

Conductor users hangout in the [Slack channel](https://join.slack.com/t/orkes-conductor/shared_invite/zt-xyxqyseb-YZ3hwwAgHJH97bsrYRnSZg). Join the channel for more real-time communication!
Conductor users hangout in the [Slack channel](https://join.slack.com/t/orkes-conductor/shared_invite/zt-2vdbx239s-Eacdyqya9giNLHfrCavfaA). Join the channel for more real-time communication!

I want to contribute!
------
Expand Down
56 changes: 37 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,34 @@

[![Github release](https://img.shields.io/github/v/release/conductor-oss/conductor.svg)](https://GitHub.com/Netflix/conductor-oss/releases)
[![License](https://img.shields.io/github/license/conductor-oss/conductor.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Conductor Slack](https://img.shields.io/badge/Slack-Join%20the%20Community-blueviolet?logo=slack)](https://join.slack.com/t/orkes-conductor/shared_invite/zt-2hmxn0i3n-_W~a9rWMbvMoYmlJo3Y15g)
[![Conductor Slack](https://img.shields.io/badge/Slack-Join%20the%20Community-blueviolet?logo=slack)](https://join.slack.com/t/orkes-conductor/shared_invite/zt-2vdbx239s-Eacdyqya9giNLHfrCavfaA)
[![Community Forum](https://img.shields.io/badge/Discourse-Join%20the%20Community-blue?logo=discourse&logoColor=white)](https://community.orkes.io)
[![Conductor OSS](https://img.shields.io/badge/Conductor%20OSS-Visit%20Site-blue)](https://conductor-oss.org)
[![GitHub stars](https://img.shields.io/github/stars/conductor-oss/conductor?style=social)](https://github.com/conductor-oss/conductor/stargazers)



Conductor is a platform _originally_ created at **Netflix** to orchestrate microservices and events.
[Conductor OSS](https://conductor-oss.org) is maintained by the team of developers at [Orkes.io](https://orkes.io/) along with members of the open source community.
Conductor is a platform _originally_ created at **Netflix** to orchestrate microservices and events. [Conductor OSS](https://conductor-oss.org) is maintained by the team of developers at [Orkes.io](https://orkes.io/) along with members of the open source community.


[![conductor_oss_getting_started](https://github.com/user-attachments/assets/6153aa58-8ad1-4ec5-93d1-38ba1b83e3f4)](https://youtu.be/4azDdDlx27M)

- - -
# Table of Contents
1. [What is Conductor?](#what-is-conductor)
* [Key benefits](#key-benefits)
* [Features](#features)
2. [Requirements](#requirements)
3. [Conductor Roadmap](#conductor-oss-roadmap)
4. [How to Contribute](#contributors)
5. [Additional Resources](#resources)
6. [Community & Support](#slack-community)
2. [Getting Started](#getting-started)
* [Requirements](#requirements)
* [Quick Start](#quick-start-guide)
* [Create your first workflow](#create-your-first-workflow)
3. [Documentation](#documentation)
4. [Database Specifications](#database-specifications)
5. [Deployment Options](#deployment-options)
6. [Conductor Roadmap](#conductor-oss-roadmap)
7. [How to Contribute](#contributors)
8. [Additional Resources](#resources)
9. [Community & Support](#slack-community)

# What is Conductor?
Conductor (or [Netflix Conductor](https://netflixtechblog.com/netflix-conductor-a-microservices-orchestrator-2e8d4771bf40)) is a microservices orchestration engine for distributed and asynchronous workflows. It empowers developers to create workflows that define interactions between services, databases, and other external systems.
Expand All @@ -53,6 +61,7 @@ Conductor is designed to enable flexible, resilient, and scalable workflows. It
* Install Java (JDK) 17 or newer
* Node 14 for the UI to build
* _Earlier versions may work, but are untested_


## Quick Start Guide

Expand Down Expand Up @@ -82,12 +91,15 @@ docker compose -f docker/docker-compose.yaml up
##### Or use the REST API with your preferred HTTP client
* http://localhost:8080

## Database Requirements

# Documentation
Check-out the [Conductor OSS docs](https://github.com/conductor-oss/conductor/tree/main/docs) for additional details
- - -
# Database Specifications
* The default persistence used is Redis
* The indexing backend is [Elasticsearch](https://www.elastic.co/) (7.x)

## Configuration for various database backends

### Configuration for various database backends

| Backend | Configuration |
|----------------|---------------------------------------------------------------------------------------|
Expand All @@ -97,7 +109,6 @@ docker compose -f docker/docker-compose.yaml up
| MySQL + ES7 | [config-mysql.properties](docker/server/config/config-mysql.properties) |


- - -
# Deployment Options
In addition to the Docker Compose setup, Netflix Conductor supports several other deployment methods to suit various environments:

Expand All @@ -114,19 +125,26 @@ Conductor provides several SDKs for interacting with the API and creating custom

Each SDK is maintained as part of the Conductor project, providing examples and comprehensive API documentation.

# Documentation and Community
* **Official Documentation:** [Conductor documentation](https://docs.conductor-oss.org/index.html) contains detailed explanations of workflow concepts, API reference, and guides.
* **Conductor Slack:** [Join the Conductor Slack](https://join.slack.com/t/orkes-conductor/shared_invite/zt-2hmxn0i3n-_W~a9rWMbvMoYmlJo3Y15g) channel for community discussions and support.
* **Orkes Community Discourse:** [Hosted by Orkes.io](https://community.orkes.io) on Discourse, you can engage the Conductor & Orkes community, ask questions, and contribute ideas.


# Conductor OSS Roadmap
[See the roadmap for the Conductor](ROADMAP.md)

If you would like to participate in the roadmap and development, [please reach out](https://forms.gle/P2i1xHrxPQLrjzTB7).

# Documentation and Community
* **Official Documentation:** [Conductor documentation](https://docs.conductor-oss.org/index.html) contains detailed explanations of workflow concepts, API reference, and guides.
* **Conductor Slack:** [Join the Conductor Slack](https://join.slack.com/t/orkes-conductor/shared_invite/zt-2vdbx239s-Eacdyqya9giNLHfrCavfaA) channel for community discussions and support.
* **Orkes Community Discourse:** [Hosted by Orkes.io](https://community.orkes.io) on Discourse, you can engage the Conductor & Orkes community, ask questions, and contribute ideas.
- - -
# License
Conductor is licensed under the Apache 2.0 License © [Conductor Open-source](https://conductor-oss.org/)
- - -
# Contributing

We welcome contributions from everyone!

- **Report Issues:** Found a bug or have a feature request? Open an [issue on GitHub](https://github.com/conductor-oss/conductor/issues).
- **Contribute Code:** Check out our [Contribution Guide](https://github.com/conductor-oss/conductor/blob/main/CONTRIBUTING.md) for initial guidelines, and explore our [good first issues](https://github.com/conductor-oss/conductor/labels/good%20first%20issue) for beginner-friendly tasks to tackle first.
- **Build a Conductor SDK:** Need an SDK not included with Conductor? Build your own using the [Swagger API](http://localhost:8080) included with your local deployment.
- **Contribute to our Docs:** Contribute edits or updates to keep our [documentation](https://github.com/conductor-oss/conductor/tree/main/docs) in great shape for the community.

## Contributors

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright 2020 Conductor Authors.
* <p>
* Licensed 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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 com.netflix.conductor.common.constraints;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.beans.factory.annotation.Value;

import jakarta.validation.Constraint;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import jakarta.validation.Payload;

import static java.lang.annotation.ElementType.FIELD;

/**
* This constraint class validates following things.
*
* <ul>
* <li>1. Name is valid or not
* </ul>
*/
@Documented
@Constraint(validatedBy = ValidNameConstraint.NameValidator.class)
@Target({FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidNameConstraint {

String message() default "";

Class<?>[] groups() default {};

Class<? extends Payload>[] payload() default {};

class NameValidator implements ConstraintValidator<ValidNameConstraint, String> {

private static final String NAME_PATTERN = "^[A-Za-z0-9_<>{}#\\s-]+$";
public static final String INVALID_NAME_MESSAGE =
"Allowed characters are alphanumeric, underscores, spaces, hyphens, and special characters like <, >, {, }, #";

@Value("${conductor.app.workflow.name-validation.enabled}")
private boolean nameValidationEnabled;

@Override
public void initialize(ValidNameConstraint constraintAnnotation) {}

@Override
public boolean isValid(String name, ConstraintValidatorContext context) {
boolean valid = name == null || !nameValidationEnabled || name.matches(NAME_PATTERN);
if (!valid) {
context.disableDefaultConstraintViolation();
context.buildConstraintViolationWithTemplate(
"Invalid name '" + name + "'. " + INVALID_NAME_MESSAGE)
.addConstraintViolation();
}
return valid;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public long getTotalTimeoutSeconds() {
return totalTimeoutSeconds;
}

public void setTotalTimeoutSeconds(@NotNull long totalTimeoutSeconds) {
public void setTotalTimeoutSeconds(long totalTimeoutSeconds) {
this.totalTimeoutSeconds = totalTimeoutSeconds;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@

public enum IdempotencyStrategy {
FAIL,
RETURN_EXISTING
RETURN_EXISTING,
FAIL_ON_RUNNING
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import com.netflix.conductor.annotations.protogen.ProtoEnum;
import com.netflix.conductor.annotations.protogen.ProtoField;
import com.netflix.conductor.annotations.protogen.ProtoMessage;
import com.netflix.conductor.common.constraints.NoSemiColonConstraint;
import com.netflix.conductor.common.constraints.OwnerEmailMandatoryConstraint;
import com.netflix.conductor.common.constraints.TaskReferenceNameUniqueConstraint;
import com.netflix.conductor.common.constraints.ValidNameConstraint;
import com.netflix.conductor.common.metadata.Auditable;
import com.netflix.conductor.common.metadata.SchemaDef;
import com.netflix.conductor.common.metadata.tasks.TaskType;
Expand All @@ -39,8 +39,7 @@ public enum TimeoutPolicy {

@NotEmpty(message = "WorkflowDef name cannot be null or empty")
@ProtoField(id = 1)
@NoSemiColonConstraint(
message = "Workflow name cannot contain the following set of characters: ':'")
@ValidNameConstraint
private String name;

@ProtoField(id = 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,32 @@
/**
* Response object to return a list of succeeded entities and a map of failed ones, including error
* message, for the bulk request.
*
* @param <T> the type of entities included in the successful results
*/
public class BulkResponse {
public class BulkResponse<T> {

/** Key - entityId Value - error message processing this entity */
private final Map<String, String> bulkErrorResults;

private final List<String> bulkSuccessfulResults;
private final List<T> bulkSuccessfulResults;
private final String message = "Bulk Request has been processed.";

public BulkResponse() {
this.bulkSuccessfulResults = new ArrayList<>();
this.bulkErrorResults = new HashMap<>();
}

public List<String> getBulkSuccessfulResults() {
public List<T> getBulkSuccessfulResults() {
return bulkSuccessfulResults;
}

public Map<String, String> getBulkErrorResults() {
return bulkErrorResults;
}

public void appendSuccessResponse(String id) {
bulkSuccessfulResults.add(id);
public void appendSuccessResponse(T result) {
bulkSuccessfulResults.add(result);
}

public void appendFailedResponse(String id, String errorMessage) {
Expand All @@ -56,10 +58,9 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof BulkResponse)) {
if (!(o instanceof BulkResponse that)) {
return false;
}
BulkResponse that = (BulkResponse) o;
return Objects.equals(bulkSuccessfulResults, that.bulkSuccessfulResults)
&& Objects.equals(bulkErrorResults, that.bulkErrorResults);
}
Expand Down
Loading

0 comments on commit 174ac79

Please sign in to comment.