Skip to content

Commit b871774

Browse files
mshanemcWillieRuemmeleSF-CLI-BOTsvc-scmshetzel
authored
feat: source tracking beta commands
* refactor: redo open for sfdx-core dependency reasons * test: ebikes for nuts * feat: source tracking commands in source:beta * test: nuts for source tracking commands * docs: new subtopics * chore: remove imported asserted project/org * chore: restore breaking comma * chore: bump source tracking version * chore: rebuild with latest lockfile * refactor: feedback from WR * style: typo and cleaner concats * chore: pr feedback * refactor: pull more like retrieve * refactor: status formatter * test: remove unused export * chore: bump stl * fix: missing header for pull * fix: show conflicts from both remote and local, including remote filename * test: better output, workaroun for Audience type * refactor: consistent naming of command classes * refactor: push feedback * style: comment is no longer a question * test: ebikes from clone instead of fs * fix: status flags are better * test: nuts with conn adjusted for git checkout * chore: bump sdr for Created state fix * test: unignore profiles * test: was not using ebikes, revert * chore: change status' flags in snapshot * feat: show conflicts from both remote and local, including remote filename * fix: show conflicts from both remote and local, including remote filename * test: better output, workaroun for Audience type * fix: push gets its own formatter for json reasons * fix: missing pull messages * chore: bump SDR to 4.5.7 (#253) * chore(release): 1.2.3 [ci skip] * Updated/Added CODEOWNERS with ECCN * chore(release): 1.2.4 [ci skip] * chore: sync .gitignore [skip-validate-pr] (#251) Authored via Leif * test: parallelize nuts, exclude async deploy nut * test: one NUT for special types * test: remove tracking NUTs * ci: custom nut commands * test: fix folderTypes, cross-env for windows * test: cross-env for windows SEED_FILTER, nyc only top-level * ci: no sha; change nut order * test: deploy nuts in parallel * ci: disable async nuts * test: exclude async nuts * test: revert async-exclude * test: revert tsconfig, revert config.yml * test: exclude env for seeds * feat: mark ignores * feat: status shows remote ignores * refactor: consistent naming of command classes * refactor: push feedback * style: comment is no longer a question * test: ebikes from clone instead of fs * fix: status flags are better * test: nuts with conn adjusted for git checkout * chore: bump sdr for Created state fix * test: unignore profiles * test: was not using ebikes, revert * chore: change status' flags in snapshot * refactor: move status logic to STL * test: update ignore nut * style: formatting line length * fix: push uses correct json * test: update tests for new push json format * test: ut on lts, not node17 * Wr/destructive deploy (#230) * fix: implementing destructive change deploy, 1 NUT * chore: add NUTs, fix UTs * chore: post-review board updates * chore: fix linting * chore: minor updates to flag logic, redo NUT query method * chore: remove unnecessary checks in NUTs * chore: bump SDR to 5, include deploy:destructive in NUTs * chore(release): 1.2.5 [ci skip] * fix: use cross-env for test:nuts script (#260) * chore(release): 1.2.6 [ci skip] * chore: unhide beta commands * chore: bump SDR and STL * test: and tracking nuts * ci: windows UT * test: nuts are hub-auth-agnostic * ci: windows only * ci: restore windows tests Co-authored-by: Willie Ruemmele <[email protected]> Co-authored-by: SF-CLI-BOT <[email protected]> Co-authored-by: svc-scm <[email protected]> Co-authored-by: Steve Hetzel <[email protected]> * Sm/quiet-flag (#259) * fix: push gets its own formatter for json reasons * fix: missing pull messages * feat: mark ignores * feat: status shows remote ignores * refactor: move status logic to STL * test: update ignore nut * style: formatting line length * fix: push uses correct json * test: update tests for new push json format * test: ut on lts, not node17 * test: include tracking nuts * feat: quiet flag on push (for stdout and json) * test: put the individual tracking nuts back * feat: quiet shows only failures in json * refactor: simplify quiet logic * test: ut for formatter with quiet * feat: show ignored if any * refactor: ignored as first column * fix: no spinner for conflict check on --overwrite * fix: early exit when there are no results * fix: handle no-result (deletes only, or no changes) * chore: bump sdr and stl Co-authored-by: Willie Ruemmele <[email protected]> Co-authored-by: SF-CLI-BOT <[email protected]> Co-authored-by: svc-scm <[email protected]> Co-authored-by: Steve Hetzel <[email protected]>
1 parent 84396b7 commit b871774

35 files changed

+2226
-149
lines changed

.circleci/config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@ workflows:
5252
- linux
5353
- windows
5454
node_version:
55-
- latest
55+
# - latest
5656
- lts
5757
- maintenance
5858
exclude:
59-
- os: windows
60-
node_version: lts
6159
- os: windows
6260
node_version: maintenance
6361
- release-management/test-nut:
@@ -79,6 +77,7 @@ workflows:
7977
- 'yarn test:nuts:retrieve'
8078
- 'yarn test:nuts:specialTypes'
8179
- 'yarn test:nuts:deploy:destructive'
80+
- 'yarn test:nuts:tracking'
8281
- release-management/release-package:
8382
sign: true
8483
github-release: true

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
*/
77
module.exports = {
88
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license'],
9+
ignorePatterns: ['test/nuts/ebikes-lwc/**'],
910
};

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ node_modules
3939
# os specific files
4040
.DS_Store
4141
.idea
42+
43+
# ignore generated nut tests
44+
test/nuts/generated/

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ All notable changes to this project will be documented in this file. See [standa
44

55
### [1.2.6](https://github.com/salesforcecli/plugin-source/compare/v1.2.5...v1.2.6) (2021-10-21)
66

7-
87
### Bug Fixes
98

10-
* use cross-env for test:nuts script ([#260](https://github.com/salesforcecli/plugin-source/issues/260)) ([76627fb](https://github.com/salesforcecli/plugin-source/commit/76627fb21c62a4fb140c87ccfc266accd79af3fd))
9+
- use cross-env for test:nuts script ([#260](https://github.com/salesforcecli/plugin-source/issues/260)) ([76627fb](https://github.com/salesforcecli/plugin-source/commit/76627fb21c62a4fb140c87ccfc266accd79af3fd))
1110

1211
### [1.2.5](https://github.com/salesforcecli/plugin-source/compare/v1.2.4...v1.2.5) (2021-10-21)
1312

README.md

Lines changed: 55 additions & 51 deletions
Large diffs are not rendered by default.

command-snapshot.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
[
2+
{
3+
"command": "force:source:beta:pull",
4+
"plugin": "@salesforce/plugin-source",
5+
"flags": ["apiversion", "forceoverwrite", "json", "loglevel", "targetusername", "wait"]
6+
},
7+
{
8+
"command": "force:source:beta:push",
9+
"plugin": "@salesforce/plugin-source",
10+
"flags": ["apiversion", "forceoverwrite", "ignorewarnings", "json", "loglevel", "quiet", "targetusername", "wait"]
11+
},
12+
{
13+
"command": "force:source:beta:status",
14+
"plugin": "@salesforce/plugin-source",
15+
"flags": ["apiversion", "json", "local", "loglevel", "remote", "targetusername"]
16+
},
17+
{
18+
"command": "force:source:beta:tracking:clear",
19+
"plugin": "@salesforce/plugin-source",
20+
"flags": ["apiversion", "json", "loglevel", "noprompt", "targetusername"]
21+
},
22+
{
23+
"command": "force:source:beta:tracking:reset",
24+
"plugin": "@salesforce/plugin-source",
25+
"flags": ["apiversion", "json", "loglevel", "noprompt", "revision", "targetusername"]
26+
},
227
{
328
"command": "force:source:convert",
429
"plugin": "@salesforce/plugin-source",

messages/pull.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"description": "pull source from the scratch org to the project",
3+
"descriptionLong": "Pulls changed source from the scratch org to your project to keep them in sync.",
4+
"help": "If the command detects a conflict, it displays the conflicts but does not complete the process. After reviewing the conflict, rerun the command with the --forceoverwrite parameter.",
5+
"flags": {
6+
"forceoverwrite": "ignore conflict warnings and overwrite changes to the project",
7+
"forceoverwriteLong": "Runs the pull command even if conflicts exist. Changes in the scratch org overwrite changes in the project.",
8+
"waitLong": "The number of minutes to wait for the command to complete and display results to the terminal window. If the command continues to run after the wait period, the CLI returns control of the terminal window to you. The default is 33 minutes."
9+
},
10+
"NonScratchOrgPull": "We can\"t retrieve your changes. \"force:source:pull\" is only available for orgs that have source tracking enabled. Use \"force:source:retrieve\" or \"force:mdapi:retrieve\" instead.",
11+
"sourceConflictDetected": "Source conflict(s) detected.",
12+
"pull": "Your retrieve request did not complete within the specified wait time [%s minutes]. Try again with a longer wait time.",
13+
"retrievedSourceHeader": "Retrieved Source",
14+
"NoResultsFound": "No results found",
15+
"retrievedSourceWarningsHeader": "Retrieved Source Warnings",
16+
"retrieveTimeout": "Your retrieve request did not complete within the specified wait time [%s minutes]. Try again with a longer wait time."
17+
}

messages/push.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"description": "push source to a scratch org from the project",
3+
"descriptionLong": "Pushes changed source from your project to a scratch org to keep them in sync.",
4+
"help": "If the command detects a conflict, it displays the conflicts but does not complete the process. After reviewing the conflict, rerun the command with the --forceoverwrite parameter.",
5+
"flags": {
6+
"waitLong": "Number of minutes to wait for the command to complete and display results to the terminal window. If the command continues to run after the wait period, the CLI returns control of the terminal window to you. The default is 33 minutes.",
7+
"forceoverwrite": "ignore conflict warnings and overwrite changes to scratch org",
8+
"forceoverwriteLong": "Runs the push command even if conflicts exist. Changes in the project overwrite changes in the scratch org.",
9+
"replacetokens": "replace tokens in source files prior to deployment",
10+
"replacetokensLong": "Replaces tokens in source files prior to deployment.",
11+
"ignorewarnings": "deploy changes even if warnings are generated",
12+
"ignorewarningsLong": "Completes the deployment even if warnings are generated.",
13+
"quiet": "minimize json and sdtout output on success"
14+
},
15+
"sourcepushFailed": "Push failed.",
16+
"conflictMsg": "We couldn't complete the push operation due to conflicts. Verify that you want to keep the local versions, then run \"sfdx force:source:push -f\" with the --forceoverwrite (-f) option."
17+
}

messages/status.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"description": "list local changes and/or changes in a scratch org",
3+
"LongDescription": "Lists changes that have been made locally, in a scratch org, or both.",
4+
"examples": [
5+
"sfdx force:source:status -l",
6+
"sfdx force:source:status -r",
7+
"sfdx force:source:status -a",
8+
"sfdx force:source:status -a -u [email protected] --json"
9+
],
10+
"flags": {
11+
"all": "list all the changes that have been made",
12+
"allLong": "Lists all the changes that have been made.",
13+
"local": "list the changes that have been made locally",
14+
"localLong": "Lists the changes that have been made locally.",
15+
"remote": "list the changes that have been made in the scratch org",
16+
"remoteLong": "Lists the changes that have been made in the scratch org."
17+
},
18+
"humanSuccess": "Source Status"
19+
}

messages/tracking.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"resetDescription": "reset local and remote source tracking\n\n WARNING: This command deletes or overwrites all existing source tracking files. Use with extreme caution. \n\nResets local and remote source tracking so that the CLI no longer registers differences between your local files and those in the org. When you next run force:source:status, the CLI returns no results, even though conflicts might actually exist. The CLI then resumes tracking new source changes as usual.\n\nUse the --revision parameter to reset source tracking to a specific revision number of an org source member. To get the revision number, query the SourceMember Tooling API object with the force:data:soql:query command. For example:\n $ sfdx force:data:soql:query -q \"SELECT MemberName, MemberType, RevisionCounter FROM SourceMember\" -t",
3+
"clearDescription": "clear all local source tracking information\n\nWARNING: This command deletes or overwrites all existing source tracking files. Use with extreme caution.\n\nClears all local source tracking information. When you next run force:source:status, the CLI displays all local and remote files as changed, and any files with the same name are listed as conflicts.",
4+
"nopromptDescription": "do not prompt for source tracking override confirmation",
5+
"revisionDescription": "reset to a specific SourceMember revision counter number",
6+
"promptMessage": "WARNING: This operation will modify all your local source tracking files. The operation can have unintended consequences on all the force:source commands. Are you sure you want to proceed (y/n)?"
7+
}

0 commit comments

Comments
 (0)