Skip to content
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
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ commands:
steps:
- restore_cache:
keys:
- v1-verified-codemod-repos-{{ checksum "tests/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
- v1-verified-codemod-repos-{{ checksum "tests/integration/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
- run:
command: |
uv run --frozen gs codemod clone-repos --verified-codemod-repos --token ${CODEGEN_BOT_GHE_TOKEN}
- save_cache:
paths:
- $GITHUB_WORKSPACE
key: v1-verified-codemod-repos-{{ checksum "tests/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
key: v1-verified-codemod-repos-{{ checksum "tests/integration/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
build-wheels:
parameters:
base_packages:
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
- fetch-verified-codemods
- cache-verified-codemod-repos
- run_ats:
default_tests: "tests/codemod/test_verified_codemods.py"
default_tests: "tests/integration/codemod/test_verified_codemods.py"
codecov_flags: "smart-tests-codemod"
collect_args: --cli-api-key ${PROD_CLI_API_KEY} --token ${CODEGEN_BOT_GHE_TOKEN}
ats_collect_args: --cli-api-key=${PROD_CLI_API_KEY},--token=${CODEGEN_BOT_GHE_TOKEN},
Expand All @@ -264,7 +264,7 @@ jobs:
- clone-repos:
extra_repos: false
- run_ats:
default_tests: "tests/codemod/test_codemods.py"
default_tests: "tests/integration/codemod/test_codemods.py"
codecov_flags: "smart-tests-codemod-oss"
collect_args: --size=<<parameters.size>> --sync-graph=<<parameters.sync_graph>> --token ${CODEGEN_BOT_GHE_TOKEN}
ats_collect_args: --size=<<parameters.size>>,--sync-graph=<<parameters.sync_graph>>,--token=${CODEGEN_BOT_GHE_TOKEN},
Expand Down Expand Up @@ -297,7 +297,7 @@ jobs:
if [ "<<parameters.extra_repos>>" = "true" ]; then
EXTRA_REPOS_ARG="--extra-repos=true"
fi
PYTEST_ARGS="${EXTRA_REPOS_ARG} --token ${CODEGEN_BOT_GHE_TOKEN} -o junit_suite_name=\"${CIRCLE_JOB}\" tests/codemod/test_parse.py"
PYTEST_ARGS="${EXTRA_REPOS_ARG} --token ${CODEGEN_BOT_GHE_TOKEN} -o junit_suite_name=\"${CIRCLE_JOB}\" tests/integration/codemod/test_parse.py"
echo "Running tests with args: $PYTEST_ARGS"
TESTS_TO_RUN=$(PYTEST_ARGS=${PYTEST_ARGS} ./.circleci/collect.sh)
echo $TESTS_TO_RUN | circleci tests run --command "ulimit -s unlimited; xargs uv run --frozen pytest -n auto ${PYTEST_ARGS}"
Expand Down
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**/expected_diff.txt filter=lfs diff=lfs merge=lfs -text
tests/codemod/repos/extra/*.json filter=lfs diff=lfs merge=lfs -text
tests/integration/codemod/repos/extra/*.json filter=lfs diff=lfs merge=lfs -text
**/expected_diff.patch filter=lfs diff=lfs merge=lfs -text
tests/codemod/repos/repos.json filter=lfs diff=lfs merge=lfs -text
tests/verified_codemods/** filter=lfs diff=lfs merge=lfs -text
tests/integration/codemod/repos/repos.json filter=lfs diff=lfs merge=lfs -text
tests/integration/verified_codemods/** filter=lfs diff=lfs merge=lfs -text
.github/disallowed-words.txt filter=lfs diff=lfs merge=lfs -text
4 changes: 2 additions & 2 deletions .github/disallowed-words.txt
Git LFS file not shown
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ uv-*.tar.gz
graph-sitter-types/out/**
graph-sitter-types/typings/**
coverage.json
tests/verified_codemods/codemod_data/repo_commits.json
tests/integration/verified_codemods/codemod_data/repo_commits.json

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
hooks:
- id: biome-check
additional_dependencies: ["@biomejs/[email protected]"]
exclude: (src/codemods/eval)|(tests/unit/skills)|(tests/unit/output)|(tests/verified_codemods)|(docs/samples)
exclude: (src/codemods/eval)|(tests/unit/codegen/sdk/skills)|(tests/unit/codegen/sdk/output)|(tests/integration/verified_codemods)|(docs/samples)

- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.6
Expand Down
32 changes: 16 additions & 16 deletions CLA.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,40 @@
2. **“Contribution”** means any work of authorship (including any modifications or additions) that is intentionally Submitted by You for inclusion in the Project, in any form (including but not limited to source code, documentation, or other materials).
3. **“Submit”** or **“Submitted”** means any act of transferring a Contribution to Codegen, Inc. via pull request, email, or any other method of communication for the purpose of inclusion in the Project.
2. **Grant of Copyright License**

Subject to the terms and conditions of this CLA, You hereby grant to Codegen, Inc. and to recipients of software distributed by Codegen, Inc.:

- A perpetual, worldwide, non-exclusive, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
3. **Grant of Patent License**

Subject to the terms and conditions of this CLA, You hereby grant to Codegen, Inc. and to recipients of software distributed by Codegen, Inc. a perpetual, worldwide, non-exclusive, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer Your Contribution, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution alone or by combination of Your Contribution with the Project to which You Submitted it.

If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your Contribution, or the Project to which You have contributed, directly or indirectly infringes any patent, then any patent licenses granted to that entity under this CLA for that Contribution or Project shall terminate as of the date such litigation is filed.

4. **Representations and Warranties**
1. **Original Work**. You represent that each of Your Contributions is an original work of authorship and that You have the necessary rights to grant the licenses under this CLA.
2. **Third-Party Rights**. If Your employer(s) or any third party has rights to intellectual property that You create, You represent that You have received permission to make Contributions on behalf of that employer or third party (or that such employer or third party has waived those rights for Your Contributions).
3. **No Other Agreements**. You represent that You are not aware of any other agreement or obligation that is inconsistent with the rights granted under this CLA.
5. **Disclaimer of Warranty**

UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, YOU PROVIDE YOUR CONTRIBUTIONS ON AN **“AS IS”** BASIS, **WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND**, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.

6. **Limitation of Liability**

IN NO EVENT SHALL CODEGEN, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE), ARISING IN ANY WAY OUT OF OR IN CONNECTION WITH THIS AGREEMENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

7. **Subsequent Contributions and Updates**

You agree that all current and future Contributions to the Project Submitted by You shall be subject to the terms of this CLA. Codegen, Inc. may publish updates to this CLA from time to time; in such case, You may need to agree to new terms before any subsequent Contributions.

8. **License Modification Rights**

You agree that Codegen, Inc. may change the license(s) applicable to the open source project(s) to which Your Contributions relate at Codegen, Inc.’s sole discretion, including without limitation by re-licensing the project(s) and Your Contributions under any other open source or “free” software license, or a commercial or proprietary license of Codegen, Inc.’s choosing.

9. **Governing Law**

This CLA shall be governed by and construed in accordance with the laws of the State of Delaware, without regard to its conflicts of laws provisions.

10. **Signature / Electronic Consent**

By signing or otherwise indicating Your acceptance of this CLA, You acknowledge that You have read and agree to be bound by its terms. If You are signing on behalf of an entity, You represent and warrant that You have the authority to do so.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ uv sync --dev
uv run pytest tests/unit -n auto

# Codemod tests (tests larger programs)
uv run pytest tests/codemod/test_codemods.py -n auto
uv run pytest tests/integration/codemod/test_codemods.py -n auto
```

## Pull Request Process
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ pythonVersion = "3.12"
enableExperimentalFeatures = true
[tool.pytest.ini_options]
# addopts = -v
pythonpath = "."
norecursedirs = "repos expected"
# addopts = -v --cov=app --cov-report=term

Expand Down
4 changes: 2 additions & 2 deletions src/codegen/sdk/testing/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

BASE_TMP_DIR = Path(os.getenv("GITHUB_WORKSPACE", tempfile.gettempdir()))
BASE_PATH: Path = Path(__file__).parent.parent.parent.parent.parent
TEST_DIR: Path = BASE_PATH / "tests" / "codemod"
TEST_DIR: Path = BASE_PATH / "tests" / "integration" / "codemod"
CODEMOD_PATH: Path = BASE_PATH / "src" / "codemods"
VERIFIED_CODEMOD_DIR: Path = BASE_PATH / "tests" / "verified_codemods"
VERIFIED_CODEMOD_DIR: Path = BASE_PATH / "tests" / "integration" / "verified_codemods"
VERIFIED_CODEMOD_DATA_DIR: Path = VERIFIED_CODEMOD_DIR / "codemod_data"
VERIFIED_CODEMOD_DIFFS: Path = VERIFIED_CODEMOD_DIR / "verified_codemod_diffs"

Expand Down
2 changes: 1 addition & 1 deletion src/codemods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Put your codemod in the canonical folder if it is canonical, otherwise put it in misc.
You can also add company folders if you wish
`{codemod_folder} = src/codemods/{type}/{name}`
`{codemod_tests_folder} = tests/codemod/{type}/{name}`
`{codemod_tests_folder} = tests/integration/codemod/{type}/{name}`

## Repos

Expand Down
1 change: 0 additions & 1 deletion tests/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions tests/shared/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Tests/shared

### What kind of things should go in here?
Testing utilities like mocks, fixtures, test data that are used across multiple tests.
Loading
Loading