flxbl-io / sfp

A build system for modular development in Salesforce
https://docs.flxbl.io/sfp/
MIT License
26 stars 13 forks source link

Bug: Source tracking not updated when using nested sfdx-project.json #65

Closed Goobles closed 2 months ago

Goobles commented 3 months ago

Describe the bug

We keep our sources in a monorepository that contains other project files, not just SF related sources. So our sfdx sources are in a nested directory:

.git
/org-sfdx
  /sfdx-project.json
  /force-app/main/default 
/other-non-sfdx-project1
/other-non-sfdx-project2
...

We have to run sfp pool commands in /org-sfdxbecause that's where the sfdx-project.json lives

sfp pool fetch works but with an error: Unable to update local source tracking due to Remote origin must be set in repository

This is because sfp expects the .git folder to exist in the current working directory, you clone the current working directory to a temp directory: https://github.com/flxbl-io/sfp/blob/90c6165ba8c3e268ca11dc82a53f823097691f43/packages/sfp-cli/src/core/git/Git.ts#L138

This copy operation in my case does not include the .git folder that lives one directory up.

To Reproduce Steps to reproduce the behavior:

Create a default sfdx repository and move all sources in a subfolder, for example 'sfdx';

run sfp pool prepare run sfp pool fetch

Fetch works but source tracking is not up to date

Expected behavior I expect source tracking updates to just work the same, no matter where the sfdx-project.json is stored.

Screenshots

image

Platform Details (please complete the following information):

Additional context Add any other context about the problem here.

azlam-abdulsalam commented 3 months ago

@Goobles sfp currently doesnt support the project structure that you have. It would need extensive testing across all other commands