Skip to content

setup #2

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions ./CODEOWNERS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
* @tsurdilo @antmendoza
16 changes: 16 additions & 0 deletions ./ISSUE_TEMPLATE/bug-report.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
---
name: Bug Report
about: Report a bug encountered with the Serverless Workflow Python SDK
labels: kind/bug

---

**What happened**:

**What you expected to happen**:

**How to reproduce it**:

**Anything else we need to know?**:

**Environment**:
10 changes: 10 additions & 0 deletions ./ISSUE_TEMPLATE/enhancement.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
name: Enhancement Request
about: Suggest an enhancement to the Serverless Workflow Python SDK
labels: kind/feature

---

**What would you like to be added**:

**Why is this needed**:
8 changes: 8 additions & 0 deletions ./ISSUE_TEMPLATE/question.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
---
name: Question
about: Ask a question about the Serverless Workflow Python SDK
labels: kind/question

---

**What is the question**:
8 changes: 8 additions & 0 deletions ./OWNERS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
reviewers:
- tsurdilo
- antmendoza
approvers:
- tsurdilo
- antmendoza
labels:
- sig/contributor-experience
7 changes: 7 additions & 0 deletions ./PULL_REQUEST_TEMPLATE.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
**Many thanks for submitting your Pull Request :heart:!**

**What this PR does / why we need it**:

**Special notes for reviewers**:

**Additional information (if needed):**
5 changes: 5 additions & 0 deletions .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -127,3 +127,8 @@ dmypy.json

# Pyre type checker
.pyre/

# Editors
.idea
.vscode
*.iml
3 changes: 3 additions & 0 deletions MAINTAINERS.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
# Serverless Workflow Python SDK Maintainers

* [Antonio Mendoza Pérez](https://.com/antmendoza)
66 changes: 32 additions & 34 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
# Serverless Workflow Specification - Typescript SDK
# Serverless Workflow Specification - Python SDK

Provides the Python API/SPI for the [Serverless Workflow Specification](https://.com/serverlessworkflow/specification)

Expand All@@ -18,24 +18,23 @@ With the SDK you can:
## **WIP** Programmatically build workflow definitions

```
workflow = Workflow(id_="greeting",
name="Greeting Workflow",
description="Greet Someone",
version='1.0',
specVersion='0.8',
start="Greet",
states=[],
functions=[]
)

workflow = Workflow(id_="greeting",
name="Greeting Workflow",
description="Greet Someone",
version='1.0',
specVersion='0.8',
start="Greet",
states=[],
functions=[]
)
```

## Parse workflow JSON and YAML definitions

### Convert from JSON or YAML source

```
swf_content = """id: greeting
swf_content = """id: greeting
name: Greeting Workflow
version: '1.0'
description: Greet Someone
Expand DownExpand Up@@ -65,18 +64,17 @@ You can see a full example in the [test_workflow.py](./tests/test_workflow.py) f
### Parse workflow to JSON / YAML

```
workflow = Workflow(id_="greeting",
name="Greeting Workflow",
description="Greet Someone",
version='1.0',
specVersion='0.8',
start="Greet",
states=[],
functions=[]
)

print(workflow.to_json())
print(workflow.to_yaml())
workflow = Workflow(id_="greeting",
name="Greeting Workflow",
description="Greet Someone",
version='1.0',
specVersion='0.8',
start="Greet",
states=[],
functions=[]
)
print(workflow.to_json())
print(workflow.to_yaml())
```

You can see a full example in the [test_workflow.py](./tests/test_workflow.py) file
Expand All@@ -85,16 +83,16 @@ You can see a full example in the [test_workflow.py](./tests/test_workflow.py) f
## Validate workflow definitions

```
workflow = Workflow(id_="greeting",
name="Greeting Workflow",
description="Greet Someone",
version='1.0',
specVersion='0.8',
start="Greet",
states=[],
functions=[]
)
WorkflowValidator(Workflow(workflow)).validate()
workflow = Workflow(id_="greeting",
name="Greeting Workflow",
description="Greet Someone",
version='1.0',
specVersion='0.8',
start="Greet",
states=[],
functions=[]
)
WorkflowValidator(Workflow(workflow)).validate()

```
The `validate` method will raise an exception if the provided workflow does not complaint specification.
Expand Down
59 changes: 59 additions & 0 deletions code-of-conduct.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
## CNCF Community Code of Conduct v1.0

Other languages available:
- [Chinese/中文](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/zh.md)
- [German/Deutsch](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/de.md)
- [Spanish/Español](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/es.md)
- [French/Français](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/fr.md)
- [Italian/Italiano](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/it.md)
- [Japanese/日本語](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/jp.md)
- [Korean/한국어](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/ko.md)
- [Ukrainian/Українська](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/uk.md)
- [Russian/Русский](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/ru.md)
- [Portuguese/Português](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/pt.md)
- [Arabic/العربية](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/ar.md)
- [Polish/Polski](https://.com/cncf/foundation/blob/master/code-of-conduct-languages/pl.md)

### Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering
an open and welcoming community, we pledge to respect all people who contribute
through reporting issues, posting feature requests, updating documentation,
submitting pull requests or es, and other activities.

We are committed to making participation in this project a harassment-free experience for
everyone, regardless of level of experience, gender, gender identity and expression,
sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing others' private information, such as physical or electronic addresses,
without explicit permission
* Other unethical or unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are not
aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers
commit themselves to fairly and consistently applying these principles to every aspect
of managing this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.

This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior in Kubernetes may be reported by contacting the [Kubernetes Code of Conduct Committee](https://git.k8s.io/community/committee-code-of-conduct) via [email protected]. For other projects, please contact a CNCF project maintainer or our mediator, Mishi Choudhary via [email protected].

This Code of Conduct is adapted from the Contributor Covenant
(http://contributor-covenant.org), version 1.2.0, available at
http://contributor-covenant.org/version/1/2/0/


### CNCF Events Code of Conduct

CNCF events are governed by the Linux Foundation [Code of Conduct](https://events.linuxfoundation.org/code-of-conduct/) available on the event page.
This is designed to be compatible with the above policy and also includes more details on responding to incidents.
29 changes: 29 additions & 0 deletions maintainer_guidelines.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
# Maintainer's Guide

## Tips

Here are a few tips for repository maintainers.

* Stay on top of your pull requests. PRs that languish for too long can become difficult to merge.
* Work from your own fork. As you are making contributions to the project, you should be working from your own fork just as outside contributors do. This keeps the branches in to a minimum and reduces unnecessary CI runs.
* Try to proactively label issues with backport labels if it's obvious that a change should be backported to previous releases.
* When landing pull requests, if there is more than one commit, try to squash into a single commit. Usually this can just be done with the UI when merging the PR. Use "Squash and merge".
* Triage issues once in a while in order to keep the repository alive. During the triage:
* If some issues are stale for too long because they are no longer valid/relevant or because the discussion reached no significant action items to perform, close them and invite the users to reopen if they need it.
* If some PRs are no longer valid but still needed, ask the user to rebase them
* If some issues and PRs are still relevant, use labels to help organize tasks
* If you find an issue that you want to create a fix for and submit a pull request, be sure to assign it to yourself so that others maintainers don't start working on it at the same time.

## Branch Management

The `main` branch is the bleeding edge. New major versions of the module
are cut from this branch and tagged. If you intend to submit a pull request
you should use `main HEAD` as your starting point.

Each major release will result in a new branch and tag. For example, the
release of version 1.0.0 of the project results in a `v1.0.0` tag on the
release commit, and a new branch `release-1.y.z` for subsequent minor and
level releases of that major version if necessary. However, development will continue
apace on `main` for the next major version - e.g. 2.0.0. Version branches
are only created for each major version. Minor and level releases
are simply tagged.