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

Add script to update Jenkins version info registry #492

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

slide
Copy link
Member

@slide slide commented Dec 3, 2024

Adds a script to the installer which will update the version information in the registry for Jenkins after an upgrade of the WAR file vie the Jenkins UI.

Testing done

Tested by setting up a self-signed certificate to check the signing portion of build.ps1. Tested update script as part of of Jenkins community post: https://community.jenkins.io/t/windows-upgrading-in-place-doesnt-update-version-information-in-add-remove-programs/7069/7

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Adds a script to the installer which will update the version
information in the registry for Jenkins after an upgrade of
the WAR file vie the Jenkins UI.
@slide slide requested a review from a team as a code owner December 3, 2024 03:44
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

I guess, people should really run the MSI though...

@timja timja merged commit f28d8e1 into jenkinsci:master Dec 3, 2024
3 checks passed
@timja
Copy link
Member

timja commented Dec 3, 2024

@kmartens27 FYI for changelog

@slide slide deleted the update_jenkinsversion_script branch December 3, 2024 11:27
@slide
Copy link
Member Author

slide commented Dec 3, 2024

I guess, people should really run the MSI though...

I am looking at disabling using the MSI for upgrades, it conflicts with the ability to upgrade the WAR through the Jenkins UI. We need to have one or the other, not both.

@timja
Copy link
Member

timja commented Dec 3, 2024

I guess, people should really run the MSI though...

I am looking at disabling using the MSI for upgrades, it conflicts with the ability to upgrade the WAR through the Jenkins UI. We need to have one or the other, not both.

Its fairly common to be able to do both isn't it? An application can update itself, but if you run an installer it will also update it

Would be good if the upgrade process in Jenkins fully updated everything though.

@slide
Copy link
Member Author

slide commented Dec 3, 2024

I guess, people should really run the MSI though...

I am looking at disabling using the MSI for upgrades, it conflicts with the ability to upgrade the WAR through the Jenkins UI. We need to have one or the other, not both.

Its fairly common to be able to do both isn't it? An application can update itself, but if you run an installer it will also update it

Would be good if the upgrade process in Jenkins fully updated everything though.

Usually in the cases where an application updates itself, it is not using an MSI, or downloads an updated MSI and runs that to upgrade. I agree that the Jenkins UI upgrade would be nice to include this update, but it requires modifying the registry, which requires admin access. If there is a way to run something as admin under Jenkins, we could do it.

@dduportal
Copy link
Collaborator

@slide @timja this PR makes the weekly packaging failing today:

15:01:27  Signing Update-JenkinsVersion.ps1
15:01:28  powershell.exe : C:\home\jenkins\agent\workspace\core_package_master\release\msi\build\build.ps1
15:01:28  At C:\home\jenkins\agent\workspace\core_package_master\release@tmp\durable-01487dbe\powershellWrapper.ps1:3 char:1
15:01:28  + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ...
15:01:28  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15:01:28      + CategoryInfo          : NotSpecified: (C:\home\jenkins...build\build.ps1    :String) [], RemoteException
15:01:28      + FullyQualifiedErrorId : NativeCommandError
15:01:28   
15:01:28   : A parameter cannot be found that matches parameter name 'Password'.
15:01:28  At C:\home\jenkins\agent\workspace\core_package_master\release\make.ps1:46 
15:01:28  char:13
15:01:28  +             & ./build.ps1
15:01:28  +             ~~~~~~~~~~~~~
15:01:28      + CategoryInfo          : InvalidArgument: (:) [build.ps1], ParameterBindi 
15:01:28     ngException
15:01:28      + FullyQualifiedErrorId : NamedParameterNotFound,build.ps1

Is there anything which need to be set up on the infra side to make this work?

@slide
Copy link
Member Author

slide commented Dec 3, 2024

No, there should not be. Is there any more details from the logs?

@slide
Copy link
Member Author

slide commented Dec 3, 2024

Feel free to revert to unblock the release

@dduportal
Copy link
Collaborator

No, there should not be. Is there any more details from the logs?

I am not 100% sure it is this PR, I chose the "last" one. We know it worked last Wednesday for 2.487.
Let me double check the code changes before reverting anything.

Thanks for the quick response

@slide
Copy link
Member Author

slide commented Dec 3, 2024

Ok, it looks like the -Password parameter for Get-PfxCertificate was added in Powershell 6.1, which it seems we don't have for this build. I will look at a different solution for signing (I think signtool can be used as well).

@timja
Copy link
Member

timja commented Dec 3, 2024

Or we use a newer powershell in the build?

@dduportal
Copy link
Collaborator

Or we use a newer powershell in the build?

Yeah, could be a good idea! I felt bad for having reverted your PR, and upgrading to a newer Powershell clearly is a good idea.

The packaging agent definition is a Windows pod template defined here: https://github.com/jenkins-infra/release/blob/master/PodTemplates.d/package-windows.yaml

Packages itself happens in https://github.com/jenkins-infra/release/blob/934635d1f0ab7c29be86f42f79461cdab70a6495/PodTemplates.d/package-windows.yaml#L31

@timja
Copy link
Member

timja commented Dec 3, 2024

I guess because its using dotnet framework 3.5 which is ancient?

https://github.com/jenkins-infra/release/blob/master/PodTemplates.d/package-windows.yaml#L31

@slide
Copy link
Member Author

slide commented Dec 3, 2024

Wix 3.x requires .NET 3.5 to run. I have toyed briefly with updating to Wix 4.x, but haven't had the time to do it.

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