Skip to content

Commit

Permalink
chore: fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
liorgold2 committed Jul 24, 2024
1 parent d1032df commit cd31074
Show file tree
Hide file tree
Showing 302 changed files with 32,950 additions and 1,544 deletions.
6 changes: 6 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Place configuration for clippy lints here, when applicable (lints that can be configured
# state so in clippy's documentation).
# Note: only lint configurations can be placed here, lints must be placed in `.cargo/config.toml`.

allow-unwrap-in-tests = true
enum-variant-size-threshold = 500
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/data
/deployments
/logs
/target
.git
!crates/papyrus_load_test/resources
16 changes: 16 additions & 0 deletions .github/.codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ignore:
- "crates/**/*test*.rs"
coverage:
status:
project:
default:
target: auto # set the target coverage to the value of the parent commit
threshold: 10% # pct of drop in coverage that is still considered as success
informational: true # if true does not fail the CI is coverage is bellow the target value
only_pulls: true # run only on PRs
patch:
default:
target: 100%
threshold: 0%
informational: true
only_pulls: true
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/ @dan-starkware
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/01_BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug Report
about: Create a report to help Papyrus to improve
title: "bug: "
labels: "bug"
assignees: ""
---

# Bug Report

**Papyrus version:**

<!-- Please specify commit or tag version. -->

**Current behavior:**

<!-- Describe how the bug manifests. -->

**Expected behavior:**

<!-- Describe what you expect the behavior to be without the bug. -->

**Steps to reproduce:**

<!-- Explain the steps required to duplicate the issue, especially if you are able to provide a sample application. -->

**Related code:**

<!-- If you are able to illustrate the bug or feature request with an example, please provide it here. -->

```
insert short code snippets here
```

**Other information:**

<!-- List any other information that is relevant to your issue. Related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Feature Request
about: Suggest an idea for this project
title: "feat: "
labels: "enhancement"
assignees: ""
---

# Feature Request

**Describe the Feature Request**

<!-- A clear and concise description of what the feature request is. Please include if your feature request is related to a problem. -->

**Describe Preferred Solution**

<!-- A clear and concise description of what you want to happen. -->

**Describe Alternatives**

<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Related Code**

<!-- If you are able to illustrate the bug or feature request with an example, please provide it here. -->

**Additional Context**

<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to add, use case, Stack Overflow links, forum links, screenshots, OS if applicable, etc. -->

**If the feature request is approved, would you be willing to submit a PR?**
_(Help can be provided if you need assistance submitting a PR)_

- [ ] Yes
- [ ] No
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Codebase improvement
about: Provide your feedback for the existing codebase. Suggest a better solution for algorithms, development tools, etc.
title: "dev: "
labels: "enhancement"
assignees: ""
---
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
blank_issues_enabled: false
contact_links:
- name: Papyrus Community Support
url: https://github.com/starkware-libs/papyrus/discussions
about: Please ask and answer questions here.
34 changes: 34 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Pull Request type

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build-related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: N/A

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added by this PR. -->

-

## Does this introduce a breaking change?

- [ ] Yes
- [ ] No

<!-- If this does introduce a breaking change, please describe the impact and migration path for existing applications below. -->

## Other information

<!-- Any other information that is important to this PR, such as screenshots of how the component looks before and after the change. -->
78 changes: 78 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
- name: "breaking-change"
color: ee0701
description: "A change that changes the API or breaks backward compatibility for users."
- name: "bugfix"
color: ee0701
description: "Inconsistencies or issues which will cause a problem for users or implementors."
- name: "documentation"
color: 0052cc
description: "Solely about the documentation of the project."
- name: "enhancement"
color: 1d76db
description: "Enhancement of the code, not introducing new features."
- name: "refactor"
color: 1d76db
description: "Updating the code with simpler, easier to understand or more efficient syntax or methods, but not introducing new features."
- name: "performance"
color: 1d76db
description: "Improving performance of the project, not introducing new features."
- name: "new-feature"
color: 0e8a16
description: "New features or options."
- name: "maintenance"
color: 2af79e
description: "Generic maintenance tasks."
- name: "ci"
color: 1d76db
description: "Work that improves the continuous integration."
- name: "dependencies"
color: 1d76db
description: "Change in project dependencies."

- name: "in-progress"
color: fbca04
description: "Issue is currently being worked on by a developer."
- name: "stale"
color: fef2c0
description: "No activity for quite some time."
- name: "no-stale"
color: fef2c0
description: "This is exempt from the stale bot."

- name: "security"
color: ee0701
description: "Addressing a vulnerability or security risk in this project."
- name: "incomplete"
color: fef2c0
description: "Missing information."
- name: "invalid"
color: fef2c0
description: "This is off-topic, spam, or otherwise doesn't apply to this project."

- name: "beginner-friendly"
color: 0e8a16
description: "Good first issue for people wanting to contribute to this project."
- name: "help-wanted"
color: 0e8a16
description: "We need some extra helping hands or expertise in order to resolve this!"

- name: "priority-critical"
color: ee0701
description: "Must be addressed as soon as possible."
- name: "priority-high"
color: b60205
description: "After critical issues are fixed, these should be dealt with before any further issues."
- name: "priority-medium"
color: 0e8a16
description: "This issue may be useful, and needs some attention."
- name: "priority-low"
color: e4ea8a
description: "Nice addition, maybe... someday..."

- name: "major"
color: b60205
description: "This PR causes a major bump in the version number."
- name: "minor"
color: 0e8a16
description: "This PR causes a minor bump in the version number."
100 changes: 100 additions & 0 deletions .github/workflows/blockifier_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Blockifier-CI

on:
push:
branches:
- main
- main-v[0-9].**
tags:
- v[0-9].**
paths:
- 'crates/blockifier/**'

pull_request:
types:
- opened
- reopened
- synchronize
- auto_merge_enabled
- edited
paths:
- 'crates/blockifier/**'

jobs:
featureless-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
- run: cargo build -p blockifier
- run: cargo test -p blockifier

run-python-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- run: |
python -m pip install --upgrade pip
pip install pytest
- run: pytest scripts/merge_paths_test.py

native-blockifier-artifacts-push:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"

- name: Build native blockifier
run: ./build_native_blockifier.sh

# Commit hash on pull request event would be the head commit of the branch.
- name: Get commit hash prefix for PR update
if: ${{ github.event_name == 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV

# On push event (to main, for example) we should take the commit post-push.
- name: Get commit hash prefix for merge
if: ${{ github.event_name != 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.after }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV

# Rename is required; see https://pyo3.rs/v0.19.2/building_and_distribution#manual-builds.
- name: Rename shared object
run: |
mv \
target/release/libnative_blockifier.so \
target/release/native_blockifier.pypy39-pp73-x86_64-linux-gnu.so
- name: Authenticate with GCS
uses: "google-github-actions/auth@v2"
with:
credentials_json: ${{ secrets.SA_NATIVE_BLOCKIFIER_ARTIFACTS_BUCKET_WRITER_ACCESS_KEY }}

- name: Upload binary to GCP
id: upload_file
uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: "target/release/native_blockifier.pypy39-pp73-x86_64-linux-gnu.so"
destination: "native_blockifier_artifacts/${{ env.SHORT_HASH }}/release/"

# Keep the name 'udeps' to match original action name, so we don't need to define specific branch
# rules on Github for specific version branches.
udeps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Machete (detect unused dependencies)
uses: bnjbvr/cargo-machete@main
41 changes: 41 additions & 0 deletions .github/workflows/blockifier_compiled_cairo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Blockifier-Compiled-Cairo

on:
push:
branches:
- main
tags:
- v[0-9].**
paths:
- 'crates/blockifier/feature_contracts/cairo0/**'
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- 'crates/blockifier/feature_contracts/cairo0/**'

jobs:
verify_cairo_file_dependencies:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"

# Setup pypy and link to the location expected by .cargo/config.toml.
- uses: actions/setup-python@v5
id: setup-pypy
with:
python-version: 'pypy3.9'
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV

- run:
pip install -r crates/blockifier/tests/requirements.txt;
cargo test verify_feature_contracts -- --include-ignored
Loading

0 comments on commit cd31074

Please sign in to comment.