Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
389fc68
revert(coverage): Fail Package validation if low coverage (#941)
azlam-abdulsalam Apr 14, 2022
47eecad
chore(publish): update versions and publish to npm
Apr 14, 2022
320726d
chore(release-title): update release title to May22
Apr 17, 2022
0eb2633
feat(fast-feedback): experimental mode for faster feedback during val…
azlam-abdulsalam Apr 17, 2022
cdb4110
chore(publish): update versions and publish to npm
Apr 17, 2022
76a30ee
fix(validateimpl): fast feed back testing to respect testMode set in …
Apr 18, 2022
8502368
chore(publish): update versions and publish to npm
Apr 18, 2022
b0bed56
fix(apex-tests): ensure retry is available for all types of test modes
Apr 18, 2022
9f8daa7
fix(validate): fix headers being incorrectly displayed when there is …
Apr 18, 2022
6881268
refactor(validate): use constants declared in core lib instead of har…
Apr 18, 2022
a7d0a8f
chore(publish): update versions and publish to npm
Apr 18, 2022
35253ee
chore(dependencies): update @salesforce/core to 2.36.0
Apr 18, 2022
3cfb58b
chore(publish): update versions and publish to npm
Apr 18, 2022
226c946
fix(impacted-apex): add further conditions to impacted test class
Apr 19, 2022
98cac71
chore(publish): update versions and publish to npm
Apr 19, 2022
8d3fef4
fix(impacted-apex): use array concat instead of push, as it pushes wh…
Apr 19, 2022
2066682
feat(validateimpl): add a env variable to support debugging
Apr 19, 2022
18e1f39
fix(install-source): remove warning around selective, as its currentl…
Apr 19, 2022
3e4e8d5
chore(publish): update versions and publish to npm
Apr 19, 2022
6010a64
refactor(trigger-apex-tests): converge writing junit into write block…
Apr 19, 2022
07c66bf
feat(docker): add apex-link to docker image
Apr 21, 2022
5516bf4
refactor(apex-tests): refactor to make it readable and fix related bugs
Apr 21, 2022
b9f7f96
chore(publish): update versions and publish to npm
Apr 21, 2022
53b2db0
Merge branch 'main' of https://github.com/Accenture/sfpowerscripts in…
Apr 22, 2022
f44753e
refactor(fast-feedback): move fast feedback from using env variable t…
Apr 22, 2022
dc15b01
feat(fast-feedback): add fast feedback support in ValidateAgainstOrg
Apr 22, 2022
cae6a08
chore(publish): update versions and publish to npm
Apr 22, 2022
8cd89c3
fix(scripts): fix paths to pre and post deployment scripts when execu…
azlam-abdulsalam Apr 27, 2022
3a932b4
chore(publish): update versions and publish to npm
Apr 27, 2022
865b180
fix(scripts): fix the incorrect fix to paths to pre and post
Apr 27, 2022
b545572
chore(publish): update versions and publish to npm
Apr 27, 2022
fe198bf
chore(publish): update versions and publish to npm
Apr 27, 2022
e59f392
fix: predeployment script path
aly76 Apr 27, 2022
0e7a8a6
chore(publish): update versions and publish to npm
aly76 Apr 27, 2022
632429b
fix: upgrade semver from 7.3.5 to 7.3.6 (#956)
snyk-bot Apr 29, 2022
9c11e5e
fix: upgrade semver from 7.3.5 to 7.3.6 (#956)
snyk-bot Apr 29, 2022
f043a74
refactor/sfpPackage (#964)
azlam-abdulsalam May 4, 2022
cbb1a90
chore(publish): update versions and publish to npm
May 4, 2022
eb1e9af
feat(deploy): add additional log with trace level
May 4, 2022
33684ee
chore(publish): update versions and publish to npm
May 4, 2022
1034da3
fix(artifacts): remove temp directories before packaging artifact
May 5, 2022
3f3c764
fix(publish): fix issue when publishing artifacts bigger than 5 MB
May 5, 2022
2cc3284
chore(publish): update versions and publish to npm
May 5, 2022
b95f0b6
fix(deploy): fix crash when skipIfInstall is used with deploy
May 5, 2022
82d3c37
fix(test-options): fix lodash import
May 5, 2022
39e9956
chore(publish): update versions and publish to npm
May 5, 2022
77e5921
fix(changelog): fix crash in changelog due to incorrect usage of sour…
May 6, 2022
1e5d638
chore(publish): update versions and publish to npm
May 6, 2022
707460d
fix(package-test-coverage): fix matching of package type
May 6, 2022
a6574f2
chore(publish): update versions and publish to npm
May 6, 2022
cea880f
refactor(packagetype): move to an enum for packageType
May 6, 2022
557f210
chore(publish): update versions and publish to npm
May 6, 2022
223c028
fix(package-type): fix issues with overriding packageType during vali…
May 6, 2022
5394713
chore(publish): update versions and publish to npm
May 6, 2022
71805c6
fix(deploy): override package type in validate mode
May 6, 2022
18454ef
chore(publish): update versions and publish to npm
May 6, 2022
733120f
fix(sfpackagebuilder): ignore diff computation on any error
May 7, 2022
d9aa9d5
chore(publish): update versions and publish to npm
May 7, 2022
2167c0c
[CodeFactor] Apply fixes to commit cea880f (#969)
azlam-abdulsalam May 7, 2022
5bb8930
fix(fast-feedback): fix multiple issues with package diff creation
May 8, 2022
7395978
Merge branch 'develop' of https://github.com/Accenture/sfpowerscripts…
May 8, 2022
a306ef5
chore(publish): update versions and publish to npm
May 8, 2022
c512c06
refactor(sfppackagebuilder): remove usage of ChangeComponent and rath…
May 8, 2022
0f27447
chore(publish): update versions and publish to npm
May 8, 2022
a295d08
fix(install-source): skip reconcile if no profiles are found in diff …
May 8, 2022
e43f9a2
chore(publish): update versions and publish to npm
May 8, 2022
9807fac
fix(changedcomponents): revert to an earlier version,as its no longer…
May 9, 2022
0b9c270
chore(publish): update versions and publish to npm
May 9, 2022
56169f9
chore(dependencies): update @salesforce/core to 2.36.1
May 9, 2022
04d342b
chore(publish): update versions and publish to npm
May 9, 2022
4cad898
chore(dependencies): update marked to 4.0.14
May 9, 2022
32b9c5c
chore(dependencies): update semver to 7.3.6
May 9, 2022
77c61f6
chore(dependencies): update @oclif/plugin-help to 5.1.12
May 9, 2022
74f2d58
chore(publish): update versions and publish to npm
May 9, 2022
8ea9db5
chore(dependencies): update source-deploy-retrieve to 5.12.13
May 9, 2022
0dcb0c0
chore(publish): update versions and publish to npm
May 9, 2022
fd7b06a
fix(apex-tests): do not replace coverage when coverage is not requested
May 9, 2022
688c807
chore(publish): update versions and publish to npm
May 9, 2022
9d28102
feat(validate): do not delete scratch org when there is no package to…
azlam-abdulsalam May 9, 2022
f44d6a7
chore(publish): update versions and publish to npm
May 9, 2022
68ddd88
chore(dependencies): update sfdc-soup to 18.2.1
May 9, 2022
e567778
chore(publish): update versions and publish to npm
May 9, 2022
8666701
fix(fast-feedback): fix and refactor impacted test class selection
May 9, 2022
1d1b4c3
chore(publish): update versions and publish to npm
May 9, 2022
f1ad73a
fix(log): fix time displayed as well as packages desplaying undefined…
May 9, 2022
6d00322
chore(publish): update versions and publish to npm
May 9, 2022
f00181e
fix(scratchorg-info-assigner): fix incorrect use of async-retry
May 10, 2022
d0b4bf1
chore(publish): update versions and publish to npm
May 10, 2022
7787529
fix(get-formatted-time): fix get formatted time to use milliseconds
May 10, 2022
4bd8791
chore(publish): update versions and publish to npm
May 10, 2022
4dbd0fe
fix(pool): fix issues while returning scratch org to pool
May 10, 2022
4c51950
chore(publish): update versions and publish to npm
May 10, 2022
0c4d8e4
fix(data-pkg): fix vlocity package being incorrectly returned as empty
May 10, 2022
a2c2838
fix(install-source): packages are committed even when push fails
May 11, 2022
6b17103
feat(fast-feedback): fast feedback to skip packages from validation w…
May 12, 2022
38b36ac
feat(fast-feedback): unhide fast-feedback and display info in header
May 12, 2022
c89562f
feat(reconcile): enhance how reconcile is handled during fast feedback
May 14, 2022
a91e7f3
docs(dr): add a dr on fast feedback
May 14, 2022
709f9b7
chore(sfpowerkit): update sfpowerkit to 4.2.7
May 15, 2022
842723f
fix(alias): fix aliasified packages using username instead of alias
May 16, 2022
3917102
fix(install-package): fix import casing
May 16, 2022
6537764
chore(dockerfile): update sfpowerkit to 4.2.8
May 16, 2022
27f46eb
fix(creation-metrics): fix package creation metrics reporting
May 16, 2022
e462543
chore(dependencies): update @salesforce/core to 2.36.3
May 16, 2022
fe18e4e
fix(dependencies): update import of core to same version in core
May 16, 2022
2d35ccc
fix(package-lock): sync package lock across
May 16, 2022
7ba2734
Add chunking to ApexClassFetcher, ApexTriggerFetcher and ACCG Fetcher…
aly76 May 16, 2022
e8c8e94
fix(fast-feedback): fix All tests getting triggered when invalidated…
May 16, 2022
38e8250
Update 002-fast-feedback.md
vuha-acn May 17, 2022
2b3ea01
fix(publish): create tags when atleast one package is published
May 18, 2022
a24c067
fix(fast-feedback): add warning message when tests are skipped due to…
May 18, 2022
740b67a
fix(install-package): fix logs to show 'default' when aliasifed folde…
May 18, 2022
f7a24b1
fix(fast-feedback): add additional logs about selective components ut…
May 19, 2022
3f7f24b
fix(validate): add error to display when validate fails for anyother …
May 19, 2022
c712826
fix(validate): remove erroneous json stringify on error message
May 19, 2022
ec1f058
chore(publish): update versions and publish to npm
May 19, 2022
46189cb
chore(dependencies): update simple-git to 3.7.1
May 19, 2022
c107bef
chore(publish): update versions and publish to npm
May 19, 2022
3c98081
fix(git): use command to fetch git remote instead of simple-git
May 19, 2022
ade4545
fix(git): fix git related issues on docker
May 20, 2022
967555f
Merge branch 'main' into develop
May 20, 2022
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
59 changes: 59 additions & 0 deletions decision records/validate/002-fast-feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Provide faster feedback during validate

Status: Approved

Issue: #945

## Context and Problem Statement

Validate command in sfpowerscripts is effectively an automated check which validates an incoming change is ready to integrate with the trunk. Effectively a pre check before the CI job is triggered to build the packages. Validate shares the same functionality as used by the Build Command, and a package is marked to be built when the following changes are detected

- A change in package descriptor of a package

- A change in the contents of the package

Validate check for the following for each changed package (by comparing the commit id of the package installed in the scratch org vs incoming package)

- Deployability, whether a package as a whole is deployable in a scratch org along with other components

- Accuracy of Apex classes, by triggering apex test classes for each package

- Coverage Requirements, whether the coverage requirements are met for the type of package

- Optional Dependency and Impact Analysis

Validate also will deploy any changes to external package (packages which are not in the repo).

On analysis of of current DX@Scale projects, the above process on an average takes around 20 mins, with some runs running into multiple hours when the temporary org used for validation does't meet the below criteria

- Temporary org prepared for validation doesnt have all the packages in the repo installed

- Tests for some of the changed packages take a considerable time to complete, This is especially cumbersome for packages that are depenedent on managed packages like CPQ which utilizes a lot of queries and need to be triggered in [serial mode](https://github.dev/Accenture/sfpowerscripts/blob/58351783f629840b4d78e35aa17eb084ef66e769/decision%20records/validate/001-automated-apex-testing-retry.md#L6)

- Fetching coverage of a test run is costly for packages with lot of test classes and there are multiple packages with test classes

- Reconciling large amount of profiles

As more and more developers across Salesforce projects are preferring a pull request workflow as offererd in the DX@Scale model, costly validation becomes a bottleneck in the process, even if the change is only for a single component and worse when the changed component doesn't haven any impact on the apex classes making apex tests not necessary.

sfpowerscripts should offer mechanisms which would provide feedback on a change to the developer as well as reviewer as fast as possible.

## Decision

sfpowerscripts will introduce a new mode 'fast feedback' (by introducing a new flag in validate command) with the aim to reduce the time spent on PR validation. In this particular mode, during validate, sfpowerscripts will primary focus only on the deployability of the changed component as opposed to any other checks as seen in the current validation.

This means the following:

- Validate deployability of a changed package by only installing the changed components in a package

- Accuracy of apex classes by doing an impact analysis and selective tests - Changed components are used to evaluate impacted apex classes, and utilizing these impacted apex classes to figure out required test classes

- Skip coverage calculation, as calculating coverage is no longer feasible

- Skip deployment of a package even if the descriptor is changed (This was based on feedback received, why trigger checks when the only change was version increments or adding a new dependency )

- Skip deployment of top level packages that do not have direct dependency on the package containing changed components.

The above changes will ensure the validate command is highly performant and provides faster feedback than the current mechanism. However, this mechanism is not perfect, hence the users of sfpowerscripts will be asked to implement an optional chaining of normal feedback mode which can be manually triggered if the user intends to compute coverage computation or want to validate scripts being added in the descriptor.

<img width="982" alt="image" src="https://user-images.githubusercontent.com/43767972/168079278-3324381f-555a-43ab-8172-ac0a5390a272.png">
8 changes: 5 additions & 3 deletions dockerfiles/sfpowerscripts.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM heroku/heroku:20
FROM heroku/heroku:20.v77


ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -109,8 +109,10 @@ RUN cd $HOME/sfpowerkit \

# Install sfdx plugins
RUN echo 'y' | sfdx plugins:install [email protected]
RUN echo 'y' | sfdx plugins:install [email protected]
RUN echo 'y' | sfdx plugins:install [email protected]
RUN echo 'y' | sfdx plugins:install [email protected]
RUN echo 'y' | sfdx plugins:install [email protected]



# install sfpowerscripts
Expand All @@ -127,4 +129,4 @@ LABEL org.opencontainers.image.documentation "https://docs.dxatscale.io/projects
LABEL org.opencontainers.image.revision $GIT_COMMIT
LABEL org.opencontainers.image.vendor "DX@Scale"
LABEL org.opencontainers.image.source "https://github.com/Accenture/sfpowerscripts"
LABEL org.opencontainers.image.title "DX@Scale sfpowercripts docker image - April 22"
LABEL org.opencontainers.image.title "DX@Scale sfpowercripts docker image - May 22"
Loading