Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow branch specification for package directories and package … #38

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

thbrown
Copy link
Contributor

@thbrown thbrown commented Jun 23, 2021

…dependencies

What does this PR do?

Migrate schema that was checked into internal schema (W-9191272) to the public schema. The migrated schema allows users to specify a branch in packageDirectories and in package dependencies.

What issues does this PR fix or reference?

@W-8794784@

Functionality Before

Users could not supply the branch property.

Functionality After

Users can supply the branch property in two places:

        {
            "path": "app_component_removal",
            "package": "DeleteComponents",
            "versionName": "ver 0.1",
            "versionNumber": "0.1.0.NEXT",
            **"branch": "charlie",**
            "default": false
        },
        {
            "path": "common",
            "package": "common",
            "versionName": "ver 0.1",
            "versionNumber": "0.1.0.NEXT",
            "dependencies": [
                {
                    "package": "branchtest",
                    "versionNumber": "0.1.0.RELEASED",
                    **"branch": "charlie",**
                }
            ],
            "default": false
        },

@thbrown thbrown requested a review from a team as a code owner June 23, 2021 20:21
@thbrown thbrown requested a review from AnanyaJha June 23, 2021 20:21
@AnanyaJha
Copy link

AnanyaJha commented Aug 11, 2021

@thbrown This seems ok, are you also going to update the documentation around this file ? e.g. https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm, https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev2gp_config_file.htm

We should also open a PR to add this new attribute to the current scaffold commands in the Salesforce CLI (https://github.com/forcedotcom/salesforcedx-templates).

@penelopy
Copy link

@AnanyaJha Thanks for flagging ensuring this change is documented. I published a topic that describes how to work with branches - https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp_use_branches.htm and this topic is referenced/linked in the 2nd link you mentioned on project config attributes.
That first link you listed is intentionally high level and not specific to packaging, so I intentionally didn't add it to that topic.
Hope that helps, let me know if you have other concerns.

@AnanyaJha
Copy link

Thanks @penelopy! In that case, @thbrown was anything added to the https://github.com/forcedotcom/salesforcedx-templates repository to ensure the attributes are available in the CLI?

@thbrown
Copy link
Contributor Author

thbrown commented Sep 13, 2021

Thanks @AnanyaJha we did not add anything to the templates repository for this. Looking though the repository it seems like that's used to bootstrap projects. Currently, when creating sfdx-project.json it looks like we only populate the path and defaulton packageDirectories node (https://github.com/forcedotcom/salesforcedx-templates/blob/9e58f8cf905616b868ffb0c6155f7c9d6157b60d/packages/templates/src/templates/project/sfdx-project.json). Which is the bare minimum you need to get started. The rest of the properties need to be added manually or are added by the CLI when doing a package:version:create.

I don't know if we want to keep it that way or provide a way to include more advanced options as well (e.g. branch, version info, dependencies, install/uninstall scripts, etc.). Since there is more than just the 'branch' property involved, I'd like to consider this a part of a separate work item though so I've filed W-9881626.

@AnanyaJha AnanyaJha merged commit 3d63f82 into forcedotcom:main Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants