diff --git a/.github/workflows/sf_cli_integration.yml b/.github/workflows/sf_cli_integration.yml index 5a515d1..f3c5fb3 100644 --- a/.github/workflows/sf_cli_integration.yml +++ b/.github/workflows/sf_cli_integration.yml @@ -2,6 +2,7 @@ name: SF CLI Integration Test on: pull_request: + workflow_dispatch: jobs: sf-cli-integration: @@ -21,11 +22,16 @@ jobs: with: python-version: '3.11' - - name: Install Poetry and Python SDK + - name: Install Poetry and build SDK wheel run: | python -m pip install --upgrade pip pip install poetry make develop + poetry build + + - name: Install SDK wheel into Poetry venv + run: | + "$(poetry env info --path)/bin/pip" install dist/*.whl --force-reinstall --no-deps - name: Add Poetry venv to PATH run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d320069..92881d6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,24 +60,43 @@ See the [Prerequisites section in README.md](./README.md#prerequisites) for comp datacustomcode version ``` -4. **Initialize a project for development work verification** +4. **Install the SF CLI and plugin** - **Note**: To test your changes and develop new features, initialize a sample project: + The SF CLI is how you test your SDK changes end-to-end (`init`, `scan`, `zip`, `run`, `deploy`). + + ```bash + # Install the Salesforce CLI (requires Node.js) + npm install -g @salesforce/cli + + # Install the Data Cloud Code Extension plugin + sf plugins install @salesforce/plugin-data-code-extension + ``` + +5. **Build and install your local SDK changes** + + The SF CLI plugin resolves templates from the installed package path. After making changes, build a wheel and install it: + + ```bash + poetry build + $(poetry env info --path)/bin/pip install dist/*.whl --force-reinstall --no-deps + ``` + + Re-run these two commands each time you make SDK changes you want to test via the SF CLI. + +6. **Test your changes** ```bash # Create a new directory for your test project mkdir my-test-project cd my-test-project - # Initialize a new Data Cloud custom code project - datacustomcode init . - - # Test your SDK modifications against the sample project with: - datacustomcode run ./payload/entrypoint.py + # Initialize, scan, zip, run + sf data-code-extension script init --package-dir . + sf data-code-extension script scan --entrypoint payload/entrypoint.py + sf data-code-extension script zip --package-dir . + sf data-code-extension script run --entrypoint payload/entrypoint.py -o ``` - **Tip**: See the [README.md](./README.md) for additional `datacustomcode` commands (`scan`, `deploy`, `zip`) to test specific code paths and validate your SDK changes thoroughly. - ## Versioning and Pre-Releases This project uses [PEP 440](https://peps.python.org/pep-0440/) version syntax. Versions are derived automatically from git tags via `poetry-dynamic-versioning`. diff --git a/pyproject.toml b/pyproject.toml index becaefb..b93bd90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,8 +87,8 @@ warn_unused_configs = true [tool.poetry] include = [ - {path = "src/datacustomcode/templates/**/*", format = "sdist"}, - {path = "src/datacustomcode/config.yaml", format = "sdist"} + {path = "src/datacustomcode/templates/**/*"}, + {path = "src/datacustomcode/config.yaml"} ] packages = [{include = "datacustomcode", from = "src"}] version = "0.0.0" @@ -133,7 +133,8 @@ datacustomcode = "datacustomcode.cli:cli" [tool.poetry-dynamic-versioning] enable = true -pattern = "^v(?P.+)$" +format-jinja = "{% if distance == 0 %}{{ base }}{{ stage or '' }}{% else %}{{ bump_version(base) }}.dev{{ distance }}+{{ commit }}{% endif %}" +pattern = "^v(?P\\d+\\.\\d+\\.\\d+)(?P\\.dev\\d+|a\\d+|b\\d+|rc\\d+)?$" style = "pep440" vcs = "git"