Am grouping a workflow for pre-dx salesforce sandbox based development , as a starter kit to later move to dx mode.
All the tasks that are available, are grouped within tasks.json , which are quite easy to access from Tasks/Run.
I will try to summarize series of commands you can run without using command line.
- Make sure you have installed the extension pack
- Make sure you have git installed and added to your path.
- Create and Navigate to a new folder in vscode where you would have your development and a combined repo that manages entire metadata.
cmd + shift + p (mac) / ctrl + shift + p (windows) - this is your place holder to enter commands - we refer to this as command-pallete in this readme.
- Download Release
- Open the folder in vscode and proceed. You can avoid the next step which involves a clone of this repo.
-
open command-pallete and type git:clone
- specify this url : https://github.com/siddharatha/vscode-starter-kit.git
-
Click on the notification to open the repository.
CS-A and JT-A are usually run by release team, so are hidden from the status bar by default. They can be run by using "Run Tasks" from Command Pallete.
Any tasks not visible, are still accessible from "command-pallete" > "Run Task". We can assign shortcuts for specific tasks.
- update the build.properties file with the branch name and repo url.
- I recommend using SSH to avoid saving passwords.
- open tasks from the menu
Tasks -> Run task
-
select "DB" alias "Download/Get Branch"
-
The downloaded repo is maintained in a repo folder.
-
The repo folder is added in .gitignore file , so we are not mixing information of these 2 repos.
- I recommend using the extension forcecode for active development.
- If you want to get your changes from a sandbox, you can use this task.
- This task roughly takes about 5 minutes for a really large environment.
- I would suggest you fill the build.properties with the username, password and serverurl in the sf.username, sf.password and sf.serverurl .
avoid spaces before and after = in build.properties
-
This relies on simple list metadata api to get the information, as audit trail might not give all of that we need. I will update this later where it can mix both of audit api and list api to get what we want.
Before we dive into how to merge these 2 repos, we have to consider how we store our metadata.
- Profiles,permissionsets,labels,objects are the trickiest of all metadata you have to manage.
- Thanks to v40 and above, you dont have to jump through hoops to download permissionset information through metadata api.
- But profiles are still a struggle. We have to deal with download pieces of information.
- Even if we manage to download them all, the way we store it in a vcs system, are not so smooth for merge. Especially when you have teams trying to do parallel development and they are concerned that they have to touch a xml file which has updates of 10's of other developers.
Its scary to touch and merge a large profile xml.
- Compress profile xml files - Alexander Brett
- This small script is quite efficient in compressing the xml files.
- This should reduce the errors in merge.
- I added some extensions to this script as I wanted to mimic what salesforce has done with v40 and above .
- If we store only true values , that would reduce the size drastically.
Store just true values in profile xmls.
- We rely on vscode tasks again.
- if you use vscode-statusbar-tasks extension, you can access them more conviniently.
- This is more straight forward , and is preferrably run by release team.
- Its gonna take about 5 mins for compressing all.
- And pretty much similar with Just True all.
I gave a high level overview of the features of mixing vscode tasks and some custom scripts which can help out.
I hope this repo is useful, feel free to submit your comments or a pull request to improve the flow.