Skip to content

@W-21000456 [Version Retrieve] [CLI] Package Version Retrieve: folder-meta.xml files not extracted from developer zips#1679

Open
ravipanguluri wants to merge 4 commits intomainfrom
rpanguluri/folders-not-retrieved
Open

@W-21000456 [Version Retrieve] [CLI] Package Version Retrieve: folder-meta.xml files not extracted from developer zips#1679
ravipanguluri wants to merge 4 commits intomainfrom
rpanguluri/folders-not-retrieved

Conversation

@ravipanguluri
Copy link
Collaborator

@ravipanguluri ravipanguluri commented Feb 3, 2026

What does this PR do?

This PR updates the Metadata Resolver to find metadata with paths that have no leading separators. We uncovered this issue when customers with folders that contain reports we're trying to retrieve their metadata for their move to 2GP. An sf package version retrieve would give users the report, but it would not retrieve the folder itself. This is because the folder metadata file does not have a leading separator. I change the resolution logic to check the pre-split parts of the path instead of trying to match directly on the path.

What issues does this PR fix or reference?

@W-21000456@

Repo steps: create a package with a folder and put a report in the folder. Add metadata into a 1GP package and convert to 2GP. Run sf package version retrieve.

Functionality Before

Currently, you'll only retrieve the report metadata which lives inside the folder.

Functionality After

You'll retrieve both the folder and report metadata.

@ravipanguluri ravipanguluri changed the title [Version Retrieve] [CLI] Package Version Retrieve: folder-meta.xml files not extracted from developer zips @W-21000456 [Version Retrieve] [CLI] Package Version Retrieve: folder-meta.xml files not extracted from developer zips Feb 3, 2026
@jfeingold35
Copy link
Contributor

@ravipanguluri , this looks good to me. I'll do some QA on it, let you know if I have any problems, and if not then I'll approve and merge it. Expect that within the next few hours.

// e.g., `/reports/` and if it does return that folder name.
folderContentTypesDirs.some((dirName) => {
if (fsPath.includes(`${sep}${dirName}${sep}`)) {
if (parts.includes(dirName)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Do you need to have this be parts.slice(0, -1) so that it excludes the final part of the path and therefore guarantees that it's a folder that's being matched and not a file?

Copy link
Collaborator Author

@ravipanguluri ravipanguluri Feb 5, 2026

Choose a reason for hiding this comment

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

I think you're right about this. I'll quickly test this out though. Although, this would only really get hit if the file was named exactly the same thing as the dirName with no file extension, which seems pretty unlikely.

Copy link
Contributor

@jfeingold35 jfeingold35 left a comment

Choose a reason for hiding this comment

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

Approved pending the .slice usage discussed in feedback.

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