vlocityinc/vlocity_build

Login must not occur if there is nothing to be deployed when doing git based comparison

AllanOricil opened this issue · 4 comments

Login must not occur if there is nothing to be deployed when doing git based comparison (consider that the org commit was overwritten)

Before:

  1. login
  2. are there changes?
  3. no? exit 0
  4. deploy
image

After:

  1. are there changes?
  2. no? exit 0
  3. login
  4. deploy

Hi @AllanOricil : The Git Diff happens between the org commit and the commit from the repo. So in order to perform the diff you would have to get the commit from org for which you would have to log in. Apart from that the namespace needs to be fetched from the target org to run some initial process via VBT so we would still have to log in.

@92SGupta when we override the org commit, the login does not need to occur if there isn't any diffs. It is a diff between 2 local git commits.

@AllanOricil The overrideOrgCommit flag was created for a specific use case where one would quickly want to redeploy something to the target org without the need to update the target org commit before the deployment(Like while doing something locally). VBT still updates the HEAD commit in the target org at the end so that we are keeping the commits in sync between what we are deploying and what's updated in the target org so even if there are no diffs. Also, the login would be required for the namespace and config checks. In the pipeline, I believe it's better to use the gitCheck flag unless you have a specific use case where you would want to keep overriding the target org commit.

@92SGupta I still don't understand it. Could u explain with more details what would happen if after checking that there are no diffs we simply return and skip logging in?