-
Notifications
You must be signed in to change notification settings - Fork 109
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
fix: allow the same SC in delete and deploy manifests #1261
Conversation
src/collections/componentSet.ts
Outdated
} | ||
deletions.get(key)?.set(sourceKey(component), component); | ||
this.destructiveComponents[deletionType].get(key)?.set(sourceKey(component), component); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's subjective, but I find the previous version of the code easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it doesn't end up updating anything of importance the old way.
src/collections/componentSet.ts
Outdated
@@ -721,7 +739,7 @@ export class ComponentSet extends LazyCollection<MetadataComponent> { | |||
|
|||
const sourceKey = (component: SourceComponent): string => { | |||
const { fullName, type, xml, content } = component; | |||
return `${type.name}${fullName}${xml ?? ''}${content ?? ''}`; | |||
return `${type.name}${fullName}${xml ?? ''}${content ?? ''}${component.isMarkedForDelete()}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this really is needed I think it should be more descriptive than appending false
or true
. I'm hopeful that we can rely on the source components being accurate and assigning them into the correct component sets on add.
QA:
|
src/resolve/treeContainers.ts
Outdated
@@ -11,8 +11,8 @@ import { statSync, existsSync, readdirSync, createReadStream, readFileSync } fro | |||
import * as JSZip from 'jszip'; | |||
import { Messages, SfError } from '@salesforce/core'; | |||
import { isString } from '@salesforce/ts-types'; | |||
import { baseName, parseMetadataXml } from '../utils/path'; | |||
import type { SourcePath } from '../common/types'; | |||
import { baseName, parseMetadataXml } from '../utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets only load the required files instead of the barrel
destructiveChangeType === DestructiveChangesType.PRE | ||
? (this.destructiveChangesType = DestructiveChangesType.PRE) | ||
: (this.destructiveChangesType = DestructiveChangesType.POST); | ||
this.destructiveChangesType = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to stare at this one for a second. comment could be
// [POST, true, undefined ] => POST. Only PRE means PRE
What does this PR do?
allows the same source component to be placed in all types of manifests (pre/post/manifest) simultaneously
What issues does this PR fix or reference?
@W-15231435@
Functionality Before
you could not pre-deploy-delete, deploy, or deploy, post-deploy-delete the same MD
Functionality After
now you can 🚀