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

Write unit tests for build and sign release #1521

Merged
merged 65 commits into from
Feb 5, 2025

Conversation

james-garriss
Copy link
Collaborator

@james-garriss james-garriss commented Jan 17, 2025

🗣 Description

Moved some of the build and sign release into a function. Reused existing unit tests and wrote a new one.

Note: Testing Azure Sign Tool itself should be a functional test that is added to nightly tests. A new issue was created for this (#1520).

💭 Motivation and context

Closes: #1453

🧪 Testing

Ran workflow pipeline, checked the results.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • PR targets the correct parent branch (e.g., main or release-name) for merge.
  • Changes are limited to a single goal - eschew scope creep!
  • Changes are sized such that they do not touch excessive number of files.
  • All future TODOs are captured in issues, which are referenced in code comments.
  • These code changes follow the ScubaGear [content style guide]
  • Related issues these changes resolve are linked preferably via [closing keywords]
  • All relevant type-of-change labels added.
  • All relevant project fields are set.
  • All relevant repo and/or project documentation updated to reflect these changes.
  • Unit tests added/updated to cover PowerShell and Rego changes.
  • All automated checks (e.g., linting, static analysis, unit/smoke tests) passed.

✅ Pre-merge checklist

  • PR passed smoke test check.

  • Feature branch has been rebased against changes from parent branch, as needed

    Use Rebase branch button below or use this reference to rebase from the command line.

  • Resolved all merge conflicts on branch

  • Notified merge coordinator that PR is ready for merge via comment mention

  • Demonstrate changes to the team for questions and comments.
    (Note: Only required for issues of size Medium or larger)

✅ Post-merge checklist

  • Feature branch deleted after merge to clean up repository.
  • Verified that all checks pass on parent branch (e.g., main or release-name) after merge.

@james-garriss james-garriss self-assigned this Jan 17, 2025
@james-garriss james-garriss added enhancement This issue or pull request will add new or improve existing functionality infrastructure Related to configuring infrastructure necessary for the project labels Jan 17, 2025
Copy link
Collaborator

@schrolla schrolla left a comment

Choose a reason for hiding this comment

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

Looks good functionally, but recommend some style and comment updates. See below.

.github/workflows/publish_private_package.yaml Outdated Show resolved Hide resolved
.github/workflows/publish_private_package.yaml Outdated Show resolved Hide resolved
.github/workflows/publish_public_package.yaml Outdated Show resolved Hide resolved
.github/workflows/publish_public_package.yaml Outdated Show resolved Hide resolved
Testing/workflow/Build-SignRelease.Tests.ps1 Outdated Show resolved Hide resolved
Testing/workflow/Install-AzureSignTool.Tests.ps1 Outdated Show resolved Hide resolved
Testing/workflow/Build-SignRelease.Tests.ps1 Outdated Show resolved Hide resolved
.github/workflows/publish_private_package.yaml Outdated Show resolved Hide resolved
.github/workflows/build_sign_release.yaml Outdated Show resolved Hide resolved
utils/workflow/Build-SignRelease.ps1 Outdated Show resolved Hide resolved
Copy link
Collaborator

@schrolla schrolla left a comment

Choose a reason for hiding this comment

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

Functionally all good. Saw one missed comment removal and convert tabs to spaces in one spot. But nothing to hold things up. Would recommend addressing before merge though.

.github/workflows/publish_private_package.yaml Outdated Show resolved Hide resolved
@james-garriss james-garriss added this to the Lionfish milestone Jan 30, 2025
@james-garriss james-garriss requested a review from buidav January 30, 2025 18:07
@james-garriss
Copy link
Collaborator Author

Saw one missed comment removal

Fixed

convert tabs to spaces in one spot

Searched via regex and no tabs found. In the example you highlight, note that it's red, meaning it's code that was replaced. So maybe you are seeing the old code that I removed?

image

Happy to replace any tabs that I can find.

@schrolla schrolla reopened this Feb 3, 2025
Copy link
Collaborator

@schrolla schrolla left a comment

Choose a reason for hiding this comment

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

Thanks for the final clean ups, looks good to me.

Copy link
Collaborator

@buidav buidav left a comment

Choose a reason for hiding this comment

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

I tested a modified version of this for ScubaConnect. All the pieces are working like a well oiled machine with the current code signing certificate.

Only have a small additional request to add a comment to the snippet of code that creates the release artifact.

utils/workflow/Build-SignRelease.ps1 Show resolved Hide resolved
@james-garriss
Copy link
Collaborator Author

@nanda-katikaneni

@nanda-katikaneni nanda-katikaneni merged commit 05c64d9 into main Feb 5, 2025
20 checks passed
@nanda-katikaneni nanda-katikaneni deleted the 1453-write-unit-tests-for-build-sign-release branch February 5, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue or pull request will add new or improve existing functionality infrastructure Related to configuring infrastructure necessary for the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write unit tests for build and sign release
4 participants