dxatscale / sfpowerscripts

A build system for modular development in Salesforce
https://dxatscale.io
MIT License
211 stars 94 forks source link

Artifacts arent pulled correctly releasedefinition:generate #1140

Closed Schuchie closed 1 year ago

Schuchie commented 2 years ago

Describe the bug Since the latest update, our generated release definitions files are not containing any artifacts.

To Reproduce GitHub CI and then execute in a workflow the following command:
sfdx sfpowerscripts:releasedefinition:generate We are using the following github Action for checking out the repository:

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Authenticate to STAGE sandbox
        run: |
          echo "${{ secrets.STAGE_SFDX_AUTH_URL }}" > ./stage_authfile
          sfdx auth:sfdxurl:store -f ./stage_authfile -a stage
          rm stage_authfile

      - name: Create release definition file of current stage
        run: |
          node .github/scripts/fix-release.js
          sfdx sfpowerscripts:releasedefinition:generate -n "$RELEASE_NAME" -b "$RELEASE_NAME" -d ./release-definitions -f ./release-definitions/release-config.yml -c origin/main

Expected behavior Release definition file with gets generated inclusive the used artifacts.

Screenshots Looks like a perm issue with the folder:

-------------------------------------------------------------------------------------------
sfpowerscripts  -- The DX@Scale CI/CD Orchestrator -Version:19.7.3 -Release:September 22
-------------------------------------------------------------------------------------------
Processing Artifacts from reference.. origin/main
Copying the repository to /tmp/tmp-156-tecsVJBlKw7Y
Successfully created temporary repository at /tmp/tmp-156-tecsVJBlKw7Y with commit HEAD
Unable to capture version of szgroup-env-specific-pre due to Error: Command failed: git show-ref --tags -d | grep "szgroup-env-specific-pre_v*"
fatal: detected dubious ownership in repository at '/__w/Project/Project'
To add an exception for this directory, call:

    git config --global --add safe.directory /__w/Project/Project

Unable to capture version of szgroup-env-specific-alias-pre due to Error: Failed to find latest tag for szgroup-env-specific-alias-pre
Unable to capture version of szgroup-core due to Error: Command failed: git show-ref --tags -d | grep "szgroup-core_v*"
fatal: detected dubious ownership in repository at '/__w/Project/Project'
To add an exception for this directory, call:

    git config --global --add safe.directory /__w/Project/Project

Unable to capture version of szgroup-access-management due to Error: Command failed: git show-ref --tags -d | grep "szgroup-access-management_v*"
fatal: detected dubious ownership in repository at '/__w/Project/Project'
To add an exception for this directory, call:

    git config --global --add safe.directory /__w/Project/Project

Unable to capture version of szgroup-ui due to Error: Command failed: git show-ref --tags -d | grep "szgroup-ui_v*"
fatal: detected dubious ownership in repository at '/__w/Project/Project'
To add an exception for this directory, call:

    git config --global --add safe.directory /__w/Project/Project

Unable to capture version of szgroup-env-specific-alias-post due to Error: Failed to find latest tag for szgroup-env-specific-alias-post
Unable to capture version of szgroup-temp due to Error: Failed to find latest tag for szgroup-temp
------------Generated Release Definition for release-1.51----------------

Platform Details (please complete the following information):

Additional context Add any other context about the problem here.

azlam-abdulsalam commented 2 years ago

@Schuchie can you add a git fetch --all before calling this command and let me know. I understand this issue and I had added a workaround in the last release, but it seems not working in this instance

https://github.com/dxatscale/sfpowerscripts/blob/353797fa1e329f81238d650405b4391a4a53175e/packages/core/src/git/Git.ts#L59

adrianioana commented 1 year ago

@azlam-abdulsalam @Schuchie I am facing the same issue. Added git fetch --all command before executing the sfpowerscripts command but the outcome is the same.

fatal: detected dubious ownership in repository at '/__w/Project/Project' To add an exception for this directory, call:

git config --global --add safe.directory /__w/Project/Project
azlam-abdulsalam commented 1 year ago

This has been identified as an issue, and is being fixed in the November release. It happens only on GitHub runners afaik