Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check for commit ref for --to and --from parameters #985

Merged
merged 14 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 13 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
1 change: 1 addition & 0 deletions .github/linters/.cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"appli",
"authprovider",
"authproviders",
"AUTOUPDATE",
"behaviour",
"benchmarkjs",
"biomejs",
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/on-main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ jobs:
with:
node-version: 18

- uses: google/wireit@setup-github-actions-caching/v2

- name: Setup dependencies, cache and install
uses: ./.github/actions/install

- uses: google/wireit@setup-github-actions-caching/v2
- name: Set environment variables
run: |
echo "SF_DISABLE_AUTOUPDATE=true" >> "$GITHUB_ENV"
echo "SF_DISABLE_TELEMETRY=true" >> "$GITHUB_ENV"

- name: Build plugin
run: npm pack
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
with:
node-version: 18

- uses: google/wireit@setup-github-actions-caching/v2

- name: Setup dependencies, cache and install
uses: ./.github/actions/install

- uses: google/wireit@setup-github-actions-caching/v2

- name: Lint plugin
run: npm run lint

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Set environment variables
run: |
echo "SF_DISABLE_AUTOUPDATE=true" >> "$GITHUB_ENV"
echo "SF_DISABLE_TELEMETRY=true" >> "$GITHUB_ENV"

- name: Install cli
run: npm install -g ${{ matrix.cli }}

Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
- [Execute sgd](#execute-sgd)
- [Deploy the delta metadata](#deploy-the-delta-metadata)
- [Advanced use-cases](#advanced-use-cases)
- [Evaluate uncommitted work as well](#evaluate-uncommitted-work-as-well)
- [Generate a folder containing only the added/modified sources](#generate-a-folder-containing-only-the-addedmodified-sources)
- [Exclude some metadata only from destructiveChanges.xml](#exclude-some-metadata-only-from-destructivechangesxml)
- [Explicitly including specific files for inclusion or destruction regardless of diff](#explicitly-including-specific-files-for-inclusion-or-destruction-regardless-of-diff)
Expand Down Expand Up @@ -185,6 +186,13 @@ EXAMPLES
$ sf sgd source delta --from "origin/development" --output-dir incremental
- Build incremental manifest and source from the development branch
$ sf sgd source delta --from "origin/development" --generate-delta --output-dir incremental

FLAG DESCRIPTIONS
-a, --api-version=<value>

salesforce metadata API version, default to sfdx-project.json "sourceApiVersion" attribute or latest version

Override the api version used for api requests made by this command
```

_See code: [src/commands/sgd/source/delta.ts](https://github.com/scolladon/sfdx-git-delta/blob/main/src/commands/sgd/source/delta.ts)_
Expand Down Expand Up @@ -352,6 +360,19 @@ sf project deploy start --pre-destructive-changes destructiveChanges/destructive

## Advanced use-cases

### Evaluate uncommitted work as well

Commit your changes, then use SGD, then reset (soft if you want to keep the changes) the commit

```sh
git add '<files>'
git commit -m '<meaningful temporary message>'
sf sgd source delta --from <sha-pointer>
git reset --soft HEAD~1
```

It is also possible to do those operation inside a temporary branch to further isolate the operation.

### Generate a folder containing only the added/modified sources

Using a package.xml for deployment is the simplest approach to delta deployments. But in some cases you may want to have only the actual recently changed source files.
Expand Down
8 changes: 6 additions & 2 deletions messages/delta.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,13 @@ Attempt to delete the flow '%s' via destructiveChanges.xml may not work as expec

Generating incremental package

# info.CommandHasRun
# info.CommandSuccess

Done
Success

# info.CommandFailure

Failure

# info.EncourageSponsorship

Expand Down
Loading
Loading