From e9e918f0fbad6ce63954b5c4532190692f933b18 Mon Sep 17 00:00:00 2001 From: azlam Date: Mon, 9 Oct 2023 13:46:43 +1100 Subject: [PATCH] docs(dr): propose changes to aliafy package Add a DR proposing change to aliasfy package to eliminate redundancy --- .../003-aliasfy-eliminate-redundancy.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 decision records/deployments/003-aliasfy-eliminate-redundancy.md diff --git a/decision records/deployments/003-aliasfy-eliminate-redundancy.md b/decision records/deployments/003-aliasfy-eliminate-redundancy.md new file mode 100644 index 000000000..18b5d604d --- /dev/null +++ b/decision records/deployments/003-aliasfy-eliminate-redundancy.md @@ -0,0 +1,55 @@ +# Eliminating Redundancy in Aliasified Source and Data Packages + +* Status: Proposed +* Deciders: Azlam, Vu, Zhebin +* Date: + +## Context and Problem Statement + +The current implementation of aliasified packages in sfpowerscripts supports a 'default' directory and environment-specific directories (e.g., `dev`, `sit`, `st`). While this structure ensures flexibility, it introduces redundancy. The contents of the 'default' directory often have to be duplicated across multiple environment-specific directories. This leads to increased maintenance complexity and greater risk of errors. + +Existing Structure: + +``` +src-env-specific-alias-post +└── main + ├── default + | └── + ├── dev + │ └── + ├── sit + │ └── + └── st + └── +``` + +## Decision + +To alleviate the redundancy and error-prone nature of the current approach, the proposal is to introduce a layer of inheritance for aliasified packages. + +Revised Structure: + +``` +src-env-specific-alias-post +└── main + ├── default + | └── + ├── dev + │ └── + ├── sit + │ └── + └── st + └── +``` + +- sfpowerscripts will continue to try to match the `alias` as it does today. +- If an alias matches, the contents in the `` directory will be merged with the contents in the `default` directory. + - If there's a conflict, the `` directory takes precedence. +- If the alias isn't found, it will fall back to the `default` directory. +- If neither is found, an error will be thrown. + + +- To ensure the changes do not disrupt exising users of the aliasfy feature, this enhanced aliasfy package feature has to be explictly enabled as 'aliasfyv2'in the sfdx-project.json + + +By implementing this inheritance mechanism, we reduce redundancy, simplify maintenance, and minimize the scope for errors. \ No newline at end of file