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

(#155) Keep directory structure for signed PowerShell scripts #156

Merged
merged 2 commits into from
May 22, 2024

Conversation

AdmiringWorm
Copy link
Member

Description Of Changes

This updates how scripts that are signed will be handled, by using the
same directory structure in the output folder as is relative for the now
new parameter for a Root Folder. It also updates how the artifacts are created and uploaded by first create a zip archive of the files hile preserving the directory structure, and then upload only the zip archive.

Motivation and Context

To allow multiple files with the same name to be signed, without the files overwriting eachother, as well as making it easier in the future when we have signed scripts and only need to download a single file that can be extracted immediately to the correct locations.

Testing

This has been tested manually by running the signing process locally, while commenting out the necessary parts that would fail if no signing keys are present.
The verification was that everything was copied to the correct directory structure, a zip archive was created with the same directory structure expected and it uploaded it to the artifacts directory.

Operating Systems Testing

  • Windows 10

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Fixes #155

This updates how scripts that are signed will be handled, by using the
same directory structure in the output folder as is relative for the now
new parameter for a Root Folder.

This allows multiple files to be signed that have the same name, without
them replacing eachother.
This updates the signing process of PowerShell scripts, to instead of
uploading them as artifacts in an uncompressed way that requires
downloading multiple files, we instead create a zip archive of the
scripts while preserving the directory structure where the files came
from.

This allows it to be easier in the future when changes have been made,
and we only need to extract a single archive without having to manually
figure out where the files need to be located.
@AdmiringWorm AdmiringWorm requested a review from gep13 May 22, 2024 13:46
@AdmiringWorm AdmiringWorm self-assigned this May 22, 2024
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gep13 gep13 merged commit e7cd44a into chocolatey:hotfix/0.28.4 May 22, 2024
@gep13
Copy link
Member

gep13 commented May 22, 2024

@AdmiringWorm thanks for getting this fixed!

@AdmiringWorm AdmiringWorm deleted the 155-keep-dir-structure branch May 22, 2024 14:31
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