From aadaa6c7dfc1ea094c4c7c358d80df46783c59ea Mon Sep 17 00:00:00 2001 From: Mark DeLaVergne Date: Thu, 28 May 2026 12:00:55 -0400 Subject: [PATCH 1/4] Allow for manual runs of SF CLI Integration Test --- .github/workflows/sf_cli_integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sf_cli_integration.yml b/.github/workflows/sf_cli_integration.yml index 5a515d1..6248e5e 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: From a6948ffc1c4c91f58babb00dbfaca5af86a90721 Mon Sep 17 00:00:00 2001 From: Mark DeLaVergne Date: Thu, 28 May 2026 13:08:56 -0400 Subject: [PATCH 2/4] And fix for new changes in SF CLI v1.2.0 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index becaefb..5d7059e 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" From 4a55695e6c3288791898270fe7a6134f080f0d52 Mon Sep 17 00:00:00 2001 From: Mark DeLaVergne Date: Thu, 28 May 2026 13:54:39 -0400 Subject: [PATCH 3/4] More fixes for SF CLI v1.2.0, and docs on using SF CLI locally --- .github/workflows/sf_cli_integration.yml | 7 ++++- CONTRIBUTING.md | 37 ++++++++++++++++++------ pyproject.toml | 3 +- 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sf_cli_integration.yml b/.github/workflows/sf_cli_integration.yml index 6248e5e..f3c5fb3 100644 --- a/.github/workflows/sf_cli_integration.yml +++ b/.github/workflows/sf_cli_integration.yml @@ -22,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 5d7059e..884ccf2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,9 +133,10 @@ datacustomcode = "datacustomcode.cli:cli" [tool.poetry-dynamic-versioning] enable = true -pattern = "^v(?P.+)$" +pattern = "^v(?P\\d+\\.\\d+\\.\\d+)(?P\\.dev\\d+|a\\d+|b\\d+|rc\\d+)?$" style = "pep440" vcs = "git" +format-jinja = "{% if distance == 0 %}{{ base }}{{ stage or '' }}{% else %}{{ bump_version(base) }}.dev{{ distance }}+{{ commit }}{% endif %}" [tool.pytest.ini_options] addopts = "--cov=src/datacustomcode --cov-report=term-missing" From 414920514c62f0d2e6fa6ecd3b3e819f9110c2aa Mon Sep 17 00:00:00 2001 From: Mark DeLaVergne Date: Thu, 28 May 2026 13:58:17 -0400 Subject: [PATCH 4/4] Fix lint issue in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 884ccf2..b93bd90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,10 +133,10 @@ datacustomcode = "datacustomcode.cli:cli" [tool.poetry-dynamic-versioning] enable = true +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" -format-jinja = "{% if distance == 0 %}{{ base }}{{ stage or '' }}{% else %}{{ bump_version(base) }}.dev{{ distance }}+{{ commit }}{% endif %}" [tool.pytest.ini_options] addopts = "--cov=src/datacustomcode --cov-report=term-missing"