Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
docs(dr): propose changes to aliafy package
Browse files Browse the repository at this point in the history
Add a DR proposing change to aliasfy package to eliminate redundancy
  • Loading branch information
azlam-abdulsalam committed Oct 9, 2023
1 parent 077009f commit e9e918f
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions decision records/deployments/003-aliasfy-eliminate-redundancy.md
Original file line number Diff line number Diff line change
@@ -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
| └── <contents>
├── dev
│ └── <contents>
├── sit
│ └── <contents>
└── st
└── <contents>
```

## 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
| └── <base_contents>
├── dev
│ └── <override_contents>
├── sit
│ └── <override_contents>
└── st
└── <override_contents>
```

- sfpowerscripts will continue to try to match the `alias` as it does today.
- If an alias matches, the contents in the `<alias>` directory will be merged with the contents in the `default` directory.
- If there's a conflict, the `<alias>` 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.

0 comments on commit e9e918f

Please sign in to comment.