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

Wr/overwrite object file #1338

Merged
merged 5 commits into from
Jun 11, 2024
Merged

Wr/overwrite object file #1338

merged 5 commits into from
Jun 11, 2024

Conversation

WillieRuemmele
Copy link
Member

@WillieRuemmele WillieRuemmele commented Jun 10, 2024

@W-15896939@
forcedotcom/cli#2865

@WillieRuemmele WillieRuemmele force-pushed the wr/overwriteObjectFile branch from 5628e66 to a3542e2 Compare June 10, 2024 21:46
@@ -69,6 +158,10 @@ const validateSourceDir = async (dir: string): Promise<void> => {
})
);
for (const file of sourceFiles) {
if (file.endsWith('.object-meta.xml')) {
const content = fs.readFileSync(file, 'utf8');
expect(content.split(os.EOL).length).to.be.greaterThanOrEqual(64);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we ensure that the .object-meta.xml hasn't been overwritten

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did this one change?

(parentXmlObject: XmlObj) =>
(component: SourceComponent): WriteInfo[] => {
const output = join(defaultDirectory ?? '', getOutputFile(component));
if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (
if ( // avoid overwriting existing files with empty XML objects

@WillieRuemmele WillieRuemmele marked this pull request as ready for review June 11, 2024 15:17
@WillieRuemmele WillieRuemmele requested a review from a team as a code owner June 11, 2024 15:17
@mshanemc
Copy link
Contributor

QA notes:

deploy entire dreamhouse project
project retrieve start -m CustomObject:Broker__c
📓 we get extra metadata that wasn't in the project, but comes from the org. I'll commit that so changes are easier to see for the next QA steps
repeat project retrieve start -m CustomObject:Broker__c
✅ no changes

project retrieve start -m CustomField:Broker__c.Email__c
✅ no changes, object is still as it was

open org, add description to the field
project retrieve preview shows the expected field to retrieve
project retrieve start (no flags) retrieves the new description property
✅ modify field locally, project deploy preview and project deploy start work as expected


mpd with expected blank object

new project pkgDir other-dir with default true
✅ creates field in other-dir along with a blank top-level object-meta.xml

project retrieve start -m "CustomField:Broker__c.*" wildcard match for all fields
✅ object (in the main dir) still has its value


misc

✅ retrieve all StaticResource

@mshanemc mshanemc merged commit f3cf83a into main Jun 11, 2024
73 checks passed
@mshanemc mshanemc deleted the wr/overwriteObjectFile branch June 11, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants