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

feat: signWithHook supports one-time invocation. #30

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

YourWildDad
Copy link

This pull request adds a parameter: noIterateFiles.

In my company, a single Windows certificate is used for signing multiple Electron applications, so we want to centralize the signing capability onto one device to save on certificate purchase costs.

Currently, I plan to modify the signing process on each CI (Continuous Integration) device using a hookFunction. This involves compressing all DLLs that need to be signed into a ZIP file, uploading it to a dedicated signing machine, downloading the signed artifacts after signing is complete, and completing the remote signing process. This ensures that the signing machine does not need to perform any additional tasks, such as packaging frontend artifacts.

However, the original logic of signWithHooks would call the hookFunction multiple times, which would be disastrous in my plan as it would lead to multiple upload and download processes. Therefore, I added a parameter to control this logic. If this parameter is not passed, no one's logic will be affected because it is forward-compatible.

Additionally, some parameters causing type errors were removed from the unit test section.

@YourWildDad YourWildDad requested a review from a team as a code owner July 3, 2024 08:10
@YourWildDad
Copy link
Author

What can i do for merge this?

Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

I don't think this option makes sense how it's currently implemented.

Other modules in the electron ecosystem use a hooks system to allow developers to control things like this.

Id suggest a "preSignFiles" hook that receives all files we're about to sign, and allows implementers to return a different array of files (in your case an empty array as you're going to hand these files off in one go to an external service)

@YourWildDad
Copy link
Author

I don't think this option makes sense how it's currently implemented.

Other modules in the electron ecosystem use a hooks system to allow developers to control things like this.

Id suggest a "preSignFiles" hook that receives all files we're about to sign, and allows implementers to return a different array of files (in your case an empty array as you're going to hand these files off in one go to an external service)

Sure, I will take your advice into consideration. Currently, electron-forge and electron-packager each have their own hooks, so I wasn't sure which hooks to use to achieve the same thing. I will read through the code of forge and packager again and find a suitable hook to use.

@YourWildDad YourWildDad marked this pull request as draft July 10, 2024 13:18
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