Skip to content

Commit

Permalink
Merge pull request #1 from PrefectHQ/main
Browse files Browse the repository at this point in the history
Update fork
  • Loading branch information
pevidex authored Jun 4, 2024
2 parents 9abbc54 + 30101a1 commit cd12308
Show file tree
Hide file tree
Showing 2,734 changed files with 515,409 additions and 73,355 deletions.
8 changes: 8 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[codespell]
skip = .git,*.pdf,*.svg,versioneer.py,package-lock.json,_vendor,*.css,.codespellrc
# from https://github.com/PrefectHQ/prefect/pull/10813#issuecomment-1732676130
ignore-regex = .*lazy=\"selectin\"|.*e import Bloc$|America/Nome

ignore-words-list = selectin,aci,wqs,aks,ines,dependant,fsspec,automations,nmme

check-hidden = true
14 changes: 11 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@
* @PrefectHQ/open-source

# backend
/src/prefect/server @PrefectHQ/open-source @zangell44
/src/prefect/server @PrefectHQ/open-source @zangell44

# ui
/ui @pleek91
/ui @PrefectHQ/frontend

# documentation
/docs @PrefectHQ/docs
mkdocs.yml @PrefectHQ/docs
mkdocs.insiders.yml @PrefectHQ/docs

# orchestration rules / policies
/src/prefect/server/orchestration @PrefectHQ/open-source
/src/prefect/server/orchestration @PrefectHQ/open-source

# database configuration / models
/src/prefect/server/database @PrefectHQ/open-source

# the events subsystem, while it's being ported
/src/prefect/events @chrisguidry
/src/prefect/server/events @chrisguidry
/tests/events @chrisguidry

# integrations
/src/integrations @desertaxle @zzstoatzz
5 changes: 5 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contributing

Thanks for considering contributing to Prefect!

To navigate our codebase with confidence, see our [contribution guidelines](https://docs.prefect.io/latest/contributing/overview/).
12 changes: 8 additions & 4 deletions .github/ISSUE_TEMPLATE/1_general_bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 🐞 Report a bug
description: Errors and regression reports with complete reproducing test cases and/or stack traces.
labels: ["status:triage", "bug"]
labels: ["needs:triage", "bug"]
body:
- type: markdown
attributes:
Expand All @@ -10,7 +10,11 @@ body:
or [Discourse](https://discourse.prefect.io/) and ask there first. You are likely to get a response
faster and learn more about the feature you're working with. If the issue is determined to be a bug,
we will open an issue here.
GitHub issues raised against this repository will receive community support. If you have an
[active support agreement](https://www.prefect.io/pricing/), we recommend creating a case to ensure
a faster response.
- type: markdown
attributes:
value: >
Expand Down Expand Up @@ -75,8 +79,8 @@ body:
description: >
Provide information about your Prefect version and environment. The easiest way to retrieve all of the information we require is the `prefect version` command.
If using Prefect 1.x, it is useful to also include the output of `prefect diagnostics`.
Please do not just write "2.0". The command provides additional context such as your operating system, Prefect API type, Python version, etc. that we need to diagnose your problem.
placeholder: "# Copy output of the `prefect version` command here"
**Please do not just include your Prefect version number**. The command provides additional context such as your operating system, Prefect API type, Python version, etc. that we need to diagnose your problem.
placeholder: "# Copy output of the `prefect version` command here. Do not just include your Prefect version number."
render: Text
validations:
required: true
Expand Down
8 changes: 6 additions & 2 deletions .github/ISSUE_TEMPLATE/2_ui_bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 🖼️ Report a bug with the Prefect UI
description: Errors and display issues with the Prefect web interface.
labels: ["status:triage", "ui", "bug"]
labels: ["needs:triage", "ui", "bug"]
body:
- type: markdown
attributes:
Expand All @@ -21,6 +21,10 @@ body:
4. Additional details that may help us reproduce your issue.
GitHub issues raised against this repository will receive community support. If you have an
[active support agreement](https://www.prefect.io/pricing/), we recommend creating a case to ensure
a faster response.
- type: checkboxes
id: checks
attributes:
Expand Down Expand Up @@ -62,7 +66,7 @@ body:

- type: checkboxes
attributes:
label: Browers
label: Browsers
description: Which browsers was this bug reproduced on? Please check if your issue is specific to your browser by testing on another browser.
options:
- label: Chrome
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/3_feature_enhancement.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 🚀 Propose a feature enhancement
description: Propose a new feature or an enhancement to an existing feature.
labels: ["status:triage", "enhancement"]
labels: ["needs:triage", "enhancement"]
body:
- type: checkboxes
id: checks
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/4_docs_change.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 📝 Suggest a change to documentation
description: Propose edits, enhancements, or fixes to Prefect documentation
labels: ["docs", "status:triage"]
labels: ["docs", "needs:triage"]
body:
- type: checkboxes
id: checks
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/5_maintenance_ticket.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 🛠️ Track a maintenence task
name: 🛠️ Track a maintenance task
description: These are for changes that are not user or product related for maintenance of this repository.
labels: ["status:backlog", "maintenance"]
labels: ["maintenance"]
body:
- type: checkboxes
id: checks
Expand Down
7 changes: 5 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ contact_links:
url: https://www.prefect.io/slack
about: Join thousands of Prefect experts, engineers, and users in our Slack community
- name: 🦆 Book a rubber duck
url: https://calendly.com/prefect-experts/rubber-duck
about: Book time with a Prefect engineer!
url: https://calendly.com/prefect-experts/prefect-product-advocates?utm_campaign=prefect_docs_cloud&utm_content=prefect_docs&utm_medium=docs&utm_source=docs
about: Schedule a meeting with a Prefect Product Advocate!
- name: 🔒 Report a security issue
url: https://www.prefect.io/security/bug-bounty-program/
about: Responsibly disclose a potential security issue.
16 changes: 0 additions & 16 deletions .github/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
query-filters:
- exclude:
# this creates many false positives with our code
id: py/unsafe-cyclic-import
- exclude:
id: py/cyclic-import
- exclude:
id: py/unreachable-statement
- exclude:
# catching base exceptions is required
id: py/catch-base-exception
- exclude:
# too many false positives with prefect.runtime
id: py/undefined-export
- exclude:
# sometimes necessary for __init__ files
id: py/import-and-import-from
- exclude:
# we dont need CodeQL quality linting
id: py/mixed-returns

paths-ignore:
- tests/**/test_*.py
3 changes: 2 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
migration:
- src/**/migrations/**/*.py
- changed-files:
- any-glob-to-any-file: src/**/migrations/**/*.py
16 changes: 13 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Thanks for opening a pull request to Prefect! We've got a few requests to help u
- Provide a short overview of the change and the value it adds.
- Share an example to help us understand the change in user experience.
- Confirm that you've done common tasks so we can give a timely review.
- Review our contribution guidelines: https://docs.prefect.io/latest/contributing/overview/
Happy engineering!
-->
Expand All @@ -23,7 +24,16 @@ If changing documentation, a link to a preview of the page is great.
<!-- These boxes may be checked after opening the pull request. -->

- [ ] This pull request references any related issue by including "closes `<link to issue>`"
- If no issue exists and your change is not a small fix, please [create an issue](https://github.com/PrefectHQ/prefect/issues/new/choose) first.
- [ ] This pull request includes tests or only affects documentation.
- [ ] This pull request includes a label categorizing the change e.g. `fix`, `feature`, `enhancement`, `docs`.
- If no issue exists and your change is not a small fix, please [create an issue](https://github.com/PrefectHQ/prefect/issues/new/choose) first.
- [ ] If this pull request adds new functionality, it includes unit tests that cover the changes
- [ ] This pull request includes a label categorizing the change e.g. `maintenance`, `fix`, `feature`, `enhancement`, `docs`.
<!-- If you do not have permission to add a label, a maintainer will add one for you -->

For documentation changes:

- [ ] This pull request includes redirect settings in `mint.json` for files that are removed or renamed.

For new functions or classes in the Python SDK:

- [ ] This pull request includes helpful docstrings.
- [ ] If a new Python file was added, this pull request contains a stub page in the Python SDK docs and an entry in `docs/mint.json` navigation.
74 changes: 74 additions & 0 deletions .github/workflows/api-compatibility-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
name: Cloud API Compatibility
on:
pull_request:
paths:
- .github/workflows/api-compatibility-tests.yaml
- "**/*.py"
- requirements*.txt
- setup.cfg
- compat-tests
push:
branches:
- main

# Limit concurrency by workflow/branch combination.
#
# For pull request builds, pushing additional changes to the
# branch will cancel prior in-progress and pending builds.
#
# For builds triggered on a branch push, additional changes
# will wait for prior builds to complete before starting.
#
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
compatibility-tests:

timeout-minutes: 10

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
# Versioneer only generates correct versions with a full fetch
fetch-depth: 0
persist-credentials: false
submodules: true

- name: Set up Python 3.12
uses: actions/setup-python@v5
id: setup_python
with:
python-version: 3.12

- name: UV Cache
# Manually cache the uv cache directory
# until setup-python supports it:
# https://github.com/actions/setup-python/issues/822
uses: actions/cache@v4
id: cache-uv
with:
path: ~/.cache/uv
key: uvcache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements-client.txt', 'requirements.txt', 'requirements-dev.txt') }}

- name: Install packages
run: |
python -m pip install -U uv
uv pip install --upgrade --system -e .[dev] 'pydantic>=2.4,<3'
- name: Create Cloud OpenAPI JSON
working-directory: compat-tests
run: curl https://api.prefect.cloud/api/openapi.json > cloud_schema.json

- name: Create OSS OpenAPI JSON
working-directory: compat-tests
run: python ../scripts/generate_oss_openapi_schema.py

- name: Run API compatibility tests
working-directory: compat-tests
run: pytest -vv
56 changes: 39 additions & 17 deletions .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ env:
on:
pull_request:
paths:
- .github/workflows/benchmarks.yaml
- .github/workflows/python-tests.yaml
- "**/*.py"
- "src/prefect/**/*.py"
- requirements.txt
- requirements-dev.txt
- setup.cfg
Expand All @@ -28,36 +29,45 @@ jobs:
name: Benchmark
# Runs with ephemeral API and SQLite database right now

runs-on: ubuntu-latest
runs-on:
group: oss-larger-runners
timeout-minutes: 20

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Docker Buildx
if: ${{ matrix.build-docker-images }}
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=moby/buildkit:v0.12.5

- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "requirements*.txt"

- name: UV Cache
uses: actions/cache@v4
id: cache-uv
with:
path: ~/.cache/uv
key: uvcache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements-client.txt', 'requirements.txt', 'requirements-dev.txt') }}


- name: Install packages
run: |
python -m pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -e ".[dev]"
python -m pip install -U uv
uv pip install --upgrade --system -e .[dev]
- name: Prepare benchmark comparisons
# Note: We use a "cache" instead of artifacts because artifacts are not available
# across workflow runs.
id: bench-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./.benchmarks
# Pushes benchmark results for this branch and sha, this will always be a cache miss
Expand All @@ -68,7 +78,6 @@ jobs:
${{ runner.os }}-${{ github.base_ref }}-
${{ runner.os }}-main-
- name: Start server
run: |
prefect server start&
Expand All @@ -78,12 +87,25 @@ jobs:
# https://github.com/PrefectHQ/prefect/issues/6990
- name: Run benchmarks
env:
HEAD_REF: ${{ github.head_ref }}
GITHUB_SHA: ${{ github.sha }}
# Includes comparison to previous benchmarks if available
run: >
uniquename=${{ github.head_ref || 'main' }}-${{ github.sha }}
run: |
if [[ -z "$HEAD_REF" ]]; then
# HEAD_REF is unset or empty, use 'main' with the SHA
uniquename="main-$GITHUB_SHA"
else
# HEAD_REF is set, use the branch name directly
uniquename="$HEAD_REF"
fi
# Allow alphanumeric, underscores, and dashes, and replace other
# characters with an underscore
sanitized_uniquename="${uniquename//[^a-zA-Z0-9_\-]/_}"
PREFECT_API_URL="http://127.0.0.1:4200/api"
python benches
--benchmark-save="${uniquename//\//_}"
${{ steps.bench-cache.outputs.cache-hit && '--benchmark-compare' || ''}}
python benches \
--timeout=180 \
--benchmark-save="${sanitized_uniquename}" \
${{ steps.bench-cache.outputs.cache-hit && '--benchmark-compare' || '' }}
Loading

0 comments on commit cd12308

Please sign in to comment.