Skip to content

move upgraded .zap file into zcl/ subdirectory#1717

Closed
paulr34 wants to merge 1 commit into
project-chip:masterfrom
paulr34:feat/move-zap-to-zcl-subdir-on-upgrade
Closed

move upgraded .zap file into zcl/ subdirectory#1717
paulr34 wants to merge 1 commit into
project-chip:masterfrom
paulr34:feat/move-zap-to-zcl-subdir-on-upgrade

Conversation

@paulr34

@paulr34 paulr34 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

During the upgrade flow, write the upgraded .zap file into a zcl/ subdirectory relative to where the original lives, so the path changes from /config/app.zap to /config/zcl/app.zap. The subdirectory is created automatically if it doesn't exist.

findZapFiles now accepts an optional skip-subdirectory parameter so that re-runs don't recurse into the output directory and pick up files that were already upgraded.

TODO: make the subdirectory name configurable (e.g. via apack.json) instead of hardcoded.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an option to skip a specified subdirectory (hardcoded as 'zcl') when recursively searching for '.zap' files to prevent re-processing previously upgraded files. However, the recursive call to findZapFiles fails to pass the skipSubdirectory argument, which prevents the exclusion from working correctly for nested subdirectories.

Comment thread src-electron/main-process/startup.js Outdated
@paulr34 paulr34 force-pushed the feat/move-zap-to-zcl-subdir-on-upgrade branch from 26b45c8 to c52d30e Compare June 12, 2026 19:16
* @returns {string[]} Paths of all .zap files found.
*/
function findZapFiles(dir) {
function findZapFiles(dir, skipSubdirectory = null) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have we investigated why this was not an issue before and is an issue now? We should not be hardcoding things like this. What is the underlying issue?

@paulr34 paulr34 Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I agree with you. We should meet with all teams involved and discuss the best path forward.

At the moment, I see two options:

1.) Merge this PR now to unblock progress, then follow up with a separate PR once we've aligned on the long-term solution.
2.) Hold off on merging, meet with the team to determine where the path should be defined, understand why this behavior started occurring, and then implement a fully agreed-upon solution.

Either way, this PR is available if timing becomes a factor and we need to unblock work quickly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Compromise: put the path in apack.json for now.

That avoids hardcoding it in ZAP and doesn't require SDK changes immediately. ZAP can consume the path from apack.json, and we can revisit the long-term ownership of the path later if needed.

Comment thread src-electron/main-process/startup.js Outdated
During the upgrade flow, write the upgraded .zap file into a zcl/
subdirectory relative to where the original lives, so the path changes
from /config/app.zap to /config/zcl/app.zap. The subdirectory is
created automatically if it doesn't exist.

findZapFiles now accepts an optional skip-subdirectory parameter so that
re-runs don't recurse into the output directory and pick up files that
were already upgraded.

TODO: make the subdirectory name configurable (e.g. via apack.json)
instead of hardcoded.

Co-authored-by: Cursor <cursoragent@cursor.com>
@paulr34 paulr34 force-pushed the feat/move-zap-to-zcl-subdir-on-upgrade branch from c52d30e to b199a30 Compare June 12, 2026 19:43
@paulr34

paulr34 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

closing this for now

@paulr34 paulr34 closed this Jun 12, 2026
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.

2 participants